Skip to content

feat: Prepare FDv2 EAP for browser and React Native SDKs#1419

Merged
kinyoklion merged 4 commits into
mainfrom
rlamb/sdk-2460/fdv2-eap-browser-react-native
Jun 8, 2026
Merged

feat: Prepare FDv2 EAP for browser and React Native SDKs#1419
kinyoklion merged 4 commits into
mainfrom
rlamb/sdk-2460/fdv2-eap-browser-react-native

Conversation

@kinyoklion
Copy link
Copy Markdown
Member

@kinyoklion kinyoklion commented Jun 4, 2026

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.

  • Make FDv2 configurable. Removes the @internal annotation from the user-facing FDv2 config surface -- the dataSystem option (sdk-client, browser, React Native), setConnectionMode, and the FDv2 getConnectionMode overload -- so applications can opt in. FDv2 implementation internals (initializers, synchronizers, bases, etc.) stay @internal, matching the server SDK.
  • EAP wording. Replaces the "experimental / UNSUPPORTED" notices on those members with the standard EAP wording already used by the shared FDv2 interfaces.
  • Examples. Removes the now-unnecessary @ts-ignore comments from the browser and React Native FDv2 example apps (the fields they suppressed are now public).
  • CI contract tests. Runs the FDv2 contract tests alongside the existing FDv1 runs for both SDKs, using a floating v3 test-harness version:
    • Browser: a second contract-tests run (version: v3) reusing the existing suppressions_datamode_changes.txt baseline; the FDv1 run no longer stops the service so both runs share one instance.
    • React Native: downloads both the v2 and latest v3 harness binaries and runs both passes; adds dataSystem translation to the React Native contract-test entity (mirroring the browser entity, which already had it) and a placeholder suppressions-fdv2.txt.

Follows the server-node FDv2 CI pattern and the android-client-sdk client-side FDv2 work (PR #369).

The v3 harness resolves to the latest v3.x release at run time (currently v3.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-facing dataSystem, setConnectionMode, and FDv2 getConnectionMode overloads in shared LDOptions, 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-ignore comments that were only hiding those options.

CI contract tests: Browser workflow runs FDv1 then FDv2 harness passes on one test service (stop_service: false on v1; v3 harness with suppressions_datamode_changes.txt). React Native CI downloads v2 and latest v3 harness binaries, runs both from run-ci-contract-tests.sh, and adds dataSystem harness → SDK config translation in the RN contract-test entity (same pattern as browser). An empty suppressions-fdv2.txt placeholder 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.

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.
@kinyoklion
Copy link
Copy Markdown
Member Author

bugbot review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 26365 bytes
Compressed size limit: 29000
Uncompressed size: 129044 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 38739 bytes
Compressed size limit: 39000
Uncompressed size: 212244 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 31979 bytes
Compressed size limit: 34000
Uncompressed size: 114243 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179654 bytes
Compressed size limit: 200000
Uncompressed size: 831422 bytes

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.
@kinyoklion kinyoklion marked this pull request as ready for review June 5, 2026 20:11
@kinyoklion kinyoklion requested a review from a team as a code owner June 5, 2026 20:11
@kinyoklion kinyoklion merged commit 6ee9c51 into main Jun 8, 2026
46 checks passed
@kinyoklion kinyoklion deleted the rlamb/sdk-2460/fdv2-eap-browser-react-native branch June 8, 2026 16:28
@github-actions github-actions Bot mentioned this pull request Jun 8, 2026
kinyoklion added a commit that referenced this pull request Jun 8, 2026
## 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 -->
kinyoklion added a commit that referenced this pull request Jun 8, 2026
🤖 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants