Skip to content

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

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

roncohen wants to merge 14 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 value types and enforce 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. Bootstrap snapshots lacking metadata refresh it on demand through that same v2 endpoint without replacing server-derived values/provenance. There is no legacy metadata fetch. Opt-in mutations confirm versioned evaluation and scoped membership in one refresh.
  • Register requested-root checks immediately, retaining genuine selected-key/source/snapshot identity. Delivery remains buffered and identity-aware rate-limited. Diagnostic access and bootstrap serialization do not register checks; defaults, category mismatches, overrides and static fallbacks do not invent selections.
  • Isolate v2 cache/override storage from v1, preserve known-good snapshots, own returned JSON/context, and prevent reentrant update listeners from redirecting a refresh cache write into another context. The cache-race regression was confirmed failing before the fix.
  • Make React useFlag() non-suspending and add separate useFlagSuspense(). Vue returns shallow refs to direct values. Keep usage tracking, feedback and loading separate; opt-in Suspense remains specific to useOptInFlags.
  • Update examples, README migration guidance, type-contract programs, canonical-check E2E coverage and major changesets. React Native and OpenFeature Browser remain on published v1 dependencies; the Next.js bootstrap example now consumes the inherited Node v2 workspace.

Verification

All of the following passed on the committed content:

  • Browser 159, React 18, Vue 15 runtime tests, with their type-contract programs.
  • Evaluator 301 and Node 219 tests, including Node's type programs.
  • OpenFeature Browser 27 and OpenFeature Node 28 tests against their published-v1 SDK dependencies.
  • Builds/declarations for evaluator, Node, Browser, React, Vue, both OpenFeature providers, and React Native. Build logs were checked for declaration diagnostics as well as process exit codes.
  • Type checks for both Next.js flag/bootstrap examples, including the real built Node v2 declarations.
  • Existing Browser E2E suite in Chromium: 16/16 on a full rerun, using the installed Chromium executable and a temporary local Playwright config. The initial run had one transient top-left widget-position assertion failure (15/16); the unchanged targeted test and unchanged full rerun both passed. No assertion was weakened to obtain the pass.
  • Immutable install, scoped formatting/diff checks, and zero-warning lint across Browser/React/Vue. Normal commit hooks passed without changing the verified content.
  • Changesets status generated the expected evaluator/Node/Browser/React/Vue 2.0.0 plan, plus the existing OpenFeature Node patch. It emits warnings for the deliberately published-v1 Native/OpenFeature Browser pins; neither consumer is scheduled for release by that plan.

Draft / release boundaries

  • Requires the collection-capable evaluator and compatible /flags/evaluated values + optInEnabled/optIn metadata, plus canonical-check ingestion. Bootstrap producers and consumers must upgrade together.
  • Firefox/WebKit E2E and the full Management-generator workspace build were not run in this checkpoint. This is SDK mocked-transport E2E, not authenticated product-UI or real-broker/server acceptance.
  • CLI direct-value generation, Native/OpenFeature multivariate adoption, evaluator publication/patch replacement, server-first deployment and saved-snapshot rollout remain separate work. Recheck intentional v1 dependency isolation during release preparation.
  • No packages have been published and no deployment or persistent demo service/database was changed.

@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