Skip to content

feat: adopt v2 flag values in Browser, React and Vue SDKs - #791

Draft
roncohen wants to merge 20 commits into
mainfrom
feature/browser-framework-sdk-v2
Draft

roncohen wants to merge 20 commits into
mainfrom
feature/browser-framework-sdk-v2

Conversation

@roncohen

@roncohen roncohen commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Stack and review boundary

Summary

  • Migrate Browser, React and Vue to protocol-v2 evaluated flags and direct JSON values. Bare singular reads return Boolean/false; positional JSON defaults infer widened mutable values. Runtime matching checks only the top-level category. Explicit null accepts arbitrary JSON; old flag wrappers are removed.
  • Fetch values and opt-in metadata together from /flags/evaluated, with atomic validation and context/version guards. Metadata-only refresh preserves bootstrapped values/provenance. There is no legacy metadata bridge.
  • Register requested-root checks immediately with buffered, identity-aware delivery. Diagnostics and bootstrap serialization do not register checks; defaults, category mismatches, overrides and value-only fallbacks do not invent selections.
  • Isolate v2 cache/override storage, retain known-good snapshots, own returned JSON/context, and capture refresh-cache identity before update listeners can change context.
  • React useFlag is non-suspending; useFlagSuspense explicitly waits. Vue returns refs to direct values. Tracking, feedback, loading and opt-in remain separate concerns.
  • Native and OpenFeature Browser stay pinned to published v1 dependencies. The Next.js bootstrap example consumes the inherited Node v2 workspace and matching v2 bootstrap.

Registered-default follow-up

  • Accept named-interface defaults in Browser reads. Check React/Vue non-null defaults against each registered key's value schema, including required/nested properties, array elements and literal unions; React Suspense follows the same contract.
  • Keep explicit single-default-generic hook overloads only for unregistered applications, avoiding a registered-schema bypass.
  • Preserve Boolean bare/undefined reads, arbitrary-JSON null reads, default-inferred widening, readonly inputs/mutable outputs, and runtime JSON validation/copying. This is not nested selected-value runtime validation.
  • Keep arbitrary-JSON input registrations opaque to avoid excessive recursive type instantiation.
  • Preserve public vue declaration imports so built Vue refs do not degrade to any. Add separate registered/unregistered compiler programs.
  • Package-scoped TypeDoc settings identify the readonly mapper as intentionally private without adding a public export or disabling validation globally. Node's inherited docs fix covers its mapper/log-level constant and POSIX anchor processing.

Verification for this follow-up

From clean detached checkouts, excluding the preserved uncommitted patches:

Package Runtime tests
Node 219
Browser 159
React 18
Vue 15
OpenFeature Node (published v1 isolation) 28
OpenFeature Browser (published v1 isolation) 27
Total 466
  • All SDK compiler-contract programs, evaluator/Node/Browser/React/Vue builds, immutable installs, and both Next.js example typechecks passed.
  • The separate real CLI-v2 generator compiled Node/React/Vue consumers against this branch's actual built declarations, including readonly/named defaults, mutation, Boolean/undefined/null reads, wrong schemas, and forbidden wrapper access. No CLI implementation was added here.
  • The final committed documentation build passed without TypeDoc warnings or the prior shell-condition errors. Scoped zero-warning lint, formatting, whitespace and normal commit hooks passed.
  • Earlier Chromium E2E was 16/16 after an unchanged rerun; it was not rerun for this typing delta. Firefox/WebKit and authenticated deployed server acceptance remain unverified. The full Management-generator workspace build was not rerun.

Draft / release boundaries

  • This PR and feat(node-sdk): adopt collection values and Boolean-first reads #790 still conflict with current main; main/evaluator reconciliation remains outstanding. All reported remote checks on 9f3a0ae now pass, including Build & Test and CodeQL. Passing branch CI does not resolve the main conflicts or establish release readiness.
  • Requires compatible /flags/evaluated values + optInEnabled/optIn metadata and canonical-check ingestion. Bootstrap producers and consumers must upgrade together.
  • Pre-existing genuine matched-rule fixes remain local/uncommitted in their owning worktrees, not silently included in these typing commits.
  • CLI direct-value generation, Native/OpenFeature multivariate adoption, server-first deployment, approved saved snapshots, mandatory generated-consumer CI and final packed-artifact checks remain separate gates. Stable evaluator 2.0.0 is already published; reconcile the old prerelease base before release.
  • No package publication, deployment, main merge, persistent demo restart or database change was performed.

@roncohen
roncohen added this pull request to stack #792 November 4, 2026 11:28
Base automatically changed from feature/multivariate-evaluator-v2 to main November 4, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant