---
title: "Upgrading to 0.1"
description: "Move a Farm app from the 0.1.0 betas to the stable 0.1 release: upgrade commands, behavior changes, and deprecated APIs to replace before 0.2."
canonical_url: "https://mcp.farmjs.dev/docs/upgrading"
markdown_url: "https://mcp.farmjs.dev/docs/upgrading.md"
last_updated: "2026-10-20"
x_farming_labs_generated_preamble: true
---

# Upgrading to 0.1
URL: /docs/upgrading
LLM index: /llms.txt
Description: Move a Farm app from the 0.1.0 betas to the stable 0.1 release: upgrade commands, behavior changes, and deprecated APIs to replace before 0.2.

# Upgrading to 0.1

Farm 0.1.0 is the first stable release. It follows `0.1.0-beta.108` and carries the
[stability policy](/docs/stability): patch releases keep stable APIs working, and a minor release
removes a stable API only after deprecating it first.

## Upgrade the packages

Run the upgrade command from the app root:

```bash
farm upgrade --latest
```

It moves every published `@farm.js/*` dependency to its `latest` tag with the app's package
manager. Packages in the shared release group, such as `@farm.js/core`, `@farm.js/cli`,
`@farm.js/devtools`, and the integrations, move to `0.1.0`. Renderer packages and plugins that are
still in beta move to their newest beta, which is what their `latest` tag points to. Preview the
commands first with `farm upgrade --latest --dry-run`.

To upgrade by hand, drop the `@beta` tag and keep every shared-group package on the same version.
The integration packages pin `@farm.js/core` exactly, so mixing versions produces peer conflicts:

```bash
pnpm add @farm.js/core@latest
pnpm add -D @farm.js/cli@latest @farm.js/devtools@latest
```

pnpm 10.16 and newer can hold back versions published in the last day through
`minimumReleaseAge`. Templates add `@farm.js/*` to `minimumReleaseAgeExclude`; add the same entry
to your `pnpm-workspace.yaml` if an upgrade right after a release resolves an older version.

## Behavior changes

These changes landed between the last beta and 0.1.0. Most apps need no code change.

- **React streaming on Node targets.** With React 19, production servers on Node presets now stream
  through `renderToPipeableStream`, the same primitive development uses. Earlier betas used React's
  Web stream on Node when it was available. Response bodies are unchanged.
- **React on edge targets.** Edge presets bundle React DOM's edge server build (`server.browser` on
  React 18) instead of its Node build. Cloudflare module Workers now bundle React instead of
  failing at startup with `No such module "react"`.
- **Content Security Policy nonces and hashes.** Enable `security.csp.nonce` for a strict script
  policy. Farm generates a per-request nonce for dynamic HTML and applies it to streamed script
  elements. Fully prerendered pages stay static and receive per-page SHA-256 hashes instead. See
  [Content Security Policy](/docs/configuration#content-security-policy).
- **Caller-owned databases.** `storage.dispose()` no longer closes a database you passed to
  `databaseStorage(database)`. Databases Farm creates from storage configuration are still closed
  by Farm.
- **DevTools version.** `@farm.js/devtools` is now released with core and shares its version.

## Feature packages the app installs

Starting with 0.1.22, `@farm.js/core` no longer installs the packages behind optional features.
An app that uses one of these features declares the package itself. New starters already do, and
`farm doctor` reports a feature that is in use without its package.

| Feature                                                    | Install                         |
| ---------------------------------------------------------- | ------------------------------- |
| Built-in Tailwind CSS (a stylesheet imports `tailwindcss`) | `pnpm add -D @tailwindcss/vite` |
| `opengraph-image`/`twitter-image` JSX, `@farm.js/core/og`  | `pnpm add @vercel/og`           |
| Image optimization on Node, Vercel, Netlify, and in dev    | `pnpm add sharp`                |
| Docs engine (`docs` enabled, or a `docs.config.*` file)    | `pnpm add @farming-labs/docs`   |

Without `@tailwindcss/vite`, Farm keeps building without Tailwind and logs the install command the
first time a stylesheet imports `tailwindcss`. Without `@vercel/og`, `farm build` fails with the
install command when the app has a generated metadata image or imports `@farm.js/core/og`; static
`opengraph-image.png` files do not need it. Without `sharp`, `images.provider: "auto"` serves
original image URLs (the documented `provider: "none"` behavior) and logs the install command, and
`images.provider: "node"` fails. Without `@farming-labs/docs`, `farm dev` and `farm build` fail
with the install command when docs are enabled.

## Deprecated APIs to replace before 0.2

These still work in 0.1 and are scheduled for removal in a later minor release.

### Plugin lifecycle hooks

| Deprecated                                                      | Use instead                      |
| --------------------------------------------------------------- | -------------------------------- |
| `init`                                                          | `setup`                          |
| `config`                                                        | `configure`                      |
| `ready`                                                         | `runtime.start`                  |
| `shutdown`                                                      | `runtime.close`                  |
| `devServerCreated`                                              | `dev.server`                     |
| `hmrUpdate`                                                     | `dev.update`                     |
| `buildStart`, `beforeBundle`                                    | `build.before`                   |
| `buildEnd`, `afterBundle`                                       | `build.after`                    |
| `beforeNitroBuild`                                              | `build.configure`                |
| `routeDiscovered`, `middlewareDiscovered`, `apiRouteDiscovered` | `router.discovered`              |
| `routesGenerated`                                               | `router.generated`               |
| `beforeRouteMatch` / `afterRouteMatch`                          | `router.before` / `router.after` |
| `beforeRender`                                                  | `render.before`                  |
| `afterRender`, `transformHTML`                                  | `render.html`                    |
| `transformPage`                                                 | `render.before` or `render.html` |
| `beforeApiHandler`, `beforeRequest`                             | `runtime.before`                 |
| `afterApiHandler`, `afterResponse`                              | `runtime.after`                  |
| `requestContext` on the plugin context                          | `ctx.req`                        |

### Integrations and schemas

| Deprecated                                               | Use instead                           |
| -------------------------------------------------------- | ------------------------------------- |
| `slot` on integration descriptors, `FarmIntegrationSlot` | `category`, `FarmIntegrationCategory` |
| `requestContext`, `FarmIntegrationRequestContextStore`   | `req`, `FarmRequestStore`             |
| `defineIntegrationSchema`                                | `defineSchema` (an exact alias)       |
| `FarmIntegrationSchema*` types                           | the matching `FarmSchema*` types      |

### Configuration and routes

| Deprecated                                   | Use instead                                          |
| -------------------------------------------- | ---------------------------------------------------- |
| The built-in DevTools dashboard (`devtools`) | `devtools()` from `@farm.js/devtools` in `plugins`   |
| `defineCron()`                               | `cron` in `farm.config.ts`, pointing at an API route |
| `generateStaticParams`                       | `getStaticPaths`                                     |
| `md.routes`                                  | `md.expose`                                          |
| `security.contentSecurityPolicy`             | `security.csp`                                       |

## Getting help

If an app behaves differently after upgrading, run `farm doctor` and open an issue with its output,
the renderer, and the deployment target.

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
Docs-scoped sitemap: [/docs/sitemap.md](/docs/sitemap.md).
Well-known sitemap: [/.well-known/sitemap.md](/.well-known/sitemap.md).
