a full-stack, renderer-agnostic framework for the web and agents, with AOT React compiler.
The framework for the web and agents.
Every Farm.js app serves its pages to people and to AI agents: server-rendered HTML, a Markdown copy of each page, and llms.txt, on by default. Turn on MCP and your server functions become tools agents can call. Bring any agent runtime: Eve and Cloudflare Agents plug in through Farm's open agent runtime contract, and the AI SDK, Mastra, LangGraph, and the OpenAI Agents SDK run in a plain API route. Built on Vite and Nitro, with typed routes, Server Actions, and streaming SSR. React is the default renderer, and beta Preact, Solid, Vue, and Svelte adapters use the same routing and server contracts. See Stability and Support for what 0.1 covers.
Documentation · Examples · Quick Start
| Feature | What it gives you |
|---|---|
| ⚛️ Custom RSC renderer | A purpose-built RSC, streaming SSR, and client hydration pipeline, with optional Rust-native rendering for eligible host-only regions through Strata. |
| 🔄 Server Actions | Write mutations next to your components with "use server", form actions, optional encrypted bound arguments, and configurable request security. |
| ⚡ Blazingly fast development | Vite-powered startup, on-demand transforms, and fast HMR keep the feedback loop nearly instant. |
| 🧭 Typed app-directory routing | Pages, layouts, route groups, dynamic segments, loading states, error boundaries, middleware, and generated route types. |
| 🧩 Flexible rendering | Choose streaming SSR, static generation, ISR, PPR, or deferred hydration islands route by route. |
| 🛠️ Full-stack primitives | Build with API routes, server functions, middleware, caching, KV storage, cron handlers, OpenAPI, and post-response work. |
| 🔌 First-party integrations | Add authentication, billing, email, jobs, AI, API keys, databases, and provider-owned routes through one typed integration model. |
| 🎭 Renderer choice | React by default, with Preact, Solid, Vue, and Svelte renderers selected by one line of config — same routes, server functions, and integrations everywhere. |
| 🧪 AOT React compiler | An experimental compiler turns eligible components into direct DOM updates that skip reconciliation, falling back to normal React whenever eligibility can't be proven. |
| 🚀 Production-ready output | Build deployable server and client output with Nitro-powered adapters and per-route runtime controls. |
| 🎨 Great defaults | Start with TypeScript, Tailwind CSS, sensible conventions, and a clean project structure—without assembling the framework yourself. |
Experimental native rendering: Farm.js can automatically send eligible, server-only React subtrees through the Strata native renderer while safely falling back to normal React rendering for unsupported trees.
No install needed: open the playground on StackBlitz to see server rendering, client islands, and typed server calls in one page.
pnpm create @farm.js/app my-app --template basic --typescript
cd my-app
pnpm dev
Your app will be running at http://localhost:3000!
Use `--list-templ
jobs: runtime follow-ups after pluggable runtimes
https://github.com/farming-labs/farm.js/issues/2692
Labels: None
webhooks: generic integration to send signed events and receive any provider
https://github.com/farming-labs/farm.js/issues/2684
Labels: enhancement, help wanted
compression: precompressed asset serving and zstd negotiation
https://github.com/farming-labs/farm.js/issues/2538
Labels: enhancement, help wanted
route rules: has/missing conditions on redirects and rewrites
https://github.com/farming-labs/farm.js/issues/2537
Labels: enhancement, help wanted
plugin: web vitals reporter on the unused performance client hook
https://github.com/farming-labs/farm.js/issues/2532
Labels: enhancement, good first issue
feat(dev): load dev server modules through Vite Environment API module runners instead of ssrLoadModule
https://github.com/farming-labs/farm.js/issues/1996
Labels: None
guide: seo and ai visibility with external tools
https://github.com/farming-labs/farm.js/issues/1806
Labels: documentation
optional search console integration
https://github.com/farming-labs/farm.js/issues/1805
Labels: enhancement, help wanted
Thank you for your interest in contributing to Farm.js! This guide will help you get started.
Repository architecture, package boundaries, verification expectations, and pull request guidance live in AGENTS.md. Coding agents must read and follow it; human contributors can use it as the current maintainer playbook.
git clone https://github.com/your-username/farm.js.git
cd farm.js
pnpm install
pnpm build
# Start playground for testing
cd playground
pnpm dev
# Or run tests
pnpm test
farm.js/
├── packages/
│ ├── farm/ # Core framework
│ ├── farm-cli/ # @farm.js/cli tools
│ └── create-farm-app/ # @farm.js/create-app tool
├── examples/ # Example applications
├── docs/ # Documentation site
├── playground/ # Development testing
└── tests/ # Integration tests
git checkout -b feature/your-feature-name
Make your changes
Test your changes
# Run unit tests
pnpm test
# Test in playground
cd playground
pnpm dev
# Test examples
cd examples/basic
pnpm dev
The workspace pins Vitest and its coverage provider to one version. When upgrading,
update every declaration together and run node --test scripts/vitest-versions.test.js.
Vitest 5 uses the workspace's Vite peer, clears mock call history before each test,
and exposes benchmarks through the test-context bench fixture. Keep benchmark
controls and assertions when migrating a benchmark; use await bench.compare(...)
inside a test in a .bench.ts file.
Use pnpm --filter @farm.js/core exec vitest doctor or
pnpm --filter @farm.js/react exec vitest doctor on a quiet machine to compare test
settings. Filters may scope a diagnosis, but a filtered result does not establish
that disabling isolation or changing pools is safe for the whole package. Validate
any recommendation against the full suite before changing shared defaults.
/docsgit push origin feature/your-feature-name
Create a Pull Request
Address feedback
Maintainers use Bumpp to align package versions, verify the workspace, create the release commit and tag, and publish the packages to npm. See RELEASING.md for the commands and recovery steps.
Please be respectful and inclusive in all interactions. We follow the Contributor Covenant code of conduct.
By contributing to Farm.js, you agree that your contributions will be licensed under the MIT License.