Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
fc5fe4c
feat: add protocol-v2 multivariate flag evaluation
roncohen Sep 16, 2026
7c28d1d
perf: prepare v2 flag lookups and percentage allocations once
roncohen Sep 16, 2026
1127ba8
refactor: use a simple loop for percentage allocation selection
roncohen Sep 16, 2026
fc5fa6f
refactor: preserve generic variant value types through evaluation
roncohen Sep 16, 2026
f05d37e
feat!: expose a v2-only prepared flag evaluator
roncohen Sep 16, 2026
03d9be5
build: prepare evaluator artifacts when packing the workspace
roncohen Sep 16, 2026
8d8bd97
docs: remove SDK rollout note from evaluator changeset
roncohen Sep 16, 2026
912f4fc
fix: distinguish v2 prerelease package identity from v1
roncohen Sep 16, 2026
c597521
build: use the registry v1 alias with distinct v2 package identity
roncohen Sep 16, 2026
1277a59
docs: simplify evaluator readme
roncohen Sep 22, 2026
c9a736d
feat(flag-evaluation): resolve flag and segment collection references
roncohen Oct 29, 2026
ad0d702
feat(flag-evaluation): expose batch and single evaluation methods
roncohen Oct 29, 2026
2448fca
feat(node-sdk): adopt collection values and Boolean-first reads
roncohen Nov 4, 2026
521cf4b
feat: adopt v2 flag values in browser and framework SDKs
roncohen Nov 4, 2026
3cc369b
fix(node-sdk): check registered flag defaults
roncohen Nov 5, 2026
d7ccffe
Merge commit '3cc369ba3b494ae76a0e60e45ece8ca14a740669' into feature/…
roncohen Nov 5, 2026
1729e9e
fix: check registered defaults in browser and framework SDKs
roncohen Nov 5, 2026
595758d
fix(node-sdk): keep internal helpers out of API docs
roncohen Nov 5, 2026
1ed2347
Merge commit '595758d00693eefc677b718c30d8fbb845a2fbad' into feature/…
roncohen Nov 5, 2026
9f3a0ae
fix(browser-sdk): document only public default types
roncohen Nov 5, 2026
0809be2
Merge origin/main into feature/node-sdk-v2
roncohen Nov 14, 2026
23b018b
docs: write framework SDK guides for new integrations
roncohen Nov 15, 2026
793a409
Merge current Node v2 and main into framework v2
roncohen Nov 15, 2026
a12dc2c
feat: migrate React Native SDK to v2 flag values
roncohen Nov 16, 2026
88f13dc
fix: align Next example runtime and share Native defaults
roncohen Nov 16, 2026
846278e
docs: remove check internals from SDK guides
roncohen Nov 16, 2026
f7b6eb4
docs: restructure SDK guides around common tasks
roncohen Nov 16, 2026
e7d2a40
docs: simplify how SDK guides explain flag reads and defaults
roncohen Nov 16, 2026
f512bc8
docs: simplify framework v2 release notes
roncohen Nov 16, 2026
34d9283
fix: notify overridden opt-ins and preserve zero feedback IDs
roncohen Nov 17, 2026
ed0e772
docs: align SDK guide structure and tighten wording
roncohen Nov 17, 2026
49fdef7
refactor: separate browser snapshot diagnostic validation
roncohen Nov 17, 2026
5772b94
fix: clone only requested flags during browser reads
roncohen Nov 18, 2026
101bcb4
refactor: simplify browser response and opt-in validation
roncohen Nov 18, 2026
acd46cd
Merge current main into framework SDK v2
roncohen Nov 18, 2026
e16293a
build: release the SDK v2 family on next
roncohen Nov 18, 2026
fdacaf0
fix: stabilize flag hooks and preserve opt-in metadata freshness
roncohen Nov 19, 2026
bb9b948
refactor: tighten flag snapshots and type React fixtures
roncohen Nov 19, 2026
158f36b
refactor: centralize opt-in metadata resets
roncohen Nov 19, 2026
6055608
Merge current framework SDK base into standalone guides
roncohen Nov 19, 2026
185ff69
Merge current main for framework guide retargeting
roncohen Nov 19, 2026
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
19 changes: 19 additions & 0 deletions .changeset/browser-framework-collection-values.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
"@reflag/browser-sdk": major
"@reflag/react-sdk": major
"@reflag/vue-sdk": major
---

