Repository navigation
Commit f42b3b8
Version Packages (#823)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.
# Releases
## @reflag/browser-sdk@2.0.0
### Major Changes
- 1716cae: 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.
- 56bedb7: Opt-in entries from `getOptInFlags()` now have a Boolean
`value` instead of `isEnabled`. The deprecated `getFeatures()` alias is
removed; use `getFlags()`.
- 7e5d5a8: Remove the `fallbackFlags` option. Pass a default to each
flag read instead, for example `useFlag("huddles", true)` or
`getFlag("model", "quick")`; it's returned whenever the flag has no
value. On the server, use a fallback provider to keep evaluating flags
when Reflag can't be reached.
### Patch Changes
- c4b6b44: Start automatic feedback surveys when a user ID is first set
after the client was created without one, for example with
`setContext()` or `updateUser()` after sign-in. Previously, surveys only
worked if the client was created with a user. The OpenFeature Browser
provider now updates its client's context instead of starting a new
client when the first user ID arrives.
## @reflag/cli@2.0.0
### Major Changes
- 0fe8795: Generate flag types for SDK v2. Boolean flags are typed as
`boolean`, and multivariate flags are typed from their values in the
production environment. Add type generation for Vue, and update the
coding-agent rules for the v2 SDKs. CLI 2.0 works with SDK v2 only; keep
using CLI 1.x for apps on SDK v1.
### Patch Changes
- e438bad: Fix app discovery for users who belong to multiple
organizations. `reflag apps list` shows each app's organization, `reflag
init` lets you choose an organization, and existing configs resolve
their `appId` without requiring an `orgId`. Use `orgId` or `--org-id` to
restrict the CLI to one organization. API keys remain scoped to their
app.
- 347d4d5: The coding-agent rules no longer say the OpenFeature
providers use SDK v1.
- efc1695: Rewrite the coding-agent rules from `reflag rules` in plain
language, cover React Native, and note that `fallbackFlags` is replaced
by read defaults.
- 1adfced: Update Express and Zod to patched versions. Preserve CLI
schema parsing behavior when migrating to Zod 4.
## @reflag/node-sdk@2.0.0
### Major Changes
- 521de2f: Adopt protocol-v2, adding support for multivariate and JSON
flags.
- `getFlag(context, key)` and bound `getFlag(key)` return 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. TypeScript infers the return type from the default without
generated declarations. 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.
- With optional `Flags` registration, TypeScript checks non-null
defaults against each flag's value type for local, remote, and bound
reads. Named-interface and readonly defaults are supported.
- Flag reads automatically record checks. Replace flag-level `.track()`
calls with the client's separate `track()` API.
- `getFlags()` and `getFlagsRemote()` return records of direct values;
unavailable flags may be `undefined`.
- `getFlagRemote(key, defaultValue, userId?, companyId?, context?)` now
takes the default second, shifting existing user/company arguments one
position to the right. Pass `undefined` for a Boolean read with explicit
IDs. Bound clients use `getFlagRemote(key, defaultValue?)`.
- `getFlagDefinitions()` returns `{ flags, segments }` instead of an
array.
- Saved fallback snapshots use a new format; v1 snapshots are not
migrated automatically. Regenerate saved snapshots when upgrading.
Built-in storage keeps v1 and v2 snapshots separate.
- `getFlagsForBootstrap()` produces protocol-v2 state. Upgrade
Browser/framework consumers to compatible v2 SDKs before using this
state; v1 bootstrap consumers are incompatible.
- Existing synchronization modes, bound contexts, and local overrides
remain supported. Overrides and static fallbacks accept direct JSON
values.
The OpenFeature Node provider continues to use Node SDK v1. Legacy
remote configuration is not automatically converted into multivariate
flag values.
- 7e5d5a8: Remove the `fallbackFlags` option. Pass a default to each
flag read instead, for example `useFlag("huddles", true)` or
`getFlag("model", "quick")`; it's returned whenever the flag has no
value. On the server, use a fallback provider to keep evaluating flags
when Reflag can't be reached.
### Patch Changes
- 49355be: Keep secret flags out of browser data returned by
`getFlagsForBootstrap()`, including bound clients. Server-side reads
still work, including public flags that depend on secret flags. Remove
dependency names from error details sent to the browser.
- 9654308: Replace workspace-only dependency ranges with
registry-compatible versions so the published SDKs can be installed
outside the monorepo. Keep local workspace linking and the existing v1
OpenFeature dependencies unchanged.
- Updated dependencies [a1bd963]
- @reflag/flag-evaluation@2.0.1
## @reflag/openfeature-browser-provider@2.0.0
### Major Changes
- 347d4d5: Use Reflag SDK v2. Boolean flags resolve with
`getBooleanValue()`, and multivariate flags resolve with the method that
matches their value's type: `getStringValue()`, `getNumberValue()` or
`getObjectValue()`. String and object reads no longer return a Boolean
flag's Remote config key or payload; move Remote config to a
multivariate flag first. Number reads now work. A read returns your
default with `TYPE_MISMATCH` when the value has a different JSON type,
and with `DEFAULT` when the flag has no value. The Browser provider
reports the selected variant's key as `variant`, and updates the
client's context on context changes instead of creating a new client.
### Patch Changes
- c4b6b44: Start automatic feedback surveys when a user ID is first set
after the client was created without one, for example with
`setContext()` or `updateUser()` after sign-in. Previously, surveys only
worked if the client was created with a user. The OpenFeature Browser
provider now updates its client's context instead of starting a new
client when the first user ID arrives.
- Updated dependencies [c4b6b44]
- Updated dependencies [1716cae]
- Updated dependencies [56bedb7]
- Updated dependencies [7e5d5a8]
- @reflag/browser-sdk@2.0.0
## @reflag/openfeature-node-provider@2.0.0
### Major Changes
- 347d4d5: Use Reflag SDK v2. Boolean flags resolve with
`getBooleanValue()`, and multivariate flags resolve with the method that
matches their value's type: `getStringValue()`, `getNumberValue()` or
`getObjectValue()`. String and object reads no longer return a Boolean
flag's Remote config key or payload; move Remote config to a
multivariate flag first. Number reads now work. A read returns your
default with `TYPE_MISMATCH` when the value has a different JSON type,
and with `DEFAULT` when the flag has no value. The Browser provider
reports the selected variant's key as `variant`, and updates the
client's context on context changes instead of creating a new client.
### Patch Changes
- 521de2f: Adopt protocol-v2, adding support for multivariate and JSON
flags.
- `getFlag(context, key)` and bound `getFlag(key)` return 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. TypeScript infers the return type from the default without
generated declarations. 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.
- With optional `Flags` registration, TypeScript checks non-null
defaults against each flag's value type for local, remote, and bound
reads. Named-interface and readonly defaults are supported.
- Flag reads automatically record checks. Replace flag-level `.track()`
calls with the client's separate `track()` API.
- `getFlags()` and `getFlagsRemote()` return records of direct values;
unavailable flags may be `undefined`.
- `getFlagRemote(key, defaultValue, userId?, companyId?, context?)` now
takes the default second, shifting existing user/company arguments one
position to the right. Pass `undefined` for a Boolean read with explicit
IDs. Bound clients use `getFlagRemote(key, defaultValue?)`.
- `getFlagDefinitions()` returns `{ flags, segments }` instead of an
array.
- Saved fallback snapshots use a new format; v1 snapshots are not
migrated automatically. Regenerate saved snapshots when upgrading.
Built-in storage keeps v1 and v2 snapshots separate.
- `getFlagsForBootstrap()` produces protocol-v2 state. Upgrade
Browser/framework consumers to compatible v2 SDKs before using this
state; v1 bootstrap consumers are incompatible.
- Existing synchronization modes, bound contexts, and local overrides
remain supported. Overrides and static fallbacks accept direct JSON
values.
The OpenFeature Node provider continues to use Node SDK v1. Legacy
remote configuration is not automatically converted into multivariate
flag values.
- c0dd5ec: Allow ES modules to import the Node.js OpenFeature provider
through its existing CommonJS build. CommonJS imports and TypeScript
declarations are unchanged.
- Updated dependencies [49355be]
- Updated dependencies [9654308]
- Updated dependencies [521de2f]
- Updated dependencies [7e5d5a8]
- @reflag/node-sdk@2.0.0
## @reflag/react-native-sdk@2.0.0
### Major Changes
- 56bedb7: `useOptInFlags()` now returns `setOptIn` along with `flags`
and `isLoading`. `useSetOptIn()` still works but is deprecated. Opt-in
entries now have a Boolean `value` instead of `isEnabled`. The
deprecated `useFeature()` alias is removed from React and React Native;
use `useFlag()`.
- 1716cae: 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.
- 7e5d5a8: Remove the `fallbackFlags` option. Pass a default to each
flag read instead, for example `useFlag("huddles", true)` or
`getFlag("model", "quick")`; it's returned whenever the flag has no
value. On the server, use a fallback provider to keep evaluating flags
when Reflag can't be reached.
### Patch Changes
- 9654308: Replace workspace-only dependency ranges with
registry-compatible versions so the published SDKs can be installed
outside the monorepo. Keep local workspace linking and the existing v1
OpenFeature dependencies unchanged.
- Updated dependencies [1716cae]
- Updated dependencies [9654308]
- Updated dependencies [56bedb7]
- Updated dependencies [7e5d5a8]
- @reflag/react-sdk@2.0.0
## @reflag/react-sdk@2.0.0
### Major Changes
- 1716cae: 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.
- 56bedb7: `useOptInFlags()` now returns `setOptIn` along with `flags`
and `isLoading`. `useSetOptIn()` still works but is deprecated. Opt-in
entries now have a Boolean `value` instead of `isEnabled`. The
deprecated `useFeature()` alias is removed from React and React Native;
use `useFlag()`.
- 7e5d5a8: Remove the `fallbackFlags` option. Pass a default to each
flag read instead, for example `useFlag("huddles", true)` or
`getFlag("model", "quick")`; it's returned whenever the flag has no
value. On the server, use a fallback provider to keep evaluating flags
when Reflag can't be reached.
### Patch Changes
- 9654308: Replace workspace-only dependency ranges with
registry-compatible versions so the published SDKs can be installed
outside the monorepo. Keep local workspace linking and the existing v1
OpenFeature dependencies unchanged.
- Updated dependencies [c4b6b44]
- Updated dependencies [1716cae]
- Updated dependencies [56bedb7]
- Updated dependencies [7e5d5a8]
- @reflag/browser-sdk@2.0.0
## @reflag/vue-sdk@2.0.0
### Major Changes
- 1716cae: 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.
- 56bedb7: `useOptInFlags()` now returns `setOptIn` along with `flags`
and `isLoading`. `useSetOptIn()` still works but is deprecated. Opt-in
entries now have a Boolean `value` instead of `isEnabled`. The
deprecated `useFeature()` alias is removed from React and React Native;
use `useFlag()`.
- 7e5d5a8: Remove the `fallbackFlags` option. Pass a default to each
flag read instead, for example `useFlag("huddles", true)` or
`getFlag("model", "quick")`; it's returned whenever the flag has no
value. On the server, use a fallback provider to keep evaluating flags
when Reflag can't be reached.
### Patch Changes
- 9654308: Replace workspace-only dependency ranges with
registry-compatible versions so the published SDKs can be installed
outside the monorepo. Keep local workspace linking and the existing v1
OpenFeature dependencies unchanged.
- Updated dependencies [c4b6b44]
- Updated dependencies [1716cae]
- Updated dependencies [56bedb7]
- Updated dependencies [7e5d5a8]
- @reflag/browser-sdk@2.0.0
## @reflag/flag-evaluation@2.0.1
### Patch Changes
- a1bd963: Memoize flag and segment results within each evaluation to
avoid repeated work in shared dependency graphs. Batch evaluation shares
these results across roots, but separate calls and contexts never share
cached results. Preserve variant-key matching, rule traces, diagnostic
provenance and deduplication, and fail-closed handling of cached
dependency errors.
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ron Cohen <744+roncohen@users.noreply.github.com>1 parent c4b6b44 commit f42b3b8
37 files changed
Lines changed: 228 additions & 196 deletions
File tree
- .changeset
- packages
- browser-sdk
- cli
- flag-evaluation
- node-sdk
- openfeature-browser-provider
- openfeature-node-provider
- react-native-sdk
- react-sdk
- vue-sdk
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments