Skip to content

chore: adding wrapper name for react client#1199

Open
joker23 wants to merge 4 commits intomainfrom
skz/sdk-2051/react-wrapper
Open

chore: adding wrapper name for react client#1199
joker23 wants to merge 4 commits intomainfrom
skz/sdk-2051/react-wrapper

Conversation

@joker23
Copy link
Contributor

@joker23 joker23 commented Mar 18, 2026

Note

Low Risk
Low risk: only changes how createClient builds options passed to the underlying JS client, plus adds tests to lock in option-merging behavior.

Overview
The React SDK createClient now injects wrapper metadata (wrapperName defaulting to react-client-sdk and a release-managed wrapperVersion) into the options passed to the underlying @launchdarkly/js-client-sdk client, while still preserving and allowing overrides of user-supplied options.

Tests were added to verify default wrapper values are passed through, user options are retained, and explicitly provided wrapperName/wrapperVersion take precedence.

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


Open with Devin

@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 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
Contributor

github-actions bot commented Mar 18, 2026

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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

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

@joker23 joker23 force-pushed the skz/sdk-2051/react-wrapper branch from b1e6540 to 0dc6c85 Compare March 18, 2026 20:17
@joker23
Copy link
Contributor Author

joker23 commented Mar 18, 2026

@cursor review

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.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

const baseClientOptions: LDOptions = {
...options,
wrapperName: options?.wrapperName ?? 'react-client-sdk',
wrapperVersion: options?.wrapperVersion ?? '0.0.0', // x-release-please-version
Copy link

Choose a reason for hiding this comment

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

wrapperVersion will always remain '0.0.0' — release-please not configured

High Severity

The wrapperVersion is set to '0.0.0' with a // x-release-please-version magic comment, but packages/sdk/react is not listed in release-please-config.json, nor is src/client/LDReactClient.tsx listed as an extra-files entry. This means release-please will never update the '0.0.0' placeholder, and all React client SDK telemetry will permanently report version 0.0.0. Other packages (e.g. packages/sdk/browser) correctly register their files in release-please-config.json with extra-files.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is expected for now

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

const baseClientOptions: LDOptions = {
...options,
wrapperName: options?.wrapperName ?? 'react-client-sdk',
wrapperVersion: options?.wrapperVersion ?? '0.0.0', // x-release-please-version
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot Mar 18, 2026

Choose a reason for hiding this comment

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

🔴 wrapperVersion will always be '0.0.0' because release-please is not configured for the React package

The // x-release-please-version comment on line 123 is intended to have the version string automatically updated during releases. However, packages/sdk/react is completely absent from release-please-config.json, and src/client/LDReactClient.tsx is not listed in any extra-files array. Every other SDK that uses this pattern (e.g., packages/sdk/browser with src/platform/BrowserInfo.ts, packages/sdk/server-node with src/platform/NodeInfo.ts) has corresponding entries in release-please-config.json. Without this configuration, the version will permanently remain '0.0.0', causing incorrect wrapper version telemetry to be reported to LaunchDarkly servers.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@joker23 joker23 marked this pull request as ready for review March 18, 2026 20:47
@joker23 joker23 requested a review from a team as a code owner March 18, 2026 20:47
devin-ai-integration[bot]

This comment was marked as resolved.

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