The native-first framework for modern web apps.
JSX compiled to native Web Components, signals instead of a virtual DOM, and typed server functions — on esdev or on Vite and Node.
npm create @opentf/afw@latestexport default function Counter({ start = 0 }) {
let count = $state(start);
const doubled = $derived(count * 2);
return (
<button onclick={() => count++}>
{count} × 2 = {doubled}
</button>
);
} import { action, query } from "@opentf/afw/server";
import { z } from "zod";
export const listTodos = query(async (_, { locals }) =>
db.todos.list({ owner: locals.user.id }));
export const addTodo = action(
z.object({ title: z.string().min(1) }),
async ({ title }, { locals }) =>
db.todos.insert({ owner: locals.user.id, title }),
); import { invalidate, resource } from "@opentf/afw";
import { addTodo, listTodos } from "./todos.server.js";
export default function Todos() {
const todos = resource(() => listTodos());
async function add(title) {
await addTodo({ title }); // a typed call, no fetch, no URL
await invalidate(listTodos);
}
return <ul>{(todos.data ?? []).map((t) => <li>{t.title}</li>)}</ul>;
} Why AFW
Web standards first, with the tools a real app needs
Web Components, compiled
Every component is a real Custom Element, built from JSX at compile time. Usable in any page, with or without a framework.
No virtual DOM
Signals bind each update to the DOM node it affects. No diffing, no re-rendering of whole components.
Server, static or client, per folder
One _config.js per folder: render articles per request, build legal pages once, run the editor in the browser. Client pages never enter the server bundle.
Typed server functions
Call server code like a function: validated input, folder middleware, cross-site calls refused, invalidate() to refetch.
Your toolchain
esdev with the capability-secured ES-Runtime, or Vite with Node and the whole npm ecosystem. Same app either way.
Forms and i18n built in
@opentf/afw-form: reactive values, schema validation and submit state. @opentf/afw-i18n: locale-prefixed routes, ICU messages and Intl formatters.
Testing built in
@opentf/afw-test: render, queries and userEvent for components and pages, under esdev or Vitest.
Docs sites built in
@opentf/afw-docs: MDX docs and a blog with search, feeds and llms.txt — this site is one.
How it works
A state change updates the DOM, not a component
19 · DOM renderer
Build time
On state change
React Compiler adds build-time memoization. React renders affected components and commits necessary DOM changes.
Official docs →Custom elements + signals
Build time
On state change
Custom elements manage component lifecycles; signals rerun dependent bindings. No virtual DOM.
Reactivity docs →Two workflows
Pick your toolchain, keep your app
app/ folder builds with either. The core never depends on one.esdev + ES-Runtime
One binary: dev server, bundler, test runner and a capability-secured server runtime.
- No node_modules toolchain to assemble
- File, network and process access only as declared
- Browser tests, coverage and benchmarks built in
esdev create my-appVite + Node
The tools your team already runs, with server code on Node.
- Any npm package on the server, native addons included
- Vitest for component and page tests
- Deploy dist/server to any Node host
npm create @opentf/afw@latestPerformance
Fast where it counts
| Operation | afw | react | solid | svelte |
|---|---|---|---|---|
| create 1,000 rows | 242.2 | 250.3 | 240.4 | 242.4 |
| create 10,000 rows | 2364.9 | 2966.4 | 2359.9 | 2321.8 |
| append 1,000 to 1,000 | 249.4 | 303.1 | 289.6 | 248.4 |
| update every 10th (1k) | 88.1 | 89.2 | 102.3 | 92.8 |
| swap 2 rows (1k) | 39.1 | 224.3 | 27.3 | 26.8 |
| select row (1k) | 22.7 | 25.1 | 27.1 | 26.9 |
| remove row (1k) | 39.5 | 36 | 42 | 42.1 |
| clear 10,000 rows | 171.5 | 227.2 | 143.9 | 147.2 |
Recorded 2026-11-04. Bold beats the ~8.3 ms timing resolution; the rest are ties.
A full-stack app: dev speed, build speed and memory
The same app — server-rendered pages, loaders, API routes, middleware, MDX docs and Tailwind — in both AFW workflows, Next.js, TanStack Start, SolidStart, SvelteKit, Nuxt and Astro, at 1,000 pages, fastest build first. Lower is better.
| 1,000 pages | Build memory (MB) | Build time (s) | Dev start (s) | Edit to browser (s) |
|---|---|---|---|---|
| AFW esdev | 352 | 1.19 | 1.15 | 1.024 |
| AFW Vite | 766 | 1.86 | 1.05 | 0.056 |
| Astro | 1225 | 4.60 | 3.14 | 0.057 |
| SvelteKit | 1155 | 7.34 | 1.99 | 0.056 |
| TanStack | 1287 | 10.31 | 7.34 | 7.933 |
| Next | 5849 | 16.56 | 2.70 | 0.079 |
| SolidStart | 1934 | 17.11 | 3.17 | 0.046 |
| Nuxt | 3459 | 28.09 | 4.64 | 0.079 |
Measured 2026-11-04 to 2026-11-05, median of 3 runs; every app passed the same output checks first.
Capabilities
What ships today
Core
- Client Rendering (CSR)
Compiler-driven SPA engine.
- Zero-VDOM updates
Direct DOM bindings without a virtual DOM tree.
- Reactive macros
$state, $derived, $effect, $context on fine-grained signals.
- Refs & expose
$ref to elements; imperative $expose.
- Context API
Scoped DI with createContext, ContextProvider, and $context — no prop drilling.
- Portal
Render a subtree into another DOM target; context resolves across the boundary.
Routing
- File-based router
Directory routing with client-side navigation.
- Nested layouts
Shared layouts composed around matching routes.
- Route guards
Client navigation checks and redirects; server auth uses middleware.
- Code splitting
Every route is its own chunk, in both toolchains.
- Link prefetching
<Link> warms a route's chunks and loader data on hover, focus or in view.
Rendering
- Static generation (SSG)
Pre-render routes to HTML at build time.
- MDX
MDX pages and components; docs theme included.
- Server rendering (SSR)
String renderers for an app-owned request server; shares the SSG render path.
- Hydration
First paint adopts the server DOM — pages, layouts, lists, conditionals, and islands with rich props.
- Per-route rendering
A folder's _config.js picks server, static or client; the build prints a route table and each response says which.
Tooling & DX
- Two toolchains
esdev + ES-Runtime, or Vite + Node — the same app/ folder builds with either.
- Project scaffolding
npm create @opentf/afw or esdev create ask the same questions and write the same app: client, server, static or mixed rendering; CSS or Tailwind.
- Server-rendered dev
Both dev servers render pages on the server and the browser adopts them, as in production; edits still refresh in place.
- Environment variables
PUBLIC_* values as import.meta.env in both toolchains, the same on the server and in the browser; secrets stay out.
- Dev server + reload on save
esdev watches and rebuilds configured targets, refreshing accepted modules or reloading the page.
- CSS hot updates
Global stylesheet edits update in place and keep page state.
- JavaScript module HMR
esdev hot-swaps JavaScript modules that explicitly accept updates.
- Component HMR
Component, page and layout edits refresh in place and keep their state; a compile error keeps the last view.
- Compiler diagnostics
Located compile errors and source maps; runtime errors report through the framework API.
- Testing library
Render, queries and userEvent; one test API (@opentf/afw-test/test) runs the same files under esdev and Vitest.
- TypeScript / TSXAlpha
Compile TSX components with macro typings; full editor tooling is in progress.
- Devtools extensionPlanned
Component, state, and network inspection.
Full-stack
- Middleware
Server middleware for pages, APIs and loader data when included in the request pipeline.
- Cookie helpers
getCookie / setCookie / deleteCookie on @opentf/afw/server — RFC 6265 helpers for middleware, API routes, and loaders.
- Reactive formsAlpha
@opentf/afw-form — nested reactive values, validation and submit state.
- API routes
File-based route.js / route.ts endpoints — standard Request/Response and dynamic params.
- Server functions
Typed query() / action() in .server.js files, validated, under folder middleware; invalidate() refetches.
- Data fetching
Route loaders (loader.js → router.data across SSR/SSG/SPA) and the client-side resource().
- Progressive formsPlanned
<form action={addTodo}> that works without JavaScript under SSR.
- InternationalizationAlpha
@opentf/afw-i18n — URL-prefix locale routing, ICU messages, and Intl formatters (Phase 1).
- Accessibility helpersPlanned
ARIA helpers and a11y defaults.
Styling
- Tailwind CSS
Tailwind 4 in both toolchains: esdev compiles it natively, Vite through @tailwindcss/vite.
- Scoped CSS Modules
Component-scoped class names.
Build your first AFW app
Create a project, run the dev server, and edit a page: it updates in place.