Skip to content

feat: Add experimental FDv2 support for React Native.#1243

Draft
kinyoklion wants to merge 3 commits intomainfrom
rlamb/react-native-fdv2
Draft

feat: Add experimental FDv2 support for React Native.#1243
kinyoklion wants to merge 3 commits intomainfrom
rlamb/react-native-fdv2

Conversation

@kinyoklion
Copy link
Copy Markdown
Member

@kinyoklion kinyoklion commented Apr 3, 2026

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

Provide links to any issues in this repository or elsewhere relating to this pull request.

Describe the solution you've provided

Provide a clear and concise description of what you expect to happen.

Describe alternatives you've considered

Provide a clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context about the pull request here.


Note

Medium Risk
Introduces a new FDv2 code path for flag delivery and connection-mode handling, which touches core client initialization and lifecycle/network state wiring. Although gated behind the experimental dataSystem option, regressions could impact connectivity and event/flag sync behavior.

Overview
Adds an experimental dataSystem configuration to the React Native SDK to enable FDv2-based flag delivery (with a new exported RNDataSystemOptions type).

Updates ReactNativeLDClient initialization to choose between the existing FDv1 MobileDataManager + ConnectionManager flow and a new FDv2 data manager (including lifecycle/network state wiring via RNStateDetector, and a flush callback).

Extends setConnectionMode/getConnectionMode to support FDv2-specific modes ('one-shot', 'background', and undefined to clear overrides) while preserving FDv1 behavior and warning on invalid mode usage.

Reviewed by Cursor Bugbot for commit 21b3f73. Bugbot is set up for automated code reviews on this repo. Configure here.

@kinyoklion kinyoklion force-pushed the rlamb/react-native-fdv2 branch from f44eae2 to 6f8f006 Compare April 3, 2026 21:53
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

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

* https://launchdarkly.com/docs/sdk/features/data-saving-mode
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface RNDataSystemOptions extends LDClientDataSystemOptions {}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This may not be strictly required. But if we decide to add RN specific options, then we will have a type to do it in. Where if we use LDClientDataSystemOptions, then we have to do name shenanigans. Or risk breaking things.

The public API shows setConnectionMode(mode: ConnectionMode) and
getConnectionMode(): ConnectionMode. The FDv2-specific overloads
accepting FDv2ConnectionMode and undefined are stripped from
declarations via @internal + stripInternal.
@kinyoklion
Copy link
Copy Markdown
Member Author

bugbot review

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 21b3f73. Configure here.

@kinyoklion kinyoklion changed the title feat: React Native FDv2 support. feat: Add experimental FDv2 support for React Native. Apr 3, 2026
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.

1 participant