Adopt protocol-v2, adding support for multivariate and JSON flags in Browser, React and Vue.

- Browser `getFlag()` and React `useFlag()` return direct values instead of flag wrappers. Vue `useFlag()` returns a ref to the direct value. Replace `.isEnabled` and `.config` access with direct values, using `.value` for Vue refs in script.
- Reads without a default return Booleans, using `false` when unavailable. Pass a positional default to read strings, numbers, arrays, or objects, with TypeScript inferring the return type. Missing values or values of a different top-level type use the default. Pass `null` to accept any JSON value, including null. Nested payload schemas are not validated at runtime.
- React and Vue's optional `Flags` registration checks non-null defaults against each flag's value type, including React Suspense reads. Named-interface and readonly defaults are supported across Browser, React and Vue without losing their inferred value types.
- React `useFlag()` never suspends. Replace `useFlag(key, { suspense: true })` with `useFlagSuspense(key)` to wait for initialization. Use `useIsLoading()` for loading state; existing provider and `useOptInFlags` Suspense options continue to control opt-in loading only.
- Flag reads automatically record checks. Replace flag-level `.track()` and `.requestFeedback()` calls with the client's separate methods or the framework's tracking and feedback hooks/composables.
- Browser `getFlags()` returns a record of direct values; unavailable flags may be `undefined`. Use `getFlagResults()` for diagnostic access without recording checks.
- Bootstrap data must come from Node SDK v2 and be consumed by matching v2 SDKs. Legacy v1 payloads are incompatible. Replace the Browser client's `bootstrappedFlags` option with `bootstrappedState` and pass the complete bootstrap payload.
- Overrides accept direct JSON values: `undefined` clears an override, while `null` is a value. Saved v1 caches and overrides are not reused.
- Bootstrapped clients load opt-in metadata when requested, without replacing server-provided flag values. Successful opt-in changes update both membership and flag values.

The OpenFeature Browser provider continues to use Browser SDK v1. Legacy remote configuration is not automatically converted into multivariate flag values.
25 changes: 25 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"@reflag/browser-sdk": "2.0.0-next.0",
"@reflag/cli": "1.0.4",
"@reflag/flag-evaluation": "2.0.0",
"@reflag/management-sdk": "0.1.0",
"customer-admin-panel": "0.0.1",
"@reflag/node-sdk": "2.0.0-next.0",
"@reflag/openfeature-browser-provider": "1.3.17",
"nextjs-openfeature-example": "0.2.0",
"@reflag/openfeature-node-provider": "1.2.8",
"@reflag/react-native-sdk": "2.0.0-next.0",
"reflag-react-native-sdk-bare-rn": "0.0.0",
"reflag-react-sdk-expo": "0.0.0",
"@reflag/react-sdk": "2.0.0-next.0",
"nextjs-bootstrap-demo": "0.2.0",
"nextjs-flag-demo": "0.2.0",
"@reflag/rest-api-sdk": "0.0.6",
"@reflag/tsconfig": "0.0.2",
"@reflag/vue-sdk": "2.0.0-next.0"
},
"changesets": []
}
17 changes: 17 additions & 0 deletions .changeset/react-native-collection-values.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@reflag/react-native-sdk": major
---

Adopt protocol-v2, adding support for multivariate and JSON flags in React Native.

