Farm.js - The framework for the web and agents

Farm.js

4 min read Original article ↗

Build / Ship / Scale

a framework for product-integrated apps

/agents

Bring the stack you already use. Farm.js turns it into one product for people and agents, with typed APIs, integrations, docs, and deploys built in.

Developer experience

Development

A blazingly fast dev server

Start the whole app once, then see every page request and response time as you work.

Typed APIs

Types from route to client

Define an API route once. Farm.js generates a client with typed inputs and responses.

Integrations

Connect once. Keep full control.

Connect billing, API keys, and more in one place. Pass existing provider instances and call every service through typed APIs.

Production

Build once. Deploy together.

Farm.js packages routes, middleware, typed clients, and deployment config into one production build.

Renderers

Your UI runtime, your choice

Keep React with zero config, or choose Preact, Solid, Vue, or Svelte. Routing, server features, SSR, and hydration stay on one contract.

React compiler

React updates optimized ahead of time

Farm prepares safe state updates at build time and updates the DOM directly. React handles anything the compiler cannot safely optimize.

Framework benchmarks

Startup advantage

Farm gets your first page running: 5.31× faster than Next.js; 2.96× faster than SvelteKit; 8.78× faster than Nuxt; 3.00× faster than TanStack Start.

Cold dev startup through the first rendered SSR page, measured against the same routed fixture.

Production build

Farm builds the same fixture: 4.21× faster than Next.js; 2.94× faster than SvelteKit; 7.62× faster than Nuxt; 1.17× faster than TanStack Start.

A complete production compile of the same SSR project, with generated output ready to boot.

Production boot

Farm's server is up and answering: 3.25× faster than Next.js; 0.89× faster than SvelteKit; 1.53× faster than Nuxt; 1.07× faster than TanStack Start.

Production server spawn to the first validated, fully read response, from the same build output.

HTML size

Farm sends a lighter first page: 3.76× smaller than Next.js; 1.02× smaller than SvelteKit; 1.04× smaller than Nuxt; 1.13× smaller than TanStack Start.

Bytes in the production response body for the same page. A lighter page finishes downloading sooner.

Connected systems

Routing

The app router you know

Build pages, layouts, API routes, loading states, and typed links in one app directory.

Deployment

Deploy where you want

Ship to Vercel, Cloudflare, Netlify, or self-hosted Node with built-in Nitro presets.

Documentation

Docs for people and agents

Enable a complete docs surface with MDX, navigation, search, MCP, and agent-ready endpoints from the same source.

Layers

Share architecture, not boilerplate

Compose routes, middleware, integrations, components, and config from local or package layers. Project files always win.

KV Storage

Key/value storage for the runtime

Mount SQLite, Redis, S3, or another key/value driver for caches, settings, counters, idempotency records, and object-backed values.

Advanced routes

Configure the whole route in one place

Validate params, prepare request data, load the page, and run post-load work in one typed route definition.

Experimental rendering

Native rendering for static regions

Farm detects large, host-only Server Component regions and renders eligible trees through Strata's Rust-native renderer. Everything else stays on React.

Markdown mirrors

Every page, readable by agents

Every app page receives a Markdown representation at a .md URL or through content negotiation. Keep the generated output or override it with page.md.

Bring your backend

Keep the backend you already have

Mount any app with a fetch handler, like Hono or Elysia, or any Node.js framework, like Express, Koa, Fastify, or NestJS, on one API route. It runs in development and production beside your typed routes.

Mobile

The same pages, as a native app

farm dev --mobile puts your pages in a native frame with tabs, stacks, sheets, and the back gesture. Draw a route with native views or React Native when it needs more. In preview on emulators and simulators.

Agent systems

Agent runtimes

Run agents beside the app

Choose Eve or Cloudflare Agents. Farm starts the runtime in development, owns its same-origin routes, and composes supported production output.

Native clients

Keep the provider-native SDK

Use useEveAgent for durable conversations or useAgent for typed WebSocket state and RPC. Farm does not add a duplicate client layer.

Built with Farm.js

One framework. The whole product.

Build routing, APIs, integrations, agents, docs, and deployment together in one React framework.