Merged
Conversation
Contributor
|
@launchdarkly/js-sdk-common size report |
Contributor
|
@launchdarkly/js-client-sdk size report |
Contributor
|
@launchdarkly/browser size report |
Contributor
|
@launchdarkly/js-client-sdk-common size report |
joker23
commented
Mar 26, 2026
packages/tooling/contract-test-utils/src/client-side/capabilities.ts
Outdated
Show resolved
Hide resolved
047a537 to
4c460b7
Compare
4c460b7 to
14cef1f
Compare
Contributor
Author
|
@cursor review |
kinyoklion
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR will:
Context
This PR is the result of some exploration on how to make the react contract more idiomatic to react. A few things that I looked into:
useVariationflagsuseRefUltimately, most of the exploration did not yield a good result because they require very verbose changes. A lot of the code consolidation, I think, should be consolidated into the shared contract test tooling package.
Note
Medium Risk
Moves client/handler bookkeeping from React state/refs to module-level globals with manual re-rendering, which could introduce lifecycle/state-leak issues across mounts or tests. Changes are limited to contract-test harness code, but affect client creation/deletion and command routing timing.
Overview
Refactors the React contract-test harness to manage clients and command handlers via module-level
Maps/arrays instead ofuseRef/component state, triggering UI updates via a simple render tick.Client creation/deletion now updates global
clientRecordsand uses a sharedonReadyresolver map to coordinate whenClientInstancehas registered its command handler before returning the client id. Also removes a stale comment inClientEntity.ts.Written by Cursor Bugbot for commit 14cef1f. This will update automatically on new commits. Configure here.