Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Valid fractional allocations are rejected, potentially blocking all flag refreshes, while bound clients lose context synchronization and can drop company associations from events.
3 open issues
What changed in this PR
Migrates the Node SDK to the collection evaluator introduced in #744, adding a breaking v2 direct-value API while keeping existing OpenFeature and React bootstrap consumers on published v1.
Changes:
- Introduces Boolean-first reads, positional defaults, and immediate, identity-aware check registration.
- Validates complete flag/segment collections and persists isolated v2 fallback snapshots with ordered saves.
- Updates documentation, type contracts, tests, and the Express example; pins unmigrated consumers to v1.
| File | Description |
|---|---|
yarn.lock |
Resolves the v2 evaluator and published v1 SDK alias. |
packages/react-sdk/dev/nextjs-bootstrap-demo/package.json |
Pins the demo to published Node SDK v1. |
packages/react-sdk/dev/nextjs-bootstrap-demo/app/client.ts |
Imports the v1 SDK alias. |
packages/openfeature-node-provider/src/index.ts |
Uses the v1 SDK alias. |
packages/openfeature-node-provider/src/index.test.ts |
Updates imports and mocks for the alias. |
packages/openfeature-node-provider/package.json |
Pins the provider to published Node SDK v1. |
packages/node-sdk/type-tests/defaults.ts |
Tests default-based inference without declarations. |
packages/node-sdk/type-tests/augmented-defaults.ts |
Tests augmented keys and Boolean-first contracts. |
packages/node-sdk/tsconfig.type-tests.json |
Isolates unaugmented type-contract checks. |
packages/node-sdk/tsconfig.type-tests-augmented.json |
Isolates augmented type-contract checks. |
packages/node-sdk/tsconfig.test.json |
Configures SDK and selected test typechecking. |
packages/node-sdk/test/flagsFallbackProvider.test.ts |
Covers v2 snapshots and storage namespaces. |
packages/node-sdk/test/flag-definitions.test.ts |
Tests collection validation and ownership. |
packages/node-sdk/test/fixtures.ts |
Adds shared v2 collection fixtures. |
packages/node-sdk/test/client-sync.test.ts |
Covers synchronization modes and option validation. |
packages/node-sdk/src/types.ts |
Defines direct values and v2 protocol contracts. |
packages/node-sdk/src/index.ts |
Updates public type exports. |
packages/node-sdk/src/flagsFallbackProvider.ts |
Adds v2 fallback envelopes and namespaces. |
packages/node-sdk/src/flags-cache.ts |
Stores complete collections and exposes an apply callback. |
packages/node-sdk/src/flag-definitions.ts |
Validates and prepares complete collections. |
packages/node-sdk/src/flag-defaults.ts |
Implements default validation and category matching. |
packages/node-sdk/src/config.ts |
Accepts direct JSON overrides. |
packages/node-sdk/src/client.ts |
Implements v2 reads, checks, bootstrap, and persistence. |
packages/node-sdk/README.md |
Documents v2 usage and migration boundaries. |
packages/node-sdk/package.json |
Sets the v2 prerelease and evaluator dependency. |
packages/node-sdk/examples/express/reflag.ts |
Migrates declarations and overrides to direct values. |
packages/node-sdk/examples/express/app.ts |
Uses direct reads and separate usage tracking. |
packages/flag-evaluation/test/release.test.ts |
Checks v2 adoption and v1 consumer isolation. |
.changeset/pin-legacy-node-evaluator.md |
Removes the superseded evaluator-pinning changeset. |
.changeset/node-sdk-collection-values.md |
Records breaking SDK changes and provider isolation. |
Review effort: Balanced
Comment on lines
+110
to
+124
| value.allocations.every( | ||
| (a: unknown) => | ||
| isObject(a) && | ||
| Number.isInteger(a.percentage) && | ||
| a.percentage >= 0 && | ||
| a.percentage <= 100 && | ||
| isObject(a.destination) && | ||
| (a.destination.type === "nextRule" || | ||
| (a.destination.type === "variant" && | ||
| isResult(a.destination, variants))), | ||
| ) && | ||
| value.allocations.reduce( | ||
| (sum: number, a: { percentage: number }) => sum + a.percentage, | ||
| 0, | ||
| ) === 100 |
|
|
||
| checkContextWithTracking(this._options); | ||
| void this._client["syncContext"](this._options); | ||
| checkContext(options); |
Comment on lines
+946
to
+947
| companyId: this.company?.id, | ||
| ...options, |
This was referenced Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Breaking Node SDK v2, stacked on #744's complete-collection evaluator. Companion server protocol/check ingestion: https://github.com/reflagcom/web/pull/3660.
{ flags, segments }snapshots. Evaluate only requested roots/dependencies, without dependency-result caching.nullaccepts arbitrary/nullable JSON.Breaking changes
.value,.isEnabled,.config, and flag.track()access. Ordinary client tracking remains separate.false. Supply positional defaults for other types; batch APIs retain raw JSON/undefinedrecords.getFlagRemote(key, defaultValue, userId?, companyId?, context?); old positional IDs move one position right. Useundefinedfor a Boolean read with explicit IDs.Verification
Scope and rollout
The machine-specific LAN demo and its script remain outside this PR. Browser/React/Vue v2 work will be a separate stacked PR. No package publication or shared deployment is included. Compatible server deployment and transactional saved-snapshot rebuild remain release gates. This PR intentionally targets
feature/multivariate-evaluator-v2, notmain; #744 must land first.