Skip to content

chore: adding custom event when evaluating from RSC#1213

Draft
joker23 wants to merge 2 commits intomainfrom
skz/sdk-2052/rsc-wrapper
Draft

chore: adding custom event when evaluating from RSC#1213
joker23 wants to merge 2 commits intomainfrom
skz/sdk-2052/rsc-wrapper

Conversation

@joker23
Copy link
Contributor

@joker23 joker23 commented Mar 20, 2026

WIP - but pushing this up early to get some discussions

This PR will make it so that every React Server session will batch in a custom event (event payload TBD) so we can have a way to track usage


Note

Medium Risk
Adds a new track requirement to LDServerBaseClient and triggers an extra analytics event on the first server-side variation call, which could impact integrations that provide custom clients and may introduce unexpected event volume.

Overview
React server sessions now emit a single custom track event ($ld:react-sdk:rsc-evaluation) the first time any *Variation/*VariationDetail method is called via createLDServerWrapper, to measure React Server Component evaluation usage.

LDServerBaseClient is extended to require track(...), tests are refactored to share a makeMockServerClient (now including track), and a new rscTracking test suite asserts the one-time tracking behavior; example formatting tweaks to CSS/tsconfig.json are also included.

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


Open with Devin

@github-actions
Copy link
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25661 bytes
Compressed size limit: 26000
Uncompressed size: 126143 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: 23240 bytes
Compressed size limit: 24000
Uncompressed size: 121325 bytes

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

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

@joker23 joker23 force-pushed the skz/sdk-2052/rsc-wrapper branch from 59d2a46 to d5b82f3 Compare March 20, 2026 19:45
@joker23
Copy link
Contributor Author

joker23 commented Mar 20, 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

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: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Real review for this starts here. Previous files are lint and test changes

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