Skip to content

chore(vue-sdk): add variation composables#1773

Open
joker23 wants to merge 1 commit into
mainfrom
skz/sdk-2194/migrate-vue-sdk-variation-composables
Open

chore(vue-sdk): add variation composables#1773
joker23 wants to merge 1 commit into
mainfrom
skz/sdk-2194/migrate-vue-sdk-variation-composables

Conversation

@joker23

@joker23 joker23 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Note

Medium Risk
New public flag-evaluation API affects UI behavior, listener lifecycle, and impression timing; risk is mitigated by broad tests but worth reviewing readiness and duplicate-eval edge cases on identify.

Overview
Adds reactive Vue composables for LaunchDarkly flag evaluation, replacing the previous scaffold TODO on the public composables barrel.

Value composables (useBoolVariation, useStringVariation, useNumberVariation, useJsonVariation) and matching detail composables share useVariationCore, which returns a readonly ref, skips client evaluation until isReady(), re-evaluates on change:<key>, context/identify, and initialization state, supports reactive flag keys (ref/getter), and tears down change listeners on unmount.

Detail variants surface LDEvaluationDetailTyped and synthesize a CLIENT_NOT_READY reason before the client is ready without calling the SDK.

Exports are wired through composables/index.ts. Tests cover provider/plugin integration, single-evaluation-on-mount (impressions), readiness/failure paths, and reactive key re-subscription; makeMockClient is adjusted for handler tracking and init-status ready behavior. plugin.test.ts adds a useBoolVariation smoke test under LDVuePlugin.

Reviewed by Cursor Bugbot for commit d469468. 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: 26365 bytes
Compressed size limit: 29000
Uncompressed size: 129044 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: 38739 bytes
Compressed size limit: 39000
Uncompressed size: 212244 bytes

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

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

@joker23

joker23 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 d469468. Configure here.

@joker23 joker23 marked this pull request as ready for review June 25, 2026 19:05
@joker23 joker23 requested a review from a team as a code owner June 25, 2026 19:06

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

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