- `useFlag()` returns direct values instead of flag wrappers. Reads without a default return Booleans, using `false` when unavailable. Replace `.isEnabled` and `.config` access with direct values.
- Pass a positional default to read strings, numbers, arrays, or objects, with TypeScript inferring the return type. Missing values or values of a different top-level type use the default. Pass `null` to accept any JSON value, including null. Nested payload schemas are not validated at runtime.
- `useFlag()` never suspends. Replace `useFlag(key, { suspense: true })` with `useFlagSuspense(key)` to wait for initialization, and use `useIsLoading()` for loading state.
- Flag reads automatically record checks. Replace flag-level tracking and feedback methods with `useTrack()` and `useSendFeedback()`, using your own Native feedback UI.
- Optional flag typing uses React's `Flags` registration in `@reflag/react-sdk`. Non-null defaults are checked against each registered flag's value type, and named-interface and readonly defaults are supported. Regenerate legacy wrapper-shaped declarations before upgrading.
- Bootstrap data must come from Node SDK v2. Pass the complete payload to `ReflagBootstrappedProvider`; legacy v1 payloads are incompatible.
- AsyncStorage persistence, native live updates and custom storage/SSE adapters remain supported. Live updates are enabled by default; the web toolbar and automatic feedback UI are disabled by default.
- Offline fallbacks accept direct JSON value maps. Arrays of enabled Boolean flag keys remain supported.
- Requires React 17 or later, compatible with your React Native runtime, and matching v2 React/Browser SDKs.

