Skip to content

v1.0.0

Choose a tag to compare

@mahdaen mahdaen released this 29 May 21:52
· 60 commits to main since this release

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 + invalidationmaxAge caches, 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 IRPCFile as arguments, transport handles the rest
  • Runtime validation — Zod schemas for input/output enforcement
  • CRUD moduleirpc.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 trackingreader.current.name shows which step is running
  • Manual stepping.step(), .run(), .skip(), .reset() for wizard-style flows
  • Persistencesnapshot() / 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/2 updates state in place, no unmount
  • Modal routesmodal() renders as overlay, keeps current page mounted
  • Preloading — providers fetch on <Link> hover
  • Render modesdeferred (block until resolved) and immediate (stream in)

State Management (Anchor Core)

Transparent reactive Proxies — read and write properties normally, the system tracks dependencies and triggers updates.

  • Direct mutationstate.count++ triggers updates, no setters or copies
  • Deep reactivity — nested objects auto-wrapped, configurable depth
  • Computed getters — standard JS get on mutable objects, auto-tracks dependencies
  • Read-only stateimmutable() blocks writes, writable() for controlled access
  • derived() — combine multiple state sources, no dependency arrays
  • ordered() — reactive sorted view with O(log N) binary insertion
  • effect() — auto-tracks dependencies, cleanup on re-run/unmount
  • form() — Zod schema validation with reactive error map per field
  • $bind() / $use() — two-way binding and error linking
  • Class supportmutable(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-renders
  • render() / 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-Cookie headers
  • Abort signals — SSR renders respect AbortController with configurable timeout
  • Vite pluginairSSR() 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 dev

Documentation · Getting Started

License

MIT