Skip to content

API Reference ​

Unless a section says otherwise, this reference describes the published 0.1 beta packages. Managed toolchain modes and SSR-safe Store factories belong to the opt-in 0.2 alpha; installing @beta does not enable them. Octane is a separate private workspace experiment, excluded from that release batch.

This page lists the public consumption paths verified from the package exports. The beta ABI may change between prereleases. Internal @vooya/build-core helpers are implementation details unless a package page explicitly exports them.

Current-source generated .rs modules pass a framework-neutral Component or Store bridge into the selected adapter. This is the implementation boundary that keeps framework branches out of generation; it is not a stable author-facing IR. The supported application APIs are the generated component, useName(), and createNameStore() exports described below. The source implementation description does not add an application API to the published beta.

See the tooling reference, compatibility matrix, and ABI v1 RFC for the wider boundary.

Rust component update modes ​

#[voo::component] keeps the compatibility behavior of replacing its owned root after a framework prop change. Stateful browser surfaces can opt into #[voo::component(update = "path::to::handler")]; the handler receives (&voo::ViewElement, Props) and updates the mounted root in place. The handler is synchronous, receives the complete next props object, and shares the original root's disposal scope. See RFC 0010.

@vooya/vite ​

vooya(options?) ​

Export / parameterType / valuesDefaultWhen to useCurrent boundary / minimal example
vooya()Plugin—Add Vooya to a Vite configVite >=7 <9; plugins: [vue(), vooya()]
framework"vue" | "react" | "solid" | "svelte""vue"Select the host adapterVue 3 and React 19 are supported; Solid 1.9 and Svelte 5 are experimental on Vite 7
rust.dependenciesRecord<string, string | Dependency>Nearest Cargo.toml, then {}Reuse or override Cargo registry, Git, or path cratesBrowser-compatible Rust only; explicit plugin entries win by package name
rust.webSysFeaturesstring[]Nearest Cargo.toml, then []Enable browser APIs from web-sysExplicit plugin features win; generated runtime features remain enabled
toolchain.cargoPathstringPATH discoverySelect a specific CargoExplicit selection is authoritative; Cargo's rustc, target, and CLI must agree
workspace.rootstring.vooya/Put generated state elsewhereAlso update TypeScript rootDirs; generated state remains disposable
ts
import { vooya } from "@vooya/vite";

vooya({ framework: "vue", toolchain: { cargoPath: "/opt/rust/bin/cargo" } });

CLI: vooya doctor and vooya clean ​

Command / optionType / valuesDefaultWhen to useCurrent boundary / minimal example
vooya doctorCLI command—Diagnose Cargo, rustc, target, wasm-bindgen, linker, and generated typesDiagnostic only; it does not install a toolchain
--jsonflagoffEmit a versioned JSON diagnostic reportOnly valid for doctor; available since @vooya/vite@0.1.0-beta.1, not beta.0
--cargo-pathfilesystem pathPATH discoveryPair with an explicit toolchainOnly valid for doctor; vooya doctor --cargo-path /opt/rust/bin/cargo
--workspace-rootfilesystem path.vooya/Inspect a workspace overrideValid for doctor and clean
vooya cleanCLI command—Remove generated Vooya stateIt removes the selected generated workspace, not source files

@vooya/vue adapter ​

Generated useName(options?) ​

Rust-file Store imports generate useName() alongside createNameStore(). For example, Cart generates useCart() with { state, ...typedActions }. This is the primary Store API for Vue application code; state is a readonly reactive Ref and is automatically unwrapped in templates.

Export / parameterType / valuesDefaultWhen to useCurrent boundary / minimal example
Generated hookuseName(options?)—Consume a #[voo::store] .rs fileconst { state, add } = useCart()
optionsVooyaStoreOptions{}Observe creation failures and configure adapter behaviorGenerated hook owns and disposes its instance

useVooyaStore(source, options?) (advanced) ​

The following type compatibility is available since @vooya/vue@0.1.0-beta.1 and 0.1.0-beta.2 of @vooya/react, @vooya/solid, and @vooya/svelte. Earlier releases still require an index signature and do not include this fix.

The Store contract requires getSnapshot, subscribe, and dispose; generated Store interfaces do not need a string index signature. Vue accepts the generated factory's Promise directly. React, Solid, and Svelte accept the factory plus props and infer the snapshot and declared actions from its Store type. Prefer generated use<Name> hooks for ordinary application code.

Export / parameterType / valuesDefaultWhen to useCurrent boundary / minimal example
useVooyaStore(store | PromiseLike<store>, options?)—Custom integration or shared-instance ownershipVue >=3.5.2 <4; not the primary generated hook
sourceVooyaStore | PromiseLike<VooyaStore>requiredPass an instance or generated async store factoryThe late instance is disposed if the component unmounts first
disposeOnUnmountbooleanfalseGive this component ownership of disposalUse true for an instance-scoped store; shared stores need an explicit owner
onError(cause: unknown) => void—Receive async creation failuresIt does not retry or hide action errors

useVooyaStore is an adapter-level API, not the primary cross-framework Store entry point and not Vapor-only. This section shows the Vue signature; the other adapters also export low-level hooks with the signatures listed in their sections. Prefer the generated hook for ordinary application code. Vapor applications additionally require Vue's own createVaporApp and vaporInteropPlugin setup.

