Conversation
Add @dunky.dev/state-machine-svelte, a thin runes-based edge layer
mirroring the React package:
- useMachine: build-once bridge + lifecycle + prop-scoped substrate
effects, returning a reactive { api, machine }. Takes props as a
getter (() => props) since Svelte props are reactive bindings.
- useSelector: fine-grained leaf subscription returning { current }.
- normalize/mergeProps: Svelte DOM idiom (lowercase on* event props,
class/style string merge).
The package ships its src uncompiled (svelte export condition) so the
consumer's Svelte compiler processes the .svelte.ts runes modules; it's
excluded from the tsdown bundle for that reason. Vitest gains a scoped
svelte project (svelte plugin + svelteTesting + jsdom) so runes tests
run without disturbing the other packages.
Adds docs (libs/svelte.mdx + sidebar entry) and a changeset.
Co-authored-by: Claude <noreply@anthropic.com>
A fourth renderer for the shared @sandbox/cmdk-core command palette, driven by the Svelte binding. Unlike the React/OpenTUI/Native apps — which all render through a React reconciler and share React's useMachine — the Svelte app brings its own runes-based useMachine from @dunky.dev/state-machine-svelte, yet runs the exact same machine and connect() unchanged. Same behavior, different framework. - Vite + vite-plugin-svelte, aliasing every @dunky.dev/* package (and the svelte binding's .svelte.ts runes source) to src for a live, no-build workspace run. - app.svelte / command-palette.svelte port the React demo to Svelte 5: useMachine over the shared machine, normalize → lowercase DOM props, the ⌘K shortcut as a ComponentEffect, input-focus as an $effect. - Updates sandbox/README.md to four substrates. Co-authored-by: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: Claude <noreply@anthropic.com>
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.
Summary
Adds a Svelte 5 integration mirroring the React package, plus a sandbox demo.
@dunky.dev/state-machine-svelte(new package)A thin, runes-based edge layer with the same export names as the React binding:
useMachine— build-once bridge + lifecycle + prop-scoped substrate effects, returning a reactive{ api, machine }. Takes props as a getter (() => props) since Svelte props are reactive bindings.useSelector— fine-grained leaf subscription returning{ current }.normalize/mergeProps— Svelte's DOM idiom (lowercaseon*event props,class/stylestring merge).The package ships its
srcuncompiled (svelteexport condition) so the consumer's Svelte compiler processes the.svelte.tsrunes modules — it's excluded from the tsdown bundle for that reason. Vitest gains a scopedsvelteproject (svelte plugin +svelteTesting+ jsdom) so runes tests run without disturbing the other packages.Includes docs (
libs/svelte.mdx+ sidebar entry) and a changeset.sandbox/svelte(new)A fourth renderer for the shared
@sandbox/cmdk-corecommand palette. Unlike the React/OpenTUI/Native apps — which all render through a React reconciler and share React'suseMachine— the Svelte app brings its own runes-baseduseMachine, yet runs the exact same machine andconnect()unchanged. Same behavior, different framework.Verification
pnpm typecheck✅pnpm lint✅pnpm test:ci✅ 351 passed (44 new svelte tests)pnpm build✅ (svelte correctly excluded from tsdown)pnpm -C sandbox/svelte build✅ — Svelte compiler processes the binding's runes source via aliaspnpm website:prod✅ — 30 pages incl./libs/svelteNotes
useMachinetakespropsas a value in React, but() => props(a getter) in Svelte — unavoidable given Svelte's reactivity model; export name kept consistent. Documented in the README and docs page.🤖 Generated with Claude Code