Skip to content

feat: add scoped clients to server sdks#1254

Draft
joker23 wants to merge 1 commit intomainfrom
skz/sdk-2139/js-scoped-clients
Draft

feat: add scoped clients to server sdks#1254
joker23 wants to merge 1 commit intomainfrom
skz/sdk-2139/js-scoped-clients

Conversation

@joker23
Copy link
Copy Markdown
Contributor

@joker23 joker23 commented Apr 8, 2026

Warning

I will most likely break this PR down to smaller parts to deliver this feature. So please don't merge.

This PR adds in scoped clients to server sdks. The implementation is based on the go server sdk. This PR also modifies the React SDK to utilize the scoped client init reporting (mostly as an example of how it is used)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25721 bytes
Compressed size limit: 29000
Uncompressed size: 126532 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 31766 bytes
Compressed size limit: 34000
Uncompressed size: 113103 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

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

@joker23 joker23 force-pushed the skz/sdk-2139/js-scoped-clients branch 2 times, most recently from a0ecbc6 to caa6ab6 Compare April 8, 2026 20:09
Comment thread packages/sdk/react/src/server/LDServerSession.ts Outdated
}

// Fallback for clients without forContext (e.g., edge SDKs)
return {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am also thinking that if we are good with the scoped client implementation then we can revisit how we type this interface eg make it extend LDScopedClient instead

@joker23 joker23 force-pushed the skz/sdk-2139/js-scoped-clients branch 3 times, most recently from c34d0af to 7dfa664 Compare April 9, 2026 23:34
@joker23 joker23 force-pushed the skz/sdk-2139/js-scoped-clients branch from 7dfa664 to baa2190 Compare April 10, 2026 17:27
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