chore: adding custom event when evaluating from RSC#1213
chore: adding custom event when evaluating from RSC#1213
Conversation
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk size report |
59d2a46 to
d5b82f3
Compare
|
@cursor review |
There was a problem hiding this comment.
Real review for this starts here. Previous files are lint and test changes
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
trackrequirement toLDServerBaseClientand 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
trackevent ($ld:react-sdk:rsc-evaluation) the first time any*Variation/*VariationDetailmethod is called viacreateLDServerWrapper, to measure React Server Component evaluation usage.LDServerBaseClientis extended to requiretrack(...), tests are refactored to share amakeMockServerClient(now includingtrack), and a newrscTrackingtest suite asserts the one-time tracking behavior; example formatting tweaks to CSS/tsconfig.jsonare also included.Written by Cursor Bugbot for commit 7b1f930. This will update automatically on new commits. Configure here.