← Back to the journal
Next.jsPerformanceWeb

Next.js 12: faster, thanks to Rust

Next.js 12 brings the SWC compiler and Middleware — how it speeds up my builds and moves logic closer to the edge.

Some updates change features, others change how the work feels. Next.js 12 belongs firmly to the second kind for me. The leap isn't a new button — it's under the hood, exactly where you sit waiting as a developer every single day.

Rust instead of Babel

The centerpiece is the move from Babel and Terser to SWC, a compiler written in Rust. It sounds like plumbing, but it's tangible: builds and hot reloads run noticeably faster, because transpiling and minifying no longer have to crawl through JavaScript-based tooling at the old pace.

Speed while building isn't a luxury. It's the difference between staying in flow and waiting.

For my work that means one thing above all: tighter loops. Saving a change and seeing the result almost instantly keeps the creative tension alive. The less I wait on the tooling, the more attention is left for the actual design.

Middleware: logic at the edge

The second big addition is Middleware. It lets me run code before a request finishes — at the edge, close to the user. One file, one middleware function, and I can redirect, rewrite, set headers, or steer requests depending on context.

That unlocks things that used to be awkward:

  • Localization by region or language, before the page even renders
  • A/B tests and feature flags without the flicker
  • Auth checks early in the lifecycle, instead of patching it in the client

The right measure still matters: middleware runs on every matching request, so only what truly needs to be lean and decided early belongs there. Heavy logic stays elsewhere.

Together, SWC and Middleware paint a coherent picture: Next.js 12 makes development faster and delivery smarter. It's precisely that pairing of speed and control that makes the platform feel right to me.