Alpha

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@latest
app/Counter.jsx
export default function Counter({ start = 0 }) {
  let count = $state(start);
  const doubled = $derived(count * 2);

  return (
    <button onclick={() => count++}>
      {count} × 2 = {doubled}
    </button>
  );
}

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

React re-renders components and reconciles a virtual DOM. AFW's compiler wires each piece of state to the DOM bindings that read it, so a change runs exactly those.
Reactivity in depth →
React

19 · DOM renderer

Build time

JSX components
React Compiler (optional)
JSX transform

On state change

State update
Component render
Reconciliation (VDOM)
DOM commit

React Compiler adds build-time memoization. React renders affected components and commits necessary DOM changes.

Official docs →
AFW

Custom elements + signals

Build time

JSX components
afwc compiler
Custom elements + bindings

On state change

Signal change
Dependent DOM bindings
DOM updates

Custom elements manage component lifecycles; signals rerun dependent bindings. No virtual DOM.

Reactivity docs →

Two workflows

Pick your toolchain, keep your app

The same 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-app
Set it up →

Vite + 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@latest
Set it up →

Performance

Fast where it counts

The runtime against the React, Solid and Svelte 5 libraries — median ms over 3 pooled runs, 4× CPU throttling, lower is better.
Operationafwreactsolidsvelte
create 1,000 rows242.2250.3240.4242.4
create 10,000 rows2364.92966.42359.92321.8
append 1,000 to 1,000249.4303.1289.6248.4
update every 10th (1k)88.189.2102.392.8
swap 2 rows (1k)39.1224.327.326.8
select row (1k)22.725.127.126.9
remove row (1k)39.5364242.1
clear 10,000 rows171.5227.2143.9147.2

Recorded 2026-11-04. Bold beats the ~8.3 ms timing resolution; the rest are ties. Method & caveats →

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 pagesBuild memory (MB)Build time (s)Dev start (s)Edit to browser (s)
AFW esdev3521.191.151.024
AFW Vite7661.861.050.056
Astro12254.603.140.057
SvelteKit11557.341.990.056
TanStack128710.317.347.933
Next584916.562.700.079
SolidStart193417.113.170.046
Nuxt345928.094.640.079

Measured 2026-11-04 to 2026-11-05, median of 3 runs; every app passed the same output checks first. All sizes, method & caveats →

Capabilities

What ships today

Everything without a label is supported. The comparison shows where AFW stands against other frameworks.

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.