Legacy wrapper and remote-config types are removed. Legacy remote configuration is not automatically converted into multivariate flag values.
2 changes: 2 additions & 0 deletions .github/workflows/package-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
- name: Restore package.json
# This step is necessary because the previous step may have updated package.json
run: git checkout -- package.json packages/*/package.json
- name: Check release channel safeguards
run: yarn test:release
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
working-directory: ./packages/browser-sdk
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
scope: "@reflag"
- name: Install dependencies
run: yarn install --immutable
- name: Determine release channel
id: release-channel
run: node scripts/release-channel.mjs >> "$GITHUB_OUTPUT"
- name: Create release PR or publish packages
id: changesets
uses: changesets/action@v1
Expand All @@ -41,22 +44,22 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.CHANGESETS_BOT_TOKEN }}
- name: Build docs
if: steps.changesets.outputs.published == 'true'
if: steps.changesets.outputs.published == 'true' && steps.release-channel.outputs.prerelease == 'false'
run: yarn docs
- name: Checkout docs with SSH
if: steps.changesets.outputs.published == 'true'
uses: actions/checkout@v3
if: steps.changesets.outputs.published == 'true' && steps.release-channel.outputs.prerelease == 'false'
uses: actions/checkout@v4
with:
repository: reflagcom/docs
ssh-key: ${{ secrets.DOCS_DEPLOY_KEY }}
path: reflag-docs
- name: Copy generated docs to docs repo
if: steps.changesets.outputs.published == 'true'
if: steps.changesets.outputs.published == 'true' && steps.release-channel.outputs.prerelease == 'false'
run: |
rm -rf reflag-docs/sdk
cp -R dist/docs reflag-docs/sdk
- name: Commit and push changes
if: steps.changesets.outputs.published == 'true'
if: steps.changesets.outputs.published == 'true' && steps.release-channel.outputs.prerelease == 'false'
run: |
cd reflag-docs
git config user.name "github-actions[bot]"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ playwright-report/
playwright/.cache/

.pnp.*
.yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
diff --git a/dist/changesets-assemble-release-plan.cjs.js b/dist/changesets-assemble-release-plan.cjs.js
index e07ba6e793021b6cfdec898afca517e293386ddb..7b5839bb19d64c0520a826972d4becc05a0a3b12 100644
--- a/dist/changesets-assemble-release-plan.cjs.js
+++ b/dist/changesets-assemble-release-plan.cjs.js
@@ -518,10 +518,17 @@ snapshot) {
}
if ((preInfo === null || preInfo === void 0 ? void 0 : preInfo.state.mode) === "exit") {
for (let pkg of packages.packages) {
+ if (shouldSkipPackage.shouldSkipPackage(pkg, {
+ ignore: refinedConfig.ignore,
+ allowPrivatePackages: refinedConfig.privatePackages.version
+ })) {
+ continue;
+ }
+ const preVersion = preInfo.preVersions.get(pkg.packageJson.name);
// If a package had a prerelease, but didn't trigger a version bump in the regular release,
// we want to give it a patch release.
// Detailed explanation at https://github.com/changesets/changesets/pull/382#discussion_r434434182
- if (preInfo.preVersions.get(pkg.packageJson.name) !== 0) {
+ if (preVersion != null && preVersion !== 0) {
const existingRelease = releases.get(pkg.packageJson.name);
if (!existingRelease) {
releases.set(pkg.packageJson.name, {
diff --git a/dist/changesets-assemble-release-plan.esm.js b/dist/changesets-assemble-release-plan.esm.js
index ea2be567403c4ef94a65f3218ccb683cf5cb4bc1..da2fcd125f7a4bb691016e6959156b94eed68edd 100644
--- a/dist/changesets-assemble-release-plan.esm.js
+++ b/dist/changesets-assemble-release-plan.esm.js
@@ -507,10 +507,17 @@ snapshot) {
}
if ((preInfo === null || preInfo === void 0 ? void 0 : preInfo.state.mode) === "exit") {
for (let pkg of packages.packages) {
+ if (shouldSkipPackage(pkg, {
+ ignore: refinedConfig.ignore,
+ allowPrivatePackages: refinedConfig.privatePackages.version
+ })) {
+ continue;
+ }
+ const preVersion = preInfo.preVersions.get(pkg.packageJson.name);
// If a package had a prerelease, but didn't trigger a version bump in the regular release,
// we want to give it a patch release.
// Detailed explanation at https://github.com/changesets/changesets/pull/382#discussion_r434434182
- if (preInfo.preVersions.get(pkg.packageJson.name) !== 0) {
+ if (preVersion != null && preVersion !== 0) {
const existingRelease = releases.get(pkg.packageJson.name);
if (!existingRelease) {
releases.set(pkg.packageJson.name, {
diff --git a/src/index.ts b/src/index.ts
index c8038f0b2447d443f56d42b6e1746270979ce894..d062e71db5b47e8be663f7dc449e33f6a70c27d7 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -213,9 +213,18 @@ function assembleReleasePlan(
if (preInfo?.state.mode === "exit") {
for (let pkg of packages.packages) {
+ if (
+ shouldSkipPackage(pkg, {
+ ignore: refinedConfig.ignore,
+ allowPrivatePackages: refinedConfig.privatePackages.version,
+ })
+ ) {
+ continue;
+ }
+ const preVersion = preInfo.preVersions.get(pkg.packageJson.name);
// If a package had a prerelease, but didn't trigger a version bump in the regular release,
// we want to give it a patch release.
// Detailed explanation at https://github.com/changesets/changesets/pull/382#discussion_r434434182
- if (preInfo.preVersions.get(pkg.packageJson.name) !== 0) {
+ if (preVersion != null && preVersion !== 0) {
const existingRelease = releases.get(pkg.packageJson.name);
if (!existingRelease) {
releases.set(pkg.packageJson.name, {
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dev": "lerna run dev --parallel",
"build": "lerna run build --stream",
"test:ci": "lerna run test:ci --stream",
"test:release": "node --test scripts/release-channel.test.mjs",
"test": "lerna run test --stream",
"format": "yarn fmt:fix && yarn lint:fix",
"lint": "yarn oxlint .",
Expand All @@ -31,6 +32,7 @@
},
"devDependencies": {
"@changesets/cli": "^2.29.6",
"@changesets/get-release-plan": "^4.0.15",
"husky": "^9.1.7",
"lerna": "^10.1.1",
"lint-staged": "^16.2.7",
Expand All @@ -45,6 +47,7 @@
"typescript": "^5.7.3"
},
"resolutions": {
"@changesets/assemble-release-plan@npm:^6.0.9": "patch:@changesets/assemble-release-plan@npm%3A6.0.9#~/.yarn/patches/@changesets-assemble-release-plan-npm-6.0.9-e01af97ef4.patch",
"minimatch@npm:9.0.1": "npm:9.0.9",
"postcss@npm:8.4.31": "npm:8.5.32",
"postcss@npm:~8.4.32": "npm:8.5.32",
Expand Down
Loading
Loading