Conversation
Add @dunky.dev/state-machine-vue, mirroring the React package's API one-for-one (useMachine, useSelector, normalize, mergeProps, ComponentEffect/ComponentEffects) implemented with Vue reactivity: - useMachine builds machine+connector once in setup(), drives a shallowRef off the connector snapshot (exposed as a ComputedRef), pushes props via watch->setProps, runs start/stop on the mount lifecycle, and runs each ComponentEffect as its own dep-keyed watch. - useSelector returns a value-deduped readonly ref. - normalize translates agnostic bindings to Vue DOM/ARIA props (onPress->onClick, onValueChange->onInput, focusable->tabindex, ...). - mergeProps merges consumer + component props with Vue's class/style conventions. Wire the package into tsdown, tsconfig paths, the docs sidebar, and a new libs/vue.mdx; add a changeset. Add sandbox/vue (SFCs) driving the shared cmdk core through the new bindings. Co-authored-by: Claude <noreply@anthropic.com>
Rewrite the useMachine / useSelector / normalize / mergeProps examples in the Vue README and docs page to lead with SFC <script setup> + <template> (v-bind) syntax instead of h() render functions — matching how the sandbox is written and what Vue developers expect. Keep a short note that the same api/normalize output works in JSX or a manual h() render function. Co-authored-by: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
@dunky.dev/state-machine-vue— Vue 3 bindings for the renderer-agnostic core, mirroring the React package's API one-for-one.Package (
packages/vue)useMachine(createConfig, connect, effects, props)— builds machine + connector once insetup(), drives ashallowRefoff the connector snapshot (exposed as aComputedRef), pushes prop changes viawatch → setProps, runsstart/stopon the mount lifecycle, and runs eachComponentEffectas its own dep-keyedwatch. Returns{ api, machine }.useSelector(machine, selector, isEqual?)— value-deduped readonly ref, disposed on scope teardown.normalize(bindings)— agnostic bindings → Vue DOM/ARIA props (onPress→onClick,onValueChange→onInput,focusable→tabindex, payload adapters).mergeProps(consumer, library)— handler chaining + Vueclass/styleconventions.Wiring & docs
tsdown.config.ts,tsconfig.jsonpaths, the docs sidebar; newwebsite/.../libs/vue.mdx; changeset added.sandbox/vue— SFC sandbox driving the shared@sandbox/cmdk-coremachine (needs@vitejs/plugin-vue@^6for Vite 8).<script setup>+<template>(v-bind), noth().Verification
vitest run packages/vue— 48/48 passpnpm test:ci(full repo) — 355/355 passpnpm typecheck(repo) +vue-tsc(sandbox) — cleanpnpm build— vue package builds with isolated-declarations + publint clean