feat: add Vue integration package#179
Conversation
|
@godd-ctrl is attempting to deploy a commit to the cstrnt's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds a new Vue integration package ChangesVue Integration Package
sequenceDiagram
participant App as Vue App
participant Provider as AbbyProvider
participant Abby as Abby Client
participant Storage as Storage Services
participant Http as HttpService
App->>Provider: mount (optional initialData)
Provider->>Abby: instantiate Abby (config + storage)
Provider->>Storage: get persisted values
Storage-->>Provider: return saved test/flag/config
Provider->>Abby: subscribe to updates
Provider->>App: provide abbyData via injection
App->>Abby: useAbby() → request variant
Abby-->>App: return computed variant (reactive)
App->>Http: notify(PING) on variant change
App->>App: user triggers onAct()
App->>Http: sendData(ACT)
App->>Storage: set selected variant
Storage-->>App: persisted
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/vue/src/index.ts`:
- Around line 143-152: The notify call currently fires during useAbby() setup
before AbbyProvider finishes loadProjectData(), causing PING to report the
fallback variant; replace the immediate notify(name, abby.getTestVariant(name))
with a reactive watch on the computed selectedVariant (the variable defined as
selectedVariant using useAbbyData() and abby.getTestVariant) so notify is
invoked only when selectedVariant actually hydrates, and track/dedupe the last
sent value so repeated identical variants are not re-sent; ensure the watcher
uses selectedVariant.value changes and calls notify(name, selectedVariant.value)
only when different from the previous sent variant.
- Around line 280-293: The subscription to abby is being created eagerly in
setup() via abby.subscribe which can run during SSR and never be cleaned up;
move the subscribe call into onMounted() so the listener is only created on the
client, and store the returned unsubscribe in a local variable that you call in
onUnmounted(); also ensure you still handle props.initialData and the
abby.loadProjectData() flow (i.e., only subscribe after checking/setting
initialData and after any loadProjectData() resolution) and guard unsubscribe
before calling it in onUnmounted().
- Around line 83-102: The feature-flag and remote-config cookie-backed storage
must honor the cookies.disableByDefault opt-out: update the anonymous storage
objects that call FlagStorageService and RemoteConfigStorageService to check
config.cookies?.disableByDefault and, if true, return null from get and do
nothing in set (no cookie writes); apply this check in both the
FlagStorageService-backed object and the RemoteConfigStorageService-backed
object so neither reads or writes cookies when disableByDefault is enabled (use
config.projectId, FlagStorageService, RemoteConfigStorageService to locate the
exact blocks).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: bc636371-4dce-411a-8956-4e2f462f0662
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
packages/vue/package.jsonpackages/vue/src/StorageService.tspackages/vue/src/index.tspackages/vue/tests/createAbby.test.tspackages/vue/tsconfig.jsonpackages/vue/tsup.config.tspackages/vue/vite.config.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/vue/src/index.ts`:
- Around line 73-83: The AB test storage get adapter (the get function that
calls TestStorageService.get) fails to respect config.cookies?.disableByDefault;
update that get implementation to also short-circuit and return null when typeof
window === "undefined" OR config.cookies?.disableByDefault is true so no cookie
is read or AB variant selected without consent. Locate the anonymous get in this
object (the one calling TestStorageService.get) and add the same
disableByDefault guard used by the set/get of remote-config, ensuring it returns
null and avoids firing any tracking/selection when cookies are disabled by
default.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 1e680415-4cbd-4cfa-a1fa-2bcda459a57e
📒 Files selected for processing (1)
packages/vue/src/index.ts
|
Addressed the remaining storage opt-out review feedback in 7560164. Re-ran validation locally and both commands pass:\n\n- corepack pnpm --filter @tryabby/vue test -- --run\n- corepack pnpm --filter @tryabby/vue build\n\nCodeRabbit's latest review generated no actionable comments. The remaining failing check appears to be Vercel authorization for this fork deployment by the upstream team. |
|
Follow-up on CodeRabbit feedback: the AB test storage get path is addressed in head commit 7560164 by short-circuiting when config.cookies?.disableByDefault is true, matching the storage set guards and avoiding a cookie read/variant selection without consent. I revalidated locally: corepack pnpm --filter @tryabby/vue build passed, and corepack pnpm --filter @tryabby/vue test -- --run passed (7 tests). |
Summary
Verification
Resolves #68
/claim #68
Summary by CodeRabbit
New Features
Tests
Chores