Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .changeset/multivariate-evaluation.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/pin-legacy-node-evaluator.md

This file was deleted.

17 changes: 17 additions & 0 deletions packages/flag-evaluation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# @reflag/flag-evaluation

## 2.0.0

### Major Changes

- d7078e0: Introduce a v2-only compiled-variant evaluator:
- `newEvaluator({ flags, segments })` prepares a complete collection and returns `evaluateAll(context)` and `evaluateFlag(context, flagKey)` methods. The batch result contains shared normalized context and per-flag results without repeated context. Single-flag evaluation visits only the requested flag and its dependencies. Unresolved batch entries do not prevent other flags from being evaluated. Remove the v1 value-rule APIs and the one-shot `evaluateFlag` wrapper.
- Preserve flag and segment reference nodes instead of inlining their filters. Flag references explicitly match variant keys; segments remain reusable predicates. Resolve references recursively without dependency-result caching or memoization.
- Preserve diagnostics from unsuccessful referenced rules without suppressing a valid matching selection. Invalid nonmatches remain fail-closed through negation. Propagated diagnostics identify their source flag or segment.
- Reject duplicate keys, missing references, unknown referenced variant keys and cycles at preparation, including mixed flag/segment cycles. Evaluating an unknown flag key throws.
- Preserve arbitrary variant value types through `CompiledFlag<T>` and `EvaluationResult<T>` (default `any`). `resolved: true | false` distinguishes a selected value, including `undefined`, from failure. Successful results require the variant key and matched rule ID.
- Keep membership Sets and prepared percentage bounds private. `ANY_OF` / `NOT_ANY_OF` use cached Set lookups, including under groups and negations; percentage distributions use precomputed bounds and a simple scan.
- Evaluate rules sequentially with explicit fallthrough and source-version/rule/allocation diagnostics.
- Return structured `INVALID_COMPARISON` errors for invalid numeric/date comparisons instead of logging context values. Invalid conditions cannot match through negation.
- Retain the original hash function and threshold rollout filter for boolean cohort compatibility. The inclusive maximum distribution bucket selects the last nonzero allocation.

The runtime exports are `newEvaluator`, `flattenContext`, and `hashInt`. Removed APIs include `evaluateFlagRules`, `newFlagEvaluator`, `evaluateFlag`, the scalar `evaluate` helper, and the legacy `flattenJSON` / `unflattenJSON` helpers.

## 1.1.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/flag-evaluation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reflag/flag-evaluation",
"version": "2.0.0-next.0",
"version": "2.0.0",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
6 changes: 6 additions & 0 deletions packages/node-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @reflag/node-sdk

## 1.8.3

### Patch Changes

- d7078e0: Keep the existing Node SDK on evaluator 1.1.2 through the `@reflag/flag-evaluation-v1` npm alias. This preserves its legacy protocol and prevents the evaluator's v2 workspace release from automatically upgrading its dependency before SDK migration.

## 1.8.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/node-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reflag/node-sdk",
"version": "1.8.2",
"version": "1.8.3",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
7 changes: 7 additions & 0 deletions packages/openfeature-node-provider/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @reflag/openfeature-node-provider

## 1.2.8

### Patch Changes

- Updated dependencies [d7078e0]
- @reflag/node-sdk@1.8.3

## 1.2.7

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/openfeature-node-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reflag/openfeature-node-provider",
"version": "1.2.7",
"version": "1.2.8",
"license": "MIT",
"repository": {
"type": "git",
Expand Down Expand Up @@ -36,7 +36,7 @@
"fmt:fix": "oxfmt --write ."
},
"dependencies": {
"@reflag/node-sdk": "1.8.2"
"@reflag/node-sdk": "1.8.3"
},
"devDependencies": {
"@babel/core": "~7.29.6",
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6830,7 +6830,7 @@ __metadata:
languageName: unknown
linkType: soft

"@reflag/node-sdk@npm:1.8.2, @reflag/node-sdk@workspace:*, @reflag/node-sdk@workspace:^, @reflag/node-sdk@workspace:packages/node-sdk":
"@reflag/node-sdk@npm:1.8.3, @reflag/node-sdk@workspace:*, @reflag/node-sdk@workspace:^, @reflag/node-sdk@workspace:packages/node-sdk":
version: 0.0.0-use.local
resolution: "@reflag/node-sdk@workspace:packages/node-sdk"
dependencies:
Expand Down Expand Up @@ -6878,7 +6878,7 @@ __metadata:
"@babel/core": "npm:~7.29.6"
"@openfeature/core": "npm:^1.5.0"
"@openfeature/server-sdk": "npm:>=1.16.1"
"@reflag/node-sdk": "npm:1.8.2"
"@reflag/node-sdk": "npm:1.8.3"
"@reflag/tsconfig": "npm:~0.0.2"
"@types/node": "npm:^22.12.0"
flush-promises: "npm:~1.0.2"
Expand Down
Loading