Repository navigation
Conversation
Add bounded dependent-flag traversal for JSON and protobuf UFC with propagated graph failures and transactional prerequisite exposures. Environment: Datadog workspace Co-Authored-By: Codex GPT-5 <noreply@localhost>
OpenFeature Browser Provider Bundle SizesMeasured from the Vite production output after installing packed Both scenarios initialize an OpenFeature provider, evaluate a boolean flag, change context, and evaluate again. Telemetry is disabled for DatadogProvider; no tracking hooks are registered for DatadogCoreProvider. DatadogProvider fetches precomputed assignments for each context; DatadogCoreProvider receives rules from fetchRulesConfiguration once and evaluates locally. Sizes include OpenFeature and the same small scenario harness. Configuration responses are supplied by Playwright and are not bundled. These are complete scenario JS sizes, not configuration payload sizes or isolated provider/Protobuf costs; the difference between rows is not a decoder-only delta.
Dependency checks passed: no Protobuf markers in default/precomputed scenarios; markers present in rules-based scenarios. OpenFeature Browser Tracking Hook Bundle SizesSynthetic entrypoints import and call tracking hook factories from the packed
OpenFeature Node Server Bundle SizesIndependent Webpack production builds of the installed core and Node SDK tarballs, targeting Node 18 with ESM (
Adding SSR helpers to the provider adds 80.1 KiB raw / 22.4 KiB gzip in this build. This includes fetching, parsing, and serialization, not just the decoder. SSR helpers fetch rules for the browser, not for configuring that provider (which uses its existing JSON API). These are bundler sizes, not npm install sizes, unbundled Node require/import costs, payload sizes, or latency. Gzip compares compressed artifacts. The browser scenarios include OpenFeature and a different harness, so their sizes are not directly comparable. Dependency checks passed: no Protobuf runtime or generated schema modules in the provider-only bundle; present in both SSR bundles (checked using Webpack module statistics). This report shows current PR artifact sizes only; it does not compare against the base branch. |
Motivation
The JavaScript rules evaluator currently resolves conditions only from request attributes. UFC can now reference another flag's variant key, so the evaluator needs bounded graph traversal with deterministic telemetry and the Node provider must publish prerequisite events through its normal channels.
Linear: FFL-1694 — [SDK][JS] Support Dependent Flags
System context
flowchart LR UFC["UFC JSON or protobuf"] --> Core["Flagging core evaluator"] Core --> Session["Lazy dependency evaluation session"] Session --> Result["Root resolution"] Session --> Telemetry["Evaluation and exposure candidates"] Telemetry --> Provider["Node OpenFeature provider"] Provider --> Channels["Diagnostics and exposure channels"] classDef changed fill:#e36209,color:#fff,stroke:#8a3800,stroke-width:3px class Core,Session,Telemetry,Provider changedThis PR changes the highlighted evaluator and provider path. Precomputed assignments remain unchanged.
Changes
flagEvaluationconditions for JSON and protobuf UFC.ONE_OFandNOT_ONE_OFcomparisons against prerequisite variant keys.10and accepting overrides from0through255.Evaluation flow implemented by this PR
sequenceDiagram participant Caller participant Root as Root evaluator participant Condition as Dependent condition participant Session as Lazy dependency session participant Prereq as Prerequisite evaluator participant Eval as Evaluation telemetry participant Exposures as Exposure buffer participant Provider as Node provider Caller->>Root: evaluate root flag Root->>Condition: evaluate conditions in declaration order alt no dependent condition is reached Condition-->>Root: ordinary attribute result else dependent condition is reached Condition->>Session: create on first dependency Session->>Session: check depth, active stack, and memo Session->>Prereq: evaluate prerequisite Prereq-->>Session: variant key or error Session->>Eval: emit completed evaluation immediately alt prerequisite succeeds Session->>Exposures: append candidate Session-->>Condition: prerequisite variant key else prerequisite fails Session-->>Root: propagate graph error Root-->>Caller: caller default and normalized error Note over Exposures: discard all candidates end end Root-->>Caller: root result opt root succeeds after dependencies Root->>Provider: commit dependency exposures Provider->>Provider: deduplicate and publish dependencies Provider->>Provider: publish root exposure last endTest instructions
Run the focused core and provider suites, then the repository checks:
The shared fixture runner covers root evaluation results for these behaviors:
ONE_OFandNOT_ONE_OFRetain focused handwritten tests where the shared fixture contract cannot provide coverage:
Compatibility and risk
Checklist