Conversation
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/js-client-sdk-common size report |
28e9506 to
88315e6
Compare
88315e6 to
fd066db
Compare
f582c85 to
50833ff
Compare
50833ff to
9d0544a
Compare
8dcb7b8 to
0c9f3f2
Compare
080fdde to
28d9696
Compare
28d9696 to
a16497c
Compare
24fbd6d to
c6c4040
Compare
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| record.client.close(); | ||
| } | ||
| return prev.filter((r) => r.id !== id); | ||
| }); |
There was a problem hiding this comment.
Side effect in state updater causes double-close
Medium Severity
The onDeleteClient callback calls record.client.close() inside the setClients state updater function. This is a side effect in what React expects to be a pure function. Since the contract tests run via next dev (React Strict Mode is enabled by default), React will double-invoke the updater function during development, causing close() to be called twice on the same client. The side effect (close()) needs to be performed outside the state updater.
|
@cursor review |
|
|
||
| // NOTE: we can make this more idiomatic to React by creating a useCommand hook and reading return values from | ||
| // a rendered component. But for now, this is just a simple way to get the tests running. | ||
| export async function doCommand(client: LDReactClient, params: CommandParams): Promise<unknown> { |
There was a problem hiding this comment.
Right now this is more or less the same as the browser contract test
| @@ -0,0 +1,176 @@ | |||
| import { LDContext, LDEvaluationReason } from '@launchdarkly/react-sdk'; | |||
There was a problem hiding this comment.
Right now this is more or less the same as the browser contract test
| @@ -0,0 +1,90 @@ | |||
| import { LDContext } from '@launchdarkly/react-sdk'; | |||
There was a problem hiding this comment.
same as browser contract tests
| @@ -0,0 +1,22 @@ | |||
| import { LDLogger } from '@launchdarkly/react-sdk'; | |||
There was a problem hiding this comment.
same as browser contract tests
| @@ -0,0 +1,110 @@ | |||
| import { LDLogger } from '@launchdarkly/react-sdk'; | |||
There was a problem hiding this comment.
same as browser contract tests
| @@ -0,0 +1,94 @@ | |||
| import { | |||
There was a problem hiding this comment.
same as browser contract tests
| @@ -0,0 +1,54 @@ | |||
| #!/usr/bin/env node | |||
There was a problem hiding this comment.
same as browser contract tests
There was a problem hiding this comment.
same as browser contract tests


This PR will add the initial contract tests for react sdk
Current limitation of the contract tests is that they are basically just testing the underlying browser sdk. We will iterate these tests to be more idiomatic to the react SDK.
Note
Medium Risk
Moderate risk due to new CI execution steps (Playwright install, background services, harness integration) that can introduce flakiness or longer runtimes, though runtime SDK code is largely untouched.
Overview
Adds React SDK contract tests by introducing a new
packages/sdk/react/contract-testsworkspace that runs a Next.js “entity” controlled via a WebSocket bridge, executes core SDK commands (flag evaluation, identify/track/flush), and supports hook callbacks for test verification.Updates the React GitHub Actions workflow to install/build the adapter + contract-test workspace, install Playwright Chromium, start adapter/entity/browser processes, run the shared
contract-testsaction with asuppressions.txt, and always clean up background services. Also adds React contract-test-specific ESLint/TS config and bumps React SDK dev typings to React 19 (@types/react,@types/react-dom).Written by Cursor Bugbot for commit c6c4040. This will update automatically on new commits. Configure here.