The return value is { snapshot, dispatch, unsubscribe }. dispatch(name, ...args) calls a declared store action; async actions are outside ABI v1.

@vooya/react ​

Generated .rs imports expose a component or a typed hook such as useCart(). Vue, React, Solid, and Svelte receive the same generated names and fields: state plus typed actions. React's state is the current snapshot value.

Export / parameterType / valuesDefaultWhen to useCurrent boundary / minimal example
Generated componentReact component props—Import a #[voo::component] .rs fileReact >=19; import Counter from "./Counter.rs"
Generated hookuseName(options?)—Consume a #[voo::store] .rs fileUses useSyncExternalStore; one store instance per hook lifetime
useVooyaStore(factory, props, options?)—Build a custom adapter or shared-instance integrationAdvanced API; factory may return a store or Promise
onError / onNotifycallbacks—Observe creation failures or notificationsAdapter callbacks only; no global event bus

@vooya/solid ​

Solid uses the same generated component and useName() entry names. The framework-neutral bridge is wrapped with Solid owners, signals, and cleanup; state is an accessor because the WASM store initializes asynchronously.

Export / parameterType / valuesDefaultWhen to useCurrent boundary / minimal example
Generated componentSolid component props—Import a #[voo::component] .rs fileSolid >=1.9 <2; callback props use onEventName
Generated primitiveuseName(options?)—Consume a #[voo::store] .rs fileconst { state, add } = useCart(); state()?.count
useVooyaStore(factory, props, options?)—Build a custom adapter or shared-instance integrationAdvanced API; factory may return a store or Promise
onError(cause: unknown) => void—Observe an asynchronous factory failureCleanup is tied to the current Solid owner
onNotifycallback field forwarded to a custom factory—Advanced factory-specific instrumentationGenerated Solid Stores publish state through subscription; they do not expose a separate notification bus

The shared generated names intentionally do not force one reactive container across frameworks: Vue returns a Ref, React returns a snapshot value, and Solid returns an Accessor. The lifecycle, action, error, and ownership contract remains aligned. undefined means that the asynchronous WASM Store is not ready yet in these adapters.

@vooya/svelte ​

Svelte uses the same generated component and useName() entry names. The framework-neutral bridge is wrapped with Svelte component lifecycle and a Readable<T | undefined> Store; templates consume it through $state.

Export / parameterType / valuesDefaultWhen to useCurrent boundary / minimal example
Generated componentSvelte component props—Import a #[voo::component] .rs fileSvelte >=5 <6; callback props use onEventName
Generated Store entryuseName(options?)—Consume a #[voo::store] .rs fileconst { state, add } = useCart(); template reads $state?.count
useVooyaStore(factory, props, options?)—Build a custom adapter or shared-instance integrationAdvanced API; factory may return a Store or Promise
onError(cause: unknown) => void—Observe an asynchronous factory failureComponent and generated Store cleanup are tied to Svelte destruction
onNotifycallback field forwarded to a custom factory—Advanced factory-specific instrumentationGenerated Svelte Stores publish through Readable; no separate notification bus is documented

The current evidence is Svelte 5 + Vite 7 + Chromium. It covers Component mount and callback, Store action, Component prop update, generated declarations, and one cleanup call each for the Component handle and generated Store. It does not cover Svelte 3/4, SvelteKit, SSR, hydration, Vite 8, Rspack, or Webpack.

@vooya/rspack ​

The beta.0 Rspack and Webpack implementations still expose a legacy .voo loader rule for their experimental fixtures. .voo is retired as a new authoring format and is scheduled for removal; use Rust-file authoring through the primary Vite path until those adapters are migrated.

Export / parameterType / valuesDefaultWhen to useCurrent boundary / minimal example
vooyaRsbuild(options?)VooyaRsbuildPlugin—Add Vooya to RsbuildExperimental; Rspack >=2.1.10, Rsbuild >=2.1.13
vooyaRspack(options?)VooyaRspackPlugin—Configure Rspack directlyExperimental; add plugins: [vooya] and vooya.rule()
framework"vue" | "react""vue"Select the host adapterCurrent fixtures use the transitional .voo path; Rust-file parity is not claimed
rust, workspaceRootRust options, filesystem path{}, .vooya/Share Rust deps or move generated stateExperimental adapter options; see the package README
rule(){ test: /\.voo$/, loader, options }—Add the source loader to direct RspackPublic rule is for the current transitional .voo fixture path

@vooya/webpack ​

Export / parameterType / valuesDefaultWhen to useCurrent boundary / minimal example
vooyaWebpack(options?)VooyaWebpackPlugin—Add Vooya to Webpack 5Experimental; Webpack >=5
framework"vue" | "react""vue"Select the host adapterCurrent fixtures use the transitional .voo path; Rust-file parity is not claimed
rust, workspaceRootRust options, filesystem path{}, .vooya/Share Rust deps or move generated stateExperimental adapter options; see the package README
rule(){ test: /\.voo$/, use: [{ loader, options }] }—Add the source loader to WebpackRequires normal framework, CSS, and async WASM config

No Web Components, precompiled artifact consumer, SSR, hydration, or general renderer API is currently published as part of these packages.

Vooya is a beta project. Check the compatibility matrix before relying on a path.