feat: adding start() method to common client sdk package#1244
feat: adding start() method to common client sdk package#1244
Conversation
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/browser size report |
1a440b9 to
d249ad8
Compare
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@cursor review |
There was a problem hiding this comment.
✅ 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.
This PR will consolidate the
start()method into the shared client sdk package.To do this we also:
requiresStartwhich should betruefor new SDKs (and only RN has it defaultfalse)requiresStartis, effectively, a feature flag for whether the SDK is using the newcreate+startinitialization patternstartmethod into client commonstartmethod out of browser and electron sdksNote
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 sharedsdk-clientLDClientImpl, including bootstrap flag preloading, cached/idempotentstart()promises, and integration withwaitForInitializationtimeouts.Introduces an internal
requiresStartoption that gates a new lifecycle: when enabled (now set totruein Browser and Electron),identifycalls beforestart()return an error result, and post-startidentifyResultdefaultssheddabletotruewhen not explicitly provided.Removes duplicated
start()/pre-startidentifylogic from the Browser and Electron clients, updates their publicLDStartOptionstypes to extend the commonLDStartOptions, 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.