# The App Router went stable. My site did not move.

> Next.js 13.4 marked the App Router stable on the fourth of May. I spent a Saturday on a migration branch and then deleted it, because the new model is good at things this site does not do.

- Author: Deyan Peev (https://deyanpeev.com)
- Published: 2023-05-20
- Tags: Next.js, React, TypeScript, Frontend, Vercel
- URL: https://deyanpeev.com/posts/the-app-router-went-stable

Next.js 13.4 was announced on the fourth of May, and the headline was that the
App Router is stable. That word mattered. The App Router shipped in 13.0 last
October as something you were told not to put in production, and plenty of
people had been waiting for this announcement before looking at it seriously.

I was one of them. This site runs on Next.js with a `pages` directory. I made a
branch, spent a Saturday on it, and then deleted the branch, even though I think
the new router is the better design.

# Read the three labels carefully

The release contains three things at three different levels of maturity, and
it's easy to read the headline as covering all of them.

**App Router: stable.** React Server Components, nested routes and layouts,
colocated data fetching, streaming with Suspense, the metadata API. The
recommendation from that release onward is that new applications use it.

**Turbopack: beta.** And specifically the dev server. Production builds aren't
part of that claim.

**Server Actions: alpha.** Mutating data on the server without shipping client
JavaScript for it. I think it's the most interesting idea in the release, and
it is also the one explicitly labelled as not finished.

So "13.4 is stable" is true of the router and not of the two features most of
the excitement was about.

# The migration is not the folder

I assumed the work was moving files from `pages/` to `app/` and renaming a
couple of data functions. That's the visible part, and it's small.

What changes is the default. In `pages/`, a component is a client component,
and you opt into server work at the route level with `getStaticProps` or
`getServerSideProps`. In `app/`, a component is a Server Component, and you opt
*out* with `'use client'` at the top of a file.

Because of that inversion, every piece of code that touches `useState`,
`useEffect`, a context provider, an event handler, or the `window` object has to
end up on the client side of a boundary that you now have to place yourself. So
the work is walking the component tree and deciding where the line goes, then
doing it again for every dependency that assumed it would run in a browser.

For an application with a handful of routes and a lot of interactivity, that
is not an afternoon. It's fine to pay that for a better model, but it should be
priced as a project.

# The site in question

A content site. Markdown files on disk, parsed at build time, rendered into
static pages. `getStaticProps` reads the posts directory, the index page filters
by tag and search in the browser, and nothing at all is fetched at request time.

Set the App Router's strengths against that. Streaming and Suspense pay off
when part of a page is slow and you want the rest of it sooner, but nothing here
is slow, because everything was computed at build time. Nested layouts pay off
when chrome persists across navigation and you want to avoid re-rendering and
re-fetching it. This site has a header and a footer. Colocated data fetching
removes prop-drilling through page props (there are about four props).

Migrating would buy me a better architecture for problems this codebase doesn't
have. It would cost a weekend and a stack of client boundaries, and the
the output would be the same static HTML.

# What would change my mind

Three things, and I expect at least two of them.

The recommendation itself, over time. When new Next.js applications are built on
the App Router by default, the Pages Router stops being the router I know and
becomes the one I maintain. That gap only gets wider, and being fluent in the
model everyone else uses has some value whether or not this particular site
needs it.

Server Actions leaving alpha. This site has no mutations at all (the contact
page is a set of `mailto:` links), so that one is about the next thing I build,
not this site. A mutation that doesn't ship its own client bundle fits a lot of
small forms, but I am not putting an alpha under one.

Turbopack covering production builds. A faster dev server is pleasant, but it's
the build I wait for.

# The general rule I am taking away

A stable label tells you the maintainers are confident in their side of the
contract. It says nothing about whether the migration is cheap or whether you
need it.

The cost of moving is proportional to how much of your application assumed
"client by default". For a heavily interactive app that's most of it. For a
statically generated content site it's somehow most of it and none of it at the
same time, because almost nothing here is interactive in the first place.

I'll move this site when there is a feature I want that I can't have where I
am, and there isn't one today.
