Skip to content

Conversation

@joker23
Copy link
Contributor

@joker23 joker23 commented Jan 30, 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

sdk-1792

Describe the solution you've provided

  • change the use variation hooks to register on change listeners
  • changes in flags no longer changes the ldclient context

Describe alternatives you've considered

I think this change may require a major version, but we can probably avoid that with some compromises.

Additional context

There is a testing gap here and I will create some tasks to address. I want to do this in a different PR because I would like to refactor RN unit test to use https://oss.callstack.com/react-native-testing-library/ instead of the react testing library.

We also need to revisit the detox test, from some research it seems like detox is the correct technology for e2e testing, but we may want to revisit how to plug in to the sdk test harness (and deprecate the example testing)


Note

Medium Risk
Changes core flag-evaluation hooks to manage subscriptions and state updates; incorrect listener cleanup or dependency handling could cause missed updates or leaks, though the change is localized to the React Native SDK.

Overview
Prevents flag updates from changing the React context value by removing provider-level change listeners and memoizing the { client } context value in LDProvider (deleting setupListeners).

Adds per-flag subscriptions in useTypedVariation and useTypedVariationDetail that initialize local state, listen on change:${key}, and update only when the evaluated value/detail actually changes (using fastDeepEqual), rather than relying on provider re-renders. Tests are updated accordingly, including removal of the now-obsolete setupListeners unit test.

Written by Cursor Bugbot for commit eba484e. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25394 bytes
Compressed size limit: 26000
Uncompressed size: 124693 bytes

@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2026

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2026

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 23334 bytes
Compressed size limit: 25000
Uncompressed size: 81070 bytes

@github-actions
Copy link
Contributor

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

@joker23 joker23 force-pushed the skz/react-native-rendering branch 4 times, most recently from 5936ae2 to baed8fb Compare January 30, 2026 15:36
@joker23 joker23 marked this pull request as ready for review January 30, 2026 15:38
@joker23 joker23 requested a review from a team as a code owner January 30, 2026 15:38
@joker23 joker23 force-pushed the skz/react-native-rendering branch 2 times, most recently from 152a584 to 2086a07 Compare January 30, 2026 18:37
@joker23 joker23 marked this pull request as draft February 2, 2026 16:21
@joker23 joker23 marked this pull request as ready for review February 2, 2026 17:21
@joker23 joker23 requested a review from kinyoklion February 3, 2026 00:00
Copy link

@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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@joker23 joker23 force-pushed the skz/react-native-rendering branch from 4d4550f to 5669d5d Compare February 6, 2026 16:14
@joker23 joker23 force-pushed the skz/react-native-rendering branch from 4dae4ab to eba484e Compare February 6, 2026 17:34
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