feat: Add experimental FDv2 support for React Native.#1243
feat: Add experimental FDv2 support for React Native.#1243kinyoklion wants to merge 3 commits intomainfrom
Conversation
f44eae2 to
6f8f006
Compare
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/js-client-sdk-common size report |
| * https://launchdarkly.com/docs/sdk/features/data-saving-mode | ||
| */ | ||
| // eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
| export interface RNDataSystemOptions extends LDClientDataSystemOptions {} |
There was a problem hiding this comment.
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.
|
bugbot review |
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 21b3f73. Configure here.
Requirements
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
dataSystemoption, regressions could impact connectivity and event/flag sync behavior.Overview
Adds an experimental
dataSystemconfiguration to the React Native SDK to enable FDv2-based flag delivery (with a new exportedRNDataSystemOptionstype).Updates
ReactNativeLDClientinitialization to choose between the existing FDv1MobileDataManager+ConnectionManagerflow and a new FDv2 data manager (including lifecycle/network state wiring viaRNStateDetector, and a flush callback).Extends
setConnectionMode/getConnectionModeto support FDv2-specific modes ('one-shot','background', andundefinedto 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.