# AFW > A high-performance full-stack web framework that compiles JSX to native Web Components, with signals for reactive state updates. This file is a curated entry point for language models. For full page content, see [llms-full.txt](https://afw.opentechf.org/llms-full.txt). ## Start Here - [Home](https://afw.opentechf.org/) ## Documentation - [Introduction](https://afw.opentechf.org/docs): AFW is a native-first, zero-VDOM framework that compiles JSX to standard Web Components driven by fine-grained signals. - [Benchmarks](https://afw.opentechf.org/docs/benchmarks) - [CLI](https://afw.opentechf.org/docs/cli): Develop, build, preview and test AFW projects with esdev, or with Vite and Node. - [Comparison](https://afw.opentechf.org/docs/comparison): How AFW compares with Next.js, TanStack Start, React Router, Nuxt, SvelteKit, Astro and SolidStart — rendering, routing, data, tooling and maturity, including where AFW is behind. - [Project Configuration](https://afw.opentechf.org/docs/configuration): Use esdev.json for tooling and afw.config.js for site, docs, blog and locale settings. - [Runtime API](https://afw.opentechf.org/docs/core): Values and components exported from @opentf/afw. - [Assets & Workers](https://afw.opentechf.org/docs/core-concepts/assets): Bundle module workers, configure public assets, and reference files from JavaScript in esdev and Vite. - [Components](https://afw.opentechf.org/docs/core-concepts/components): Every component compiles to a standard Custom Element. Props are reactive and children are slotted. - [Context](https://afw.opentechf.org/docs/core-concepts/context): Scoped dependency injection with createContext, ContextProvider, and $context — share values down the tree without prop drilling. - [Environment Variables](https://afw.opentechf.org/docs/core-concepts/environment-variables): Read PUBLIC_* variables in components through import.meta.env, in both the esdev and Vite workflows; keep secrets on the server. - [Error boundaries](https://afw.opentechf.org/docs/core-concepts/error-boundary): Contain render and mount failures in a subtree with — show a fallback, retry with reset(), and keep siblings running. - [Imperative API](https://afw.opentechf.org/docs/core-concepts/imperative-api): Let a parent call into a child with $expose — publish methods on the component instance, then reach them through a $ref. - [JSX](https://afw.opentechf.org/docs/core-concepts/jsx): Every JSX pattern the AFW compiler supports — elements, attributes, events, conditionals, lists, fragments, and the pitfalls to avoid. - [Lazy Components](https://afw.opentechf.org/docs/core-concepts/lazy-components): Load a component's code only when it first renders — const Chart = () => import("./Chart.jsx") — with for the loading state and one shared download. - [Lifecycle](https://afw.opentechf.org/docs/core-concepts/lifecycle): Run code on mount and unmount, and react to resize, viewport visibility, and media queries — with automatic cleanup. - [Portal](https://afw.opentechf.org/docs/core-concepts/portal): Render a subtree into another DOM target with — escape overflow, z-index, and transform traps. - [Reactivity](https://afw.opentechf.org/docs/core-concepts/reactivity): Signal-based state with $state, $derived, and $effect — no .value boilerplate. - [Styling](https://afw.opentechf.org/docs/core-concepts/styling): Global CSS, CSS Modules, Tailwind CSS, inline style objects, and dynamic classes. - [Templating](https://afw.opentechf.org/docs/core-concepts/templating): Conditionals, init-once vs reactive holes, lists, and element refs inside JSX. - [Transitions](https://afw.opentechf.org/docs/core-concepts/transitions): Animate elements as conditionals and lists add and remove them, with the transition, in and out props and the built-in fade, scale, fly and slide. - [Data Fetching](https://afw.opentechf.org/docs/data-fetching): How data reaches an AFW page — route loaders on the server, resource() in the browser, and for loading states. - [Loader Errors & Redirects](https://afw.opentechf.org/docs/data-fetching/loader-errors): What a route loader does when data is missing or access is refused: notFound(), thrown Responses for redirects and refusals, and other errors. - [Loading States](https://afw.opentechf.org/docs/data-fetching/pending): One loading state for every resource inside a : a fallback on first load, a refreshing view on refetch, a delay against flashes, and a section's own error view or the nearest ErrorBoundary. - [resource()](https://afw.opentechf.org/docs/data-fetching/resource): Client-side async data: resource() wraps a fetcher in reactive data, loading and error, with abort, refetch, caching and invalidation. - [Route Loaders](https://afw.opentechf.org/docs/data-fetching/route-loaders): Server data for a page: a loader.js next to it runs before the page renders, and its result reaches the page as router.data. - [Deployment](https://afw.opentechf.org/docs/deployment): Ship your AFW app — static output to any host, or a server for SSR and API routes. - [Production Build](https://afw.opentechf.org/docs/deployment/build): Compile and bundle your app with declarative esdev targets. - [Fetch handler](https://afw.opentechf.org/docs/deployment/fetch-handler): Deploy full-stack AFW apps to any Fetch-native runtime — static assets plus middleware and API routes, with platform bindings via context.env. - [Hydration](https://afw.opentechf.org/docs/deployment/hydration): How AFW adopts server-rendered HTML on first paint — SSG and SSR wire reactivity onto existing DOM without a virtual tree. - [Server Setup](https://afw.opentechf.org/docs/deployment/server): Serve API routes, middleware, loaders, server functions and SSR pages from the generated @afw/server handler. - [Static Generation](https://afw.opentechf.org/docs/deployment/static-generation): Prerender routes during esdev build with an explicit SSG target. - [Installation](https://afw.opentechf.org/docs/getting-started/installation): Create an AFW project on esdev and ES-Runtime, or on Vite and Node. - [Library Template](https://afw.opentechf.org/docs/getting-started/library-template): Publish components as JSX source; apps compile them with esdev or Vite. - [Project Structure](https://afw.opentechf.org/docs/getting-started/project-structure): How an AFW project is laid out and which files have special meaning. - [Tutorial](https://afw.opentechf.org/docs/getting-started/tutorial): Build a small notes app — reactive state, lifecycle hooks, a form with @opentf/afw-form, a loader, server functions, a dynamic route and a test — then ship it as a Node server. - [Reactive Macros](https://afw.opentechf.org/docs/macros): The compiler-provided globals — $state, $derived, $effect, $ref, $context, $expose — and lifecycle hooks. - [Roadmap](https://afw.opentechf.org/docs/roadmap): The everyday features AFW is still missing compared with React, Vue, Svelte and Solid and their ecosystems, what you can use today, and what is planned. - [API Routes](https://afw.opentechf.org/docs/routing/api-routes): File-based server endpoints under app/api — standard Request/Response handlers, dynamic params, and middleware. - [Cookies](https://afw.opentechf.org/docs/routing/cookies): Read and write cookies in middleware, API routes, and loaders with RFC 6265 helpers from @opentf/afw/server. - [Dynamic Routes](https://afw.opentechf.org/docs/routing/dynamic-routes): Match path segments with [param] and [...rest] folders, and read them from router.params. - [Loading & Error UI](https://afw.opentechf.org/docs/routing/loading-and-errors): loading.jsx and error.jsx — a route's loading view during navigation and data loading, and its error view when the loader, the page or a resource fails. - [Metadata & SEO](https://afw.opentechf.org/docs/routing/metadata): Declare page titles, descriptions, Open Graph tags, and structured data on routes and layouts. - [Middleware](https://afw.opentechf.org/docs/routing/middleware): Server-side _middleware.js for every request — pages, API routes, loader data, and SSR — with context.locals shared downstream. - [Navigation](https://afw.opentechf.org/docs/routing/navigation): Client-side navigation with the Link component and the reactive router API. - [Pages & Layouts](https://afw.opentechf.org/docs/routing/pages-and-layouts): File-based routing with nested layouts and a not-found page. - [Rendering](https://afw.opentechf.org/docs/routing/rendering): Render each part of an app on the server, at build time or in the browser, with a _config.js per folder. - [Route Groups](https://afw.opentechf.org/docs/routing/route-groups): Folders in parentheses organize pages, give them their own layout, middleware, loaders and error pages, without becoming part of the URL. - [Route Guards](https://afw.opentechf.org/docs/routing/route-guards): Protect navigation with a centralized async route guard. - [Server API](https://afw.opentechf.org/docs/server): The @opentf/afw/server surface — middleware, cookies, API routes, server functions, createFetchHandler, and runtime adapters. - [Server Functions](https://afw.opentechf.org/docs/server-functions): Call server code from components as typed async functions — query() and action() in *.server.js files, validated, guarded by middleware. - [Troubleshooting](https://afw.opentechf.org/docs/troubleshooting): Resolve state updates, compile errors, hydration mismatches and metadata issues. ## API Reference - [API Reference](https://afw.opentechf.org/api): Reference for the optional AFW packages — forms, i18n, testing, and docs. - [afw-docs API](https://afw.opentechf.org/api/afw-docs): The @opentf/afw-docs exports — config helper, components, virtual modules, and build plugins. - [afw-form API](https://afw.opentechf.org/api/afw-form): createForm options, the returned form object, and the register binding. - [afw-i18n API](https://afw.opentechf.org/api/afw-i18n): createI18n, the reactive t() translator, the fmt formatters, the component, and the locale helpers. - [afw-test API](https://afw.opentechf.org/api/afw-test): render, queries, userEvent, and cleanup. ## Blog - [Blog](https://afw.opentechf.org/blog) - [How fine-grained signals work](https://afw.opentechf.org/blog/how-signals-work): A look at the reactive graph that updates only the DOM nodes a change touches. - [Introducing AFW](https://afw.opentechf.org/blog/introducing-afw): Why we built a native-first, zero-VDOM framework that compiles JSX to real DOM. - [Inside the on-demand dev server](https://afw.opentechf.org/blog/on-demand-dev-server): How AFW boots in milliseconds by compiling only the route you visit — and how a module graph keeps hot reloads precise. ## Other Routes - [Packages](https://afw.opentechf.org/packages): Reference for the optional AFW packages — forms, i18n, testing, and docs. - [afw-docs](https://afw.opentechf.org/packages/afw-docs): A documentation-site generator for AFW — themed shell, build-time nav, and MDX content. - [Blog](https://afw.opentechf.org/packages/afw-docs/blog): Add a blog to your site with @opentf/afw-docs — a generated post list plus banner, meta, reading-time, and TOC components. - [Components](https://afw.opentechf.org/packages/afw-docs/components): Content components shipped with afw-docs — callouts, steps, tabs, and code blocks. - [Docs Configuration](https://afw.opentechf.org/packages/afw-docs/configuration): Site-wide options in afw.config.js and per-folder ordering with _meta.js. - [Markdown & MDX](https://afw.opentechf.org/packages/afw-docs/markdown): Every Markdown and MDX feature AFW docs support — formatting, tables, code, and JSX components inline. - [afw-form](https://afw.opentechf.org/packages/afw-form): A reactive, path-based form engine for AFW — signal-bound fields, nested state, and pluggable validation. - [Nested State](https://afw.opentechf.org/packages/afw-form/nested-state): Address deeply nested objects and arrays with path strings for fine-grained, efficient updates. - [Validation](https://afw.opentechf.org/packages/afw-form/validation): Validate with a plain function or a schema library like Zod, and control when validation runs. - [afw-i18n](https://afw.opentechf.org/packages/afw-i18n): Internationalization for AFW — URL-prefix locale routing, ICU messages, and locale-aware Intl formatters, all reactive. - [Formatting](https://afw.opentechf.org/packages/afw-i18n/formatting): Locale-aware number, currency, percent, date, relative-time, and list formatting over the native Intl APIs. - [Locale Routing](https://afw.opentechf.org/packages/afw-i18n/routing): URL path-prefix locale routing — prefix_except_default, localized links, per-locale SSG/SSR, and locale detection. - [afw-test](https://afw.opentechf.org/packages/afw-test): DOM testing for AFW — render components, drive interactions, and assert on reactive updates. - [Queries](https://afw.opentechf.org/packages/afw-test/queries): Find elements by role, label, text, or test id — and choose the right getBy / queryBy / findBy variant. - [Setup](https://afw.opentechf.org/packages/afw-test/setup): Compile test components with the esdev plugin and register automatic cleanup. - [Testing Strategies](https://afw.opentechf.org/packages/afw-test/strategies): What to test and how — behavior over implementation, async, effects, forms, and route guards. - [User Events](https://afw.opentechf.org/packages/afw-test/user-events): Drive realistic interactions — clicks, typing, keyboard, and selection — with userEvent. - [Writing Tests](https://afw.opentechf.org/packages/afw-test/writing-tests): The render → query → interact → assert loop, with props, cleanup, and reactive updates. ## Optional - [RSS feed](https://afw.opentechf.org/blog/rss.xml): Blog feed in RSS 2.0 format. - [Atom feed](https://afw.opentechf.org/blog/atom.xml): Blog feed in Atom 1.0 format.