chore(vue-sdk): Add LDVueClient hardening, provider, plugin, and base composables#1769
Conversation
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk size report |
|
@cursor review |
|
@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 f64969a. Configure here.
| try { | ||
| newContext = baseClient.getContext(); | ||
| } catch (_) { | ||
| return; |
There was a problem hiding this comment.
this case should really never happen, but we can use some extra handling in case the context is malformed.
kinyoklion
left a comment
There was a problem hiding this comment.
It would be good to move the test files per the Devin review comments.
Note
Medium Risk
Touches core client init and subscription behavior used by all Vue apps; changes are defensive but affect when context/init callbacks fire and how start() rejects are surfaced.
Overview
Adds the Vue integration surface for LaunchDarkly:
createLDProvider/createLDProviderWithClient,LDVuePlugin, and composablesuseLDClientanduseInitializationStatus, with reactive context and init state viacreateReactiveInstanceand optionalinitializing/failedprovider slots.LDVueClientis hardened sostart()maps base rejections to a resolved{ status: 'failed', error }, notifies context subscribers on complete/timeout (not only complete), and isolatesgetContext()and subscriber callback throws so one bad listener cannot break init or others. Provider/plugin support auto-start,deferInitialization, bootstrap merge (top-level wins), and custom injection keys for multi-env apps.Public exports and package docs are updated; variation composables are deferred to a follow-up PR. Broad Jest coverage includes a shared
makeMockClienthelper.Reviewed by Cursor Bugbot for commit 82337a3. Bugbot is set up for automated code reviews on this repo. Configure here.