feat: Prepare FDv2 EAP for browser and React Native SDKs#1419
Conversation
Make the FDv2 data system configurable for the browser and React Native client SDKs and align them with the server EAP. - Drop @internal from the user-facing FDv2 config surface (dataSystem option, setConnectionMode, FDv2 getConnectionMode overload) in sdk-client, browser, and React Native; implementation internals stay @internal, matching the server SDK. - Replace the experimental/UNSUPPORTED notices on those members with the standard EAP wording used by the shared FDv2 interfaces. - Remove the now-unnecessary @ts-ignore comments from the browser and React Native FDv2 example apps. - Run FDv2 contract tests alongside FDv1 in CI for both SDKs (floating v3 harness), adding dataSystem support to the React Native contract-test entity.
|
bugbot review |
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/browser size report |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit fcd9a0c. Configure here.
yarn 4 requires the fully-qualified workspace name; the local run-contract-tests.sh used the bare 'react-native-contract-test-entity'.
Mirror the android-client-sdk setup: instead of hand-downloading specific sdk-test-harness release tarballs and resolving the v3 tag manually, fetch the official downloader/run.sh (the same one the launchdarkly/gh-actions contract-tests action uses) and invoke it with VERSION=v2 (FDv1) and VERSION=v3 (FDv2) inside the android-emulator-runner script, where the emulator is alive. GITHUB_TOKEN is passed to the emulator step so the downloader avoids GitHub API rate limits.
## Summary
Adds `packages/sdk/react/examples/example-fdv2`, a minimal Vite + React
app for exercising the React SDK's FDv2 **data saving mode**
(`dataSystem`) configuration -- the React counterpart to the existing
browser and React Native `example-fdv2` apps. Intended for manual
testing of the EAP feature.
What it does:
- Enables the FDv2 data system via the provider's `ldOptions`
(`dataSystem: {}`) in `src/LDClient.tsx`, with a commented
manual-mode-switching variant.
- Evaluates a flag with `useBoolVariation` (updates live).
- Drives `setConnectionMode` (streaming / polling / offline / one-shot /
background / automatic), `setStreaming`, and `identify` (context
switching) through `useLDClient()`.
- Includes an action log.
Also registers the new workspace in the root `package.json`.
### Run it
```bash
yarn workspaces foreach -pR --topological-dev --from '@launchdarkly/react-sdk' run build
LAUNCHDARKLY_CLIENT_SIDE_ID=your-id yarn workspace @launchdarkly/react-sdk-example-fdv2 start
```
### Validation
- `vite build` succeeds (30 modules bundle cleanly).
- The `dataSystem` config typechecks against the React SDK.
- `tsc` reports one pre-existing `@types/react` skew error (`bigint` not
assignable to `ReactNode`) that also affects the existing `hello-react`
example; it does not affect the Vite dev/build runtime.
### Notes
- Stacked on the FDv2 EAP branch
(`sdk-2460/fdv2-eap-browser-react-native`, PR #1419) because the example
relies on the public `dataSystem` option that the EAP work exposes.
Rebase onto `main` once #1419 merges.
- The example pins `@launchdarkly/react-sdk` to the workspace version
(resolves to the local build), consistent with the other example-fdv2
apps.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes affect CI contract-test harness versions and RN SDK config
translation for FDv2; runtime SDK behavior is mostly doc/API surface,
but mis-mapped `dataSystem` in contract tests could hide regressions.
>
> **Overview**
> Adds a new Vite + React **data saving mode** example at
`packages/sdk/react/examples/features/data-saving-mode`, registers it in
the root workspace and `release-please-config.json`, and documents
manual EAP testing (`dataSystem`, `setConnectionMode`, `setStreaming`,
`identify`).
>
> **FDv2 EAP documentation:** Replaces `@internal` / experimental
warnings on `dataSystem` and FDv2 `setConnectionMode` /
`getConnectionMode` in shared `LDOptions`, browser, and React Native
with **Early Access** messaging and a link to the data-saving-mode docs;
FDv2 examples drop `@ts-ignore` where types are now public.
>
> **Contract test CI:** Browser workflow runs **FDv1** then **FDv2**
harness (`version: v3`, separate suppressions) without stopping the
service between runs. React Native CI drops the pinned harness tarball,
passes `GITHUB_TOKEN`, and runs FDv1 + FDv2 via the official harness
downloader; `ClientEntity` maps harness `dataSystem` (connection modes,
initializers/synchronizers, payload filter) into RN `LDOptions`, with
FDv1 streaming/polling config unchanged when `dataSystem` is absent.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
ff9253f. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
🤖 I have created a release *beep* *boop* --- <details><summary>browser: 0.1.27</summary> ## [0.1.27](browser-v0.1.26...browser-v0.1.27) (2026-06-08) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk bumped from 4.8.1 to 4.9.0 </details> <details><summary>client-testing-plugin: 0.1.1</summary> ## [0.1.1](client-testing-plugin-v0.1.0...client-testing-plugin-v0.1.1) (2026-06-08) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk-common bumped from 1.28.1 to 1.29.0 * devDependencies * @launchdarkly/js-client-sdk bumped from 4.8.1 to 4.9.0 * @launchdarkly/react-sdk bumped from 4.1.1 to 4.1.2 * peerDependencies * @launchdarkly/js-client-sdk bumped from >=4.8.1 to >=4.9.0 * @launchdarkly/react-sdk bumped from >=4.1.1 to >=4.1.2 </details> <details><summary>jest: 1.0.22</summary> ## [1.0.22](jest-v1.0.21...jest-v1.0.22) (2026-06-08) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/react-native-client-sdk bumped from ~10.18.1 to ~10.19.0 </details> <details><summary>js-client-sdk: 4.9.0</summary> ## [4.9.0](js-client-sdk-v4.8.1...js-client-sdk-v4.9.0) (2026-06-08) ### Features * Prepare FDv2 EAP for browser and React Native SDKs ([#1419](#1419)) ([6ee9c51](6ee9c51)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk-common bumped from 1.28.1 to 1.29.0 </details> <details><summary>js-client-sdk-common: 1.29.0</summary> ## [1.29.0](js-client-sdk-common-v1.28.1...js-client-sdk-common-v1.29.0) (2026-06-08) ### Features * Prepare FDv2 EAP for browser and React Native SDKs ([#1419](#1419)) ([6ee9c51](6ee9c51)) </details> <details><summary>node-client-sdk: 0.0.4</summary> ## [0.0.4](node-client-sdk-v0.0.3...node-client-sdk-v0.0.4) (2026-06-08) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk-common bumped to 1.29.0 </details> <details><summary>react-native-client-sdk: 10.19.0</summary> ## [10.19.0](react-native-client-sdk-v10.18.1...react-native-client-sdk-v10.19.0) (2026-06-08) ### Features * Prepare FDv2 EAP for browser and React Native SDKs ([#1419](#1419)) ([6ee9c51](6ee9c51)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk-common bumped from 1.28.1 to 1.29.0 </details> <details><summary>react-sdk: 4.1.2</summary> ## [4.1.2](react-sdk-v4.1.1...react-sdk-v4.1.2) (2026-06-08) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk bumped from ^4.8.1 to ^4.9.0 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Ships opt-in FDv2 flag delivery and connection-mode behavior; default FDv1 paths are unchanged, but adopters of `dataSystem` hit an Early Access API and new networking semantics. > > **Overview** > Release Please version cut that publishes **FDv2 / data saving mode Early Access** across the client SDK family by bumping `@launchdarkly/js-client-sdk-common` to **1.29.0** and cascading dependency updates. > > **`@launchdarkly/js-client-sdk` 4.9.0** and **`@launchdarkly/react-native-client-sdk` 10.19.0** document opt-in via `dataSystem: {}` (FDv2); apps without `dataSystem` keep FDv1. Browser/React Web use streaming with polling fallback and manual `automaticModeSwitching` only; React Native defaults to foreground streaming / background polling with lifecycle-based mode switching unless disabled. > > **`@launchdarkly/react-sdk` 4.1.2** picks up the browser SDK and documents the same opt-in through `ldOptions.dataSystem`. Wrapper packages (`@launchdarkly/browser`, `node-client-sdk`, `client-testing-plugin`, `@launchdarkly/jest`) and examples only update pinned versions and changelogs; there is no new runtime code in this diff beyond release stamps (e.g. `BrowserInfo`, `PlatformInfo`, `LDReactClient` wrapper version). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 3920b03. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Summary
Prepares the FDv2 data system for Early Access on the browser and React Native client SDKs, bringing them in line with the server EAP.
@internalannotation from the user-facing FDv2 config surface -- thedataSystemoption (sdk-client, browser, React Native),setConnectionMode, and the FDv2getConnectionModeoverload -- so applications can opt in. FDv2 implementation internals (initializers, synchronizers, bases, etc.) stay@internal, matching the server SDK.@ts-ignorecomments from the browser and React Native FDv2 example apps (the fields they suppressed are now public).v3test-harness version:contract-testsrun (version: v3) reusing the existingsuppressions_datamode_changes.txtbaseline; the FDv1 run no longer stops the service so both runs share one instance.dataSystemtranslation to the React Native contract-test entity (mirroring the browser entity, which already had it) and a placeholdersuppressions-fdv2.txt.Follows the server-node FDv2 CI pattern and the android-client-sdk client-side FDv2 work (PR #369).
The
v3harness resolves to the latestv3.xrelease at run time (currentlyv3.1.0-alpha.6, the first with client-side FDv2 support). The React Native FDv2 suppression list starts empty and may need tuning once CI reports which cases to skip.Note
Medium Risk
Exposes unstable FDv2 configuration on public TypeScript surfaces and adds CI that depends on floating v3 harness releases; runtime flag-delivery behavior is unchanged unless customers opt into
dataSystem.Overview
Prepares FDv2 (data-saving mode) for Early Access on the browser and React Native client SDKs by making the opt-in API public and aligning docs with the shared EAP wording.
Public API & docs:
@internal/ “experimental unsupported” notices are removed from user-facingdataSystem,setConnectionMode, and FDv2getConnectionModeoverloads in sharedLDOptions, browser, and React Native types. Those members now document early access (no semver guarantees) and link to the data-saving-mode docs. FDv2 example apps drop@ts-ignorecomments that were only hiding those options.CI contract tests: Browser workflow runs FDv1 then FDv2 harness passes on one test service (
stop_service: falseon v1; v3 harness withsuppressions_datamode_changes.txt). React Native CI downloads v2 and latest v3 harness binaries, runs both fromrun-ci-contract-tests.sh, and addsdataSystemharness → SDK config translation in the RN contract-test entity (same pattern as browser). An emptysuppressions-fdv2.txtplaceholder is included for future skips.Reviewed by Cursor Bugbot for commit fcd9a0c. Bugbot is set up for automated code reviews on this repo. Configure here.