Skip to content

feat: Add Node platform abstraction for node-client#1393

Open
joker23 wants to merge 8 commits into
mainfrom
skz/sdk-2195/node-client-sdk-next-port-platform
Open

feat: Add Node platform abstraction for node-client#1393
joker23 wants to merge 8 commits into
mainfrom
skz/sdk-2195/node-client-sdk-next-port-platform

Conversation

@joker23
Copy link
Copy Markdown
Contributor

@joker23 joker23 commented May 26, 2026

Summary

  • Adds the Node platform abstraction layer for @launchdarkly/node-client-sdk: HeaderWrapper, NodeCrypto, NodeEncoding, NodeInfo, NodePlatform, NodeRequests, NodeResponse, NodeStorage. These implement the Platform contract from @launchdarkly/js-client-sdk-common.
  • Adds runtime dependencies the platform code imports: @launchdarkly/js-client-sdk-common, https-proxy-agent, launchdarkly-eventsource.
  • Modernizes packages/sdk/node-client/tsconfig.json to module: ESNext + moduleResolution: bundler (tsup handles emit), adds esModuleInterop, types: ["jest", "node"], skipLibCheck. Matches the pattern used by packages/sdk/server-ai.
  • Part of the SDK-2195 stacked migration of launchdarkly-node-client-sdk into js-core. Follows PR chore: scaffolding node-client-sdk migration #1352 (scaffold).

Note

Medium Risk
New networking (TLS/proxy), persistent cache I/O, and crypto primitives affect how the SDK talks to LaunchDarkly and stores user data; behavior is heavily tested but not yet covered by contract tests.

Overview
Adds the Node Platform implementation for @launchdarkly/node-client-sdk so the shared client can run on Node: crypto/encoding/info, HTTP/SSE via NodeRequests (proxy/TLS agents, optional POST gzip, launchdarkly-eventsource), fetch-like responses/headers, and file-backed NodeStorage with a process singleton and error-logging wrapper in NodePlatform.

Introduces NodeOptions (proxy, TLS, compression, cache path, logger), wires runtime deps (js-client-sdk-common, https-proxy-agent, launchdarkly-eventsource), and adds Jest coverage plus a GitHub Actions matrix (Node 18/22) for the workspace. TypeScript moves to ESNext / bundler resolution for tsup; release-please bumps version in NodeInfo.ts.

Reviewed by Cursor Bugbot for commit ca22e5d. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

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

@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented May 27, 2026

@cursor review

cursor[bot]

This comment was marked as resolved.

@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented May 27, 2026

@cursor review

@joker23 joker23 marked this pull request as ready for review May 27, 2026 16:06
@joker23 joker23 requested a review from a team as a code owner May 27, 2026 16:06
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.

Old sdk used a package for storage and we implement it here. A lot of this logic is ported from what we have in the electron sdk for reference.

devin-ai-integration[bot]

This comment was marked as resolved.


encoding?: platform.Encoding = new NodeEncoding();

storage?: platform.Storage;
Copy link
Copy Markdown
Contributor Author

@joker23 joker23 May 27, 2026

Choose a reason for hiding this comment

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

I think we should allow for overriding the storage. Similar to what we do in the react-native sdk

cursor[bot]

This comment was marked as resolved.

@joker23 joker23 force-pushed the skz/sdk-2195/node-client-sdk-next-port-platform branch from e92eaf7 to 1f7be22 Compare May 27, 2026 17:01
devin-ai-integration[bot]

This comment was marked as resolved.

@joker23 joker23 force-pushed the skz/sdk-2195/node-client-sdk-next-port-platform branch from fef5d25 to 8eb2ea3 Compare May 28, 2026 13:46
Comment thread packages/sdk/node-client/.gitignore Outdated
@joker23 joker23 requested a review from kinyoklion May 28, 2026 14:29
cursor[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