Skip to content

feat: add Vue integration package#179

Open
godd-ctrl wants to merge 3 commits into
tryabby:mainfrom
godd-ctrl:codex/vue-integration-68
Open

feat: add Vue integration package#179
godd-ctrl wants to merge 3 commits into
tryabby:mainfrom
godd-ctrl:codex/vue-integration-68

Conversation

@godd-ctrl
Copy link
Copy Markdown

@godd-ctrl godd-ctrl commented May 4, 2026

Summary

  • adds a new @tryabby/vue package under packages/vue
  • implements createAbby with Vue composables for A/B tests, feature flags, and remote config
  • adds cookie-backed storage services, an AbbyProvider, sync helpers, and devtools integration support
  • adds Vitest coverage for variants, lookup typing, feature flags, remote config, events, and helper functions

Verification

  • corepack pnpm install --filter @tryabby/vue --frozen-lockfile
  • corepack pnpm --filter @tryabby/vue test -- --run
  • corepack pnpm --filter @tryabby/vue build

Resolves #68
/claim #68

Summary by CodeRabbit

  • New Features

    • Added Vue package with A/B testing, feature flags, and remote config support
    • Vue composables (reactive hooks) for tests, flags, and remote config, plus provider component and optional devtools
    • Cookie-backed persistent storage for selections with configurable expiration
  • Tests

    • Integration tests validating reactivity, persistence, variant mapping, and event (PING/ACT) behavior
  • Chores

    • TypeScript, build (CJS/ESM), bundler and test configuration for the Vue package

@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

@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.

@algora-pbc algora-pbc Bot mentioned this pull request May 4, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7053ba4e-740d-490c-ad87-d2c3ec193ffd

📥 Commits

Reviewing files that changed from the base of the PR and between a7d12fb and 7560164.

📒 Files selected for processing (1)
  • packages/vue/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/vue/src/index.ts

Walkthrough

Adds a new Vue integration package @tryabby/vue with a factory and composables (useAbby, useFeatureFlag, useRemoteConfig), an AbbyProvider component, cookie-backed storage services, build/test configs, and Vitest integration tests.

Changes

Vue Integration Package

Layer / File(s) Summary
Build & Configuration
packages/vue/package.json, packages/vue/tsconfig.json, packages/vue/tsup.config.ts, packages/vue/vite.config.ts
Adds package manifest and scripts, TS project config, tsup build config (CJS/ESM, d.ts, sourcemaps, external vue), Vite config with aliases to local @tryabby/core sources and Vitest jsdom setup.
Storage Layer
packages/vue/src/StorageService.ts
Implements cookie-backed IStorageService variants for AB/FF/RC keys (get, set, remove) with default 365-day expiry and exports TestStorageService, FlagStorageService, RemoteConfigStorageService.
Core API & Composables
packages/vue/src/index.ts
Adds createAbby factory wiring an Abby client to SSR/cookie-guarded storage services, exposes a shared abbyData ref and AbbyDataKey, provides useAbby (reactive variant, onAct), useFeatureFlag, useRemoteConfig, helpers (getABTestValue, getVariants, getABResetFunction, getRemoteConfig, updateUserProperties), AbbyProvider component (init/load/subscribe/unsubscribe), withDevtools, and re-exports core config types.
Tests
packages/vue/tests/createAbby.test.ts
Adds Vitest integration tests validating reactive AB variant selection, persisted storage behavior, variant-to-label mapping typing, reactive feature flag/remote config reads, onAct emitting PING and ACT via HttpService.sendData, and helper exposures.
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
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add Vue integration package' is a clear, concise summary of the primary change - creating a new Vue integration package for the Abby A/B testing framework.
Linked Issues check ✅ Passed All coding requirements from #68 are met: Vue package in packages/vue named @tryabby/vue, consuming @tryabby/core, TypeScript implementation, useAbby/useFeatureFlag/useRemoteConfig composables, and comprehensive test coverage.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the Vue integration. No unrelated modifications or refactoring outside the scope of #68 requirements are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between e763d1a and 6423f51.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • packages/vue/package.json
  • packages/vue/src/StorageService.ts
  • packages/vue/src/index.ts
  • packages/vue/tests/createAbby.test.ts
  • packages/vue/tsconfig.json
  • packages/vue/tsup.config.ts
  • packages/vue/vite.config.ts

Comment thread packages/vue/src/index.ts
Comment thread packages/vue/src/index.ts
Comment thread packages/vue/src/index.ts Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6423f51 and a7d12fb.

📒 Files selected for processing (1)
  • packages/vue/src/index.ts

Comment thread packages/vue/src/index.ts
@godd-ctrl
Copy link
Copy Markdown
Author

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.

@godd-ctrl
Copy link
Copy Markdown
Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vue Integration

1 participant