v1.0.0
AIR Stack v1.0.0 — Reactive Full-Stack Framework, from DB to UI
Anchor (state) + IRPC (network) + Router (navigation), backed by a single reactive graph. No separate state manager, API client, caching layer, or form library.
Highlights
Remote Functions (IRPC)
Typed function stubs that separate signature, implementation, and transport. Call them like local functions — HTTP, WebSocket, or BroadcastChannel, the call site stays identical.
- Standard & streaming — one-shot calls and progressive streaming (AI generation, long-running ops)
- Transport agnosticism — HTTP, WebSocket, BroadcastChannel; swap at runtime without changing code
- Automatic batching — concurrent calls merged into a single request
- Request coalescing — identical concurrent calls share one in-flight request
- Caching + invalidation —
maxAgecaches,irpc.invalidate()clears stale entries - Retry with backoff — configurable linear or exponential retry
- Reactive bindings —
.with(),.when(),.later(),.once()for component-level data fetching - File uploads — pass
IRPCFileas arguments, transport handles the rest - Runtime validation — Zod schemas for input/output enforcement
- CRUD module —
irpc.crud()generates get/create/update/delete with adapter wiring - Hooks — cross-cutting concerns (auth, logging) via
irpc.hook() - Microservice routing — each package routes to its own server
- Publishable stubs — declaration files safe to ship as npm packages
Workflow Orchestration
Promise-like chaining for multi-step async logic with built-in routing, validation, recovery, and observability.
plan()+.then()/.catch()/.finally()— familiar async composition.switch()— key-based or matcher-function branching with isolated branches- Schema validation — Zod/Valibot at pipeline input, output, and step boundaries
- Reactive bindings —
.once(),.with(),.when(),.later()mirror IRPC patterns - Step tracking —
reader.current.nameshows which step is running - Manual stepping —
.step(),.run(),.skip(),.reset()for wizard-style flows - Persistence —
snapshot()/hydrate()for resuming after crashes - WorkflowStore — global observability and telemetry subscription
Routing (Router)
URL path, guards, and data loaders in a single typed chain. View attaches separately — route logic and UI stay decoupled.
- Type-safe route tree — TypeScript infers params across the entire tree
- Pre-render guards — run before mount, no flash of unauthorized content
- Reactive providers — re-run when reactive dependencies change, no manual tracking
- Fine-grained routing — only components observing changed state re-render
- Parameter mutations —
/users/1→/users/2updates state in place, no unmount - Modal routes —
modal()renders as overlay, keeps current page mounted - Preloading — providers fetch on
<Link>hover - Render modes —
deferred(block until resolved) andimmediate(stream in)
State Management (Anchor Core)
Transparent reactive Proxies — read and write properties normally, the system tracks dependencies and triggers updates.
- Direct mutation —
state.count++triggers updates, no setters or copies - Deep reactivity — nested objects auto-wrapped, configurable depth
- Computed getters — standard JS
geton mutable objects, auto-tracks dependencies - Read-only state —
immutable()blocks writes,writable()for controlled access derived()— combine multiple state sources, no dependency arraysordered()— reactive sorted view with O(log N) binary insertioneffect()— auto-tracks dependencies, cleanup on re-run/unmountform()— Zod schema validation with reactive error map per field$bind()/$use()— two-way binding and error linking- Class support —
mutable(new MyClass())works out of the box
User Interface
Autonomous components following HTML's mental model — each component carries its own state, determines its own behavior, syncs with parent through state contracts ($bind).
setup()— component function runs once, stable closure survives re-rendersrender()/template()/snippet()— reactive view boundaries (React)- Bindable props — two-way prop binding, child writes propagate to parent
- IRPC integration —
.once(),.with(),.when(),.later()directly in components - Optimistic UI — update state before server confirms, rollback on failure
- React & SolidJS — same API, typically differs by a single line
Universal SSR
Same component renders on every runtime — Bun, Node.js, Cloudflare Workers, Deno.
- Request isolation — each render gets its own reactive scope, no state leaks
- Cookie propagation — mutations during SSR captured as
Set-Cookieheaders - Abort signals — SSR renders respect
AbortControllerwith configurable timeout - Vite plugin —
airSSR()runs SSR + IRPC + WebSocket on one dev server - ISR — cached HTML on hit, SSR on miss, stale-while-revalidate with background re-renders
Testing
168 test files · 2,774 tests · 100% coverage (statements, branches, functions, lines)
Get Started
# React
npx degit beerush-id/airstack/templates/air-react my-app
cd my-app && bun install && bun dev
# SolidJS
npx degit beerush-id/airstack/templates/air-solid my-app
cd my-app && bun install && bun devDocumentation · Getting Started
License
MIT