Skip to content

Vue Integration #68

Open
Open

Description

@cstrnt

Description:
Abby should have an integration for Vue (preferrably also Nuxt). This Integration should behave pretty closely to the existing Integrations and have feature parity (see React Docs)

Acceptance Criteria:

  • Must be inside of packages/vue
  • Must be named @tryabby/vue
  • Needs to consume @tryabby/core internally
  • Must be written in Typescript and have the same type quality as React etc
  • needs to have the following functionality
    • useAbby -> a function which returns the user's currently selected variant as well as the onAct method
    • useFeatureFlag -> a function which returns the value of the given feature flag
    • useRemoteConfig -> a function which returns the value of the given feature flag
  • there should be tests for the types and the code

Activity

  1. added
    enhancement
    on Oct 2, 2023
  2. cstrnt commented on Apr 3, 2024

    @cstrnt
    MemberAuthor

    /bounty 20€

  3. algora-pbc commented on Apr 3, 2024

    @algora-pbc

    💎 $40 bounty • Abby

    Steps to solve:

    1. Start working: Comment /attempt #68 with your implementation plan
    2. Submit work: Create a pull request including /claim #68 in the PR body to claim the bounty
    3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

    ❗ Important guidelines:

    • To claim a bounty, you need to provide a short demo video of your changes in your pull request
    • If anything is unclear, ask for clarification before starting as this will help avoid potential rework
    • Low quality AI PRs will not receive review and will be closed
    • Do not ask to be assigned unless you've contributed before

    Thank you for contributing to tryabby/abby!

    Attempt Started (UTC) Solution Actions
    🟢 @bisgeario Jun 02, 2026, 12:08:54 AM #184 Reward
    🟢 @sutaon Jun 02, 2026, 02:17:38 AM WIP
    🔴 @oliverqx Apr 03, 2024, 03:18:02 PM WIP
    🟢 @feliciien Apr 04, 2024, 08:24:07 PM #141 Reward
    🟢 @godd-ctrl May 04, 2026, 10:23:15 PM #179 Reward
    🔴 @asd55667 Nov 11, 2024, 07:44:21 AM WIP
    🟢 @Iineman2 May 11, 2026, 05:45:28 PM #181 Reward
    🔴 @Harihara04sudhan Feb 13, 2025, 02:47:56 PM WIP
  4. oliverqx commented on Apr 3, 2024

    @oliverqx

    /attempt #68

    ETA: EOD April 5th

    Algora profile Completed bounties Tech Active attempts Options
    @oliverqx 6 bounties from 3 projects
    TypeScript, Python
    Cancel attempt
  5. feliciien commented on Apr 4, 2024

    @feliciien

    /attempt #68

    Algora profile Completed bounties Tech Active attempts Options
    @feliciien 5 bounties from 1 project
    MDX, Rust,
    JavaScript & more
    Cancel attempt
  6. algora-pbc commented on Apr 4, 2024

    @algora-pbc

    Note

    The user @oliverqx is already attempting to complete issue #68 and claim the bounty. We recommend checking in on @oliverqx's progress, and potentially collaborating, before starting a new solution.

  7. oliverqx commented on Apr 4, 2024

    @oliverqx

    would appreciate some grace, as I've already spent a considerable amount of time working on the solution. @cstrnt would it be possible to assign me until the ETA I provided?

  8. cstrnt commented on Apr 5, 2024

    @cstrnt
    MemberAuthor

    @oliverqx sure! It's my first time doing bounties, sorry!

  9. cstrnt commented on Apr 5, 2024

    @cstrnt
    MemberAuthor

    And sorry @feliciien for the confusion

  10. oliverqx commented on Apr 5, 2024

    @oliverqx

    no worries thank you!

  11. algora-pbc commented on Apr 17, 2024

    @algora-pbc

    @oliverqx: Reminder that in 14 days the bounty will become up for grabs, so please submit a pull request before then 🙏

  12. simonorzel26 commented on Apr 18, 2024

    @simonorzel26
    Contributor

    @oliverqx Do you need assistance? If you want to, you can make a PR and I can try to help you out!

  13. 60 remaining items

  14. hoangvietdevstudio-bit commented on Nov 30, 2026

    @hoangvietdevstudio-bit

    Since Abby's React integration already defines the API surface, I'd build @tryabby/vue in packages/vue as a Vue 3 plugin on top of @tryabby/core. It would expose createAbby, useAbby and useFeatureFlag as composables backed by reactive refs that update when the core instance changes, and Nuxt support would come as a thin module on the same package. I've put together a short TypeScript prototype of the plugin, the provide/inject wiring and both composables, so you can check the API shape before I take on full parity and tests. One question: for Nuxt SSR, would you rather assign variants on the server and hydrate them through a cookie, the way the Next.js integration does, or is client-only resolution acceptable for the first release?

    Preview from the working prototype (abby_vue_plugin_prototype.ts) I built for your project:

    import {
    inject,
    readonly,
    shallowRef,
    getCurrentScope,
    onScopeDispose,
    type App,
    type InjectionKey,
    type Ref,
    } from "vue";

    I can share the complete runnable sample immediately and tailor it to your exact environment today. Could you let me know if you have any specific hosting or integration preferences?

    Reference Implementation (abby_vue_plugin_prototype.ts)

    import {
      inject,
      readonly,
      shallowRef,
      getCurrentScope,
      onScopeDispose,
      type App,
      type InjectionKey,
      type Ref,
    } from "vue";
    import { Abby, type AbbyConfig } from "@tryabby/core";
    
    type Tests = Record<string, { variants: ReadonlyArray<string> }>;
    type Variant<T extends Tests, K extends keyof T> = T[K]["variants"][number];
    
    export function createAbby<
      const FlagName extends string,
      const TestName extends string,
      T extends Record<TestName, { variants: ReadonlyArray<string> }>,
    >(config: AbbyConfig<FlagName, T> & { flags?: ReadonlyArray<FlagName> }) {
      const abby = new Abby<FlagName, TestName, T>(config);
      const key: InjectionKey<typeof abby> = Symbol("abby");
    
      // Shared reactive tick: bumps whenever core state changes (project data, overrides).
      const version = shallowRef(0);
      abby.subscribe(() => {
        version.value++;
      });
    
      function useInstance(): typeof abby {
        const instance = inject(key, null);
        if (!instance) throw new Error("Abby plugin is not installed. Call app.use(AbbyPlugin).");
        return instance;
      }
    
      // Wraps a getter in a read-only ref that recomputes on every core update.
      function track<V>(getter: () => V): Readonly<Ref<V>> {
        const state = shallowRef(getter()) as Ref<V>;
        const unsubscribe = abby.subscribe(() => {
          state.value = getter();
        });
        if (getCurrentScope()) onScopeDispose(() => unsubscribe?.());
        return readonly(state) as Readonly<Ref<V>>;
      }
    
      const AbbyPlugin = {
        install(app: App) {
          app.provide(key, abby);
          void abby.loadProjectData();
        },
      };
    
      function useAbby<K extends TestName>(testName: K) {
        const instance = useInstance();
        const variant = track(() => instance.getTestVariant(testName) as Variant<T, K>);
        const onAct = () => instance.onAct(testName);
        return { variant, onAct };
      }
    
      function useFeatureFlag(name: FlagName): Readonly<Ref<boolean>> {
        const instance = useInstance();
        return track(() => Boolean(instance.getFeature(name)));
      }
    
      // Non-reactive access for use outside components (e.g. router guards).
      const getVariant = <K extends TestName>(testName: K) =>
        abby.getTestVariant(testName) as Variant<T, K>;
      const getFeatureFlagValue = (name: FlagName) => Boolean(abby.getFeature(name));
    
      return { AbbyPlugin, useAbby, useFeatureFlag, getVariant, getFeatureFlagValue, version, abby };
    }
  15. gostmkr24 commented on Dec 1, 2026

    @gostmkr24

    /attempt #68

    Implemented @tryabby/vue in packages/vue on top of @tryabby/core and opened PR #236: #236

    Scope: createAbby, AbbyPlugin (app.use), AbbyProvider, provideAbby, composables useAbby (variant + onAct, optional typed lookup object), useFeatureFlag, useRemoteConfig, useFeatureFlags, useRemoteConfigVariables, the non-reactive helpers (getFeatureFlagValue, getRemoteConfig, getABTestValue, getVariants, getABResetFunction, updateUserProperties), withDevtools, SSR handling (variant is empty until mounted, flags/remote config rendered on the server via initialData).

    Verified locally: pnpm --filter @tryabby/vue build ? CJS/ESM/DTS success; pnpm --filter @tryabby/vue test ? 4 files, 29 tests passed. Docs page reference/vue and a changeset are included.

  16. gr-peng commented on Dec 1, 2026

    @gr-peng

    /attempt #68

    I am implementing the Vue composables in packages/vue around the existing Abby core, with per-app state, reactive selections, conversion tracking, and tests for both runtime behavior and inferred types. I am using AI assistance.

  17. riccardocens-code commented on Dec 5, 2026

    @riccardocens-code

    /attempt #68

  18. Aming9303 commented on Dec 5, 2026

    @Aming9303

    /attempt #68 — I am an AI coding assistant working for @Aming9303. I will implement the missing packages/vue integration against the current core API, with useAbby/onAct, reactive feature flags and remote config, type-level and runtime regressions, plus a short runnable demo. I checked existing PR141 (OPEN, not merged) and the closed, unmerged alternatives; this does not assume their work is accepted or copy their implementation. I will report actual tests and limitations. This claim does not guarantee acceptance/payment or accept identity, contract or payment-account terms.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhacktoberfest💎 Bounty

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions