Migrations
Move an existing app to Farm.js with a source-specific guide. This section covers every framework in the homepage comparison: Next.js, SvelteKit, Nuxt, and TanStack Start.
What you gain with Farm.js
One framework for UI, server data, deployment, and agents. Farm.js combines its own compiler, rendering, and data features with typed routes and integrations. Start with the capabilities your app needs; the compiler and experimental rendering modes are opt-in.
Core features
- Farm.js's React compiler. The experimental compiler
in
@farm.js/reactprepares eligible components at build time so supported updates touch only the affected DOM bindings. Opt in withreact({ compiler: true }); unsupported components keep React's normal rendering path. - Islands and islx. Farm.js's experimental islands mode sends server HTML and hydrates client components, using Farm.js's islx format instead of a React Flight payload. It keeps static content out of the client component tree.
- Rendering and caching per route. Choose server rendering or static output, timed revalidation, and shared cache invalidation. Experimental partial prerendering caches a page shell while dynamic sections load.
- Typed server data. Validated endpoints generate typed callers. Server queries add deduplication, prefetching, and shared invalidation; calling them from the browser requires the server-function transform described in that guide.
- Development through production. Vite powers development; Nitro packages production output
for Node, Vercel, Cloudflare, and Netlify, with additional Nitro presets.
farm deploy --planshows the deployment plan before it runs.
Developer experience
- Generated types. Routes, APIs, environment values, and
i18n messages get declarations from the application itself.
farm generate --checkcatches stale output in CI. - Inspect the running app.
farm doctor,farm explain /products/42, DevTools, and Hints explain configuration, routes, served code, and page problems. - Reuse application foundations. Layers, themes,
storage, and cron share conventions across projects.
farm add integrationwires supported services into their routes, types, and lifecycle. - Share and extend. Preview tunnels expose a local app to a teammate or device. Desktop and the mobile preview extend the project with their documented platform limits.
Agent native at the core
Agent readability and discovery are built into @farm.js/core. On the normal page-serving
pipeline, these defaults work without an agent integration or a separate MCP server:
- Markdown mirrors,
llms.txt, sitemap, and JSON-LD make eligible public content readable and discoverable. - Read-only MCP lists, searches, and reads eligible
public static pages through
/mcp. - The app manifest describes installed capabilities; the AI catalog advertises available MCP servers. The API catalog is a separate opt-in.
Configure or disable these through md and agent in farm.config.ts. The docs engine supplies
its own indexes and MCP server; an application's own MCP server takes precedence. API-only apps
have no page-derived defaults. The experimental React RSC pipeline does not yet serve the default
read-only MCP endpoint.
To let agents act, explicitly configure API tools, experimental
browser tools, or durable agent execution.
Discovery does not grant write access. Use farm agent check to inspect the running app, and the
agent-framework guide to connect an existing agent runtime.
Integrations for the product, plugins for the framework
Use integrations for services: authentication with Better Auth or Clerk; billing with Stripe, Polar, or Autumn; email with Resend; background work with Jobs, Trigger.dev, or Inngest; and data or agent services from the integration catalog.
Use plugins when you want to change how the framework builds, serves, or observes the app:
| Need | Relevant plugins and extension APIs |
|---|---|
| Inspect and control performance | Analyzer, DevTools, Hints. |
| Refine navigation | Prefetch, Progress, Scroll restoration. |
| Publish content and find it | Content, Search. |
| Work offline | PWA for navigation and assets; Sync for row-level data and queued writes. |
| Manage browser SDKs | Scripts for consent and loading; Partytown for opted-in worker execution. |
| Operate the server | Health, Sentry, and community-maintained Blyp. |
| Protect forms and test requests | Bot protection, MSW. |
| Extend the build and browser | StyleX, WebAssembly, Federation. |
| Expose agent tools | API MCP, WebMCP. |
| Build your own extension | Server/build hooks, client hooks, and schema-owned tables. |
Install the capabilities the application uses. Check each plugin's renderer and runtime requirements; a React provider or example is not automatically a Vue or Svelte component.
Read the performance evidence
The guides compare different workloads:
- The Next.js guide summarizes November 2026 measurements of a real documentation site, Vercel deploys, and a separate four-page application. It separates observed build charges from projected runtime costs and self-hosted throughput from CDN delivery.
- The TanStack Start, Nuxt, and SvelteKit guides use the checked-in five-framework SSR fixture. Its Farm.js arm uses React, so it does not measure Farm.js's Vue or Svelte renderer. SvelteKit wins some of its server timings.
Record your own baseline before moving: startup to usable page, edited component to visible result, cold and warm builds, transferred assets, and production latency. Keep route content, authentication, rendering mode, compression, and deployment target equivalent. A migration is successful when the application preserves its behavior and improves the costs that matter to you.
Choose a source
React apps keep their components, since React is Farm.js's default renderer. Nuxt applications can retain Vue SFCs through @farm.js/vue,
and SvelteKit applications can retain Svelte components through @farm.js/svelte while their
framework-specific modules are adapted.
| Source | Renderer | Guide covers |
|---|---|---|
| Next.js | React (built in) | App Router files, server actions, route handlers, metadata, middleware, and config. |
| TanStack Start | React (built in) | File routes, the root route, loaders, server functions, and server routes. |
| SvelteKit | @farm.js/svelte | Routes, layouts, load functions, form actions, endpoints, hooks, and adapters. |
| Nuxt | @farm.js/vue | Pages, layouts, server routes, data composables, middleware, and runtime config. |
Migrate with a coding agent
Every guide has an expanded Markdown version written for coding agents. It maps each feature of the source framework to its Farm.js equivalent, marks what works unchanged, what needs a rewrite, and what has no direct equivalent, and ends with a verification checklist.
Request any guide with a .md suffix, or send Accept: text/markdown:
curl https://farmjs.dev/docs/migrations/nextjs.mdThen hand the URL to your agent:
Migrate this app to Farm.js. Follow https://farmjs.dev/docs/migrations/nextjs.md and run its
verification checklist before removing Next.js.Replace nextjs with tanstack, sveltekit, or nuxt for the other sources.
Workflow
Each guide works as a checklist:
- Create a branch and keep the existing app runnable.
- Add Farm.js and the matching renderer, and create
farm.config.ts. - Move routes into
src/app, starting with the root layout. - Replace framework-specific imports, data loading, mutations, and middleware one feature at a time.
- Run the app in development and production, and compare every route with the old app.
- Remove the previous framework only after the Farm.js build behaves the same in production.
Ground rules
- Farm.js's app directory is
src/app, and the@/import alias points atsrc. - Production output lives in
.farm/.output. The start script isnode .farm/.output/server/index.mjs, the same as in new Farm.js projects. - Delete the previous framework's
vite.config.*once its plugins are no longer needed. Move any options you still want into thevitefield offarm.config.ts. - Pin exact Farm.js versions. Package managers with a minimum release age, such as pnpm 11 and later,
can resolve
latestto an older release for a day after a publish. - Unsupported APIs should be rewritten deliberately rather than shimmed. Each guide lists the closest Farm.js equivalent.
Compare Farm.js performance, developer tools, agent capabilities, integrations, and migration tradeoffs for Next.js, TanStack Start, SvelteKit, and Nuxt.