ADR 010 — TanStack as the Vox web spine
ADR 010 — TanStack as the Vox web spine
Section titled “ADR 010 — TanStack as the Vox web spine”Status: Accepted
Date: 2026-03-21
[!NOTE] Scope clarification (2026-05-01): This ADR governs the web stack for Vox-compiled user applications (output of
vox build). It does not apply tocrates/vox-dashboard/which is the Vox team’s own operational UI — the dashboard is a Vox application compiled from.voxsources and its reactive state is governed by thestate_machineprimitive (see ADR 030).
Context
Section titled “Context”Vox compiles .vox UI to React + Vite (vox-codegen-ts) and serves static assets via Axum + rust_embed (vox-codegen-rust). (Historical note: an islands bundle was previously emitted; islands were retired 2026-05-03 — see external-frontend-interop-plan-2026.) Prior routing used react-router-dom emitted from routes { declarations. The ecosystem direction is TanStack Router (typed, composable) and TanStack Start (Vite-native full-stack SSR, built on Router).
Non-goals: HTML-fragment UIs and classless CSS microframeworks as product paths; the supported graph is React + Tailwind/ShadCN + TanStack (see vox-web-stack SSOT).
Decision
Section titled “Decision”- Routing spine: Adopt @tanstack/react-router for codegen from
routes {(replacingreact-router-dom). - Long-term framework: Plan TanStack Start for default SSR after Router is stable in our scaffold; Start includes Router—there is no separate “merge” of incompatible TanStack products, only composition (optional TanStack Query / Table later).
- SSR production topology (default recommendation): Option B — Axum reverse-proxies HTML/document requests to a Node-hosted TanStack Start / Vite SSR server, while Axum remains the API and static asset origin for
/apiand embeddedpublic/. Alternatives (A: API-only Axum + separate SSR host; C: hybrid static shells fromvox-ssg+ selective SSR) remain documented in the roadmap. - Examples policy: Maintain a small golden set (5–12) of
.voxexamples that CI/parser treat as canonical; move or archive the rest. - v0.dev: First-class for the main generated app; TSX must use named
export function Namealigned withroutes {/ Router (normalization invox-cli). vox-codegen-html: Retired as a workspace crate name—there is no in-tree implementation; static HTML needs are served byvox-ssgplus the React stack (see reconciliation in roadmap).
Consequences
Section titled “Consequences”- Dependencies: Generated app
package.jsoncarries@tanstack/react-routerinstead ofreact-router-dom. - Dev UX: Until Start is wired,
vox runremains SPA + Axum; SSR requires an additional process when enabled (documented in how-to). - Docs: Roadmap and backlog live under
docs/src/reference/tanstack-web-roadmap.mdandtanstack-web-backlog.md.
References
Section titled “References”- TanStack Router — Vite
- TanStack Start — React
- vox-web-stack.md
- vox-fullstack-artifacts.md — canonical vs legacy artifacts (
server.ts,VOX_EMIT_EXPRESS_SERVER, containers)