Skip to content

feat: adding start() method to common client sdk package#1244

Draft
joker23 wants to merge 1 commit intomainfrom
skz/sdk-1759/client-start
Draft

feat: adding start() method to common client sdk package#1244
joker23 wants to merge 1 commit intomainfrom
skz/sdk-1759/client-start

Conversation

@joker23
Copy link
Copy Markdown
Contributor

@joker23 joker23 commented Apr 3, 2026

This PR will consolidate the start() method into the shared client sdk package.

To do this we also:

  • introduce an internal option called requiresStart which should be true for new SDKs (and only RN has it default false)
  • requiresStart is, effectively, a feature flag for whether the SDK is using the new create + start initialization pattern
  • consolidated the unit tests for the start method into client common
  • moved start method out of browser and electron sdks

Note

Medium Risk
Touches core client initialization and identify queuing semantics across browser/electron, which could affect startup and context switching behavior. Changes are mostly consolidation but impact widely used lifecycle paths (bootstrap, timeouts, sheddable identifies).

Overview
Consolidates the client start() implementation into the shared sdk-client LDClientImpl, including bootstrap flag preloading, cached/idempotent start() promises, and integration with waitForInitialization timeouts.

Introduces an internal requiresStart option that gates a new lifecycle: when enabled (now set to true in Browser and Electron), identify calls before start() return an error result, and post-start identifyResult defaults sheddable to true when not explicitly provided.

Removes duplicated start()/pre-start identify logic from the Browser and Electron clients, updates their public LDStartOptions types to extend the common LDStartOptions, and moves/rewrites unit tests so start/bootstrapping/guard behavior is validated centrally (with browser/electron tests trimmed accordingly).

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 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
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

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

@joker23 joker23 force-pushed the skz/sdk-1759/client-start branch from 1a440b9 to d249ad8 Compare April 3, 2026 23:36
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

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

@joker23
Copy link
Copy Markdown
Contributor Author

joker23 commented Apr 3, 2026

@cursor review

Copy link
Copy Markdown

@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

Reviewed by Cursor Bugbot for commit d249ad8. Configure here.

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