BitlystBitlyst
PostsNewsSeriesTopicsAbout

Bitlyst

Short, diagram-first posts on JavaScript, React & Next.js. Follow via RSS or the newsletter.

© 2026 Mohsen Fallahnejad

PostsSeriesTopicsLinksAboutSync devicesRSSllms.txtGitHubX
News/Next.js 16.5 adds Go Route Handlers (route.go)
NewsDec 2, 2026·4 min read

Next.js 16.5 adds Go Route Handlers (route.go)

Next.js is breaking its ten-year 'one language, one runtime' rule. You can now drop a route.go file into app/ alongside your TypeScript routes — plus faster Turbopack builds and cross-deployment caching.

Sources:Next.js 16.5↗Native Languages in Next.js↗

For a decade, Next.js had one simple rule: one language, one runtime. Your UI, API routes, and server logic all lived in TypeScript on Node.js.

Next.js 16.5 starts changing that. You can now drop a route.go file anywhere inside app/ right next to your route.ts files — and Turbopack compiles it into a native Go binary for you.

What route.go looks like#

Turn on experimental.goRoutes in next.config.ts (requires Turbopack and Go 1.24+):

ts
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  experimental: {
    goRoutes: true,
  },
};

export default nextConfig;

Then add app/api/hello/route.go using Go's standard net/http — no extra framework needed:

go
package route

import (
  "encoding/json"
  "net/http"
)

func GET(w http.ResponseWriter, r *http.Request) {
  w.Header().Set("Content-Type", "application/json")
  json.NewEncoder(w).Encode(map[string]string{"message": "Hello from Go!"})
}

It mirrors route.ts conventions: export GET, POST, PUT, PATCH, DELETE, read dynamic segments with r.PathValue("id"), stream with http.Flusher, and set const MaxDuration = 30.

In next dev, Turbopack watches your .go files and recompiles only the route you edited. In next build, Next.js compiles all route.go handlers into a single static binary — so production doesn't even need Go installed.

Why it matters for software engineering#

For years, using a second language on the backend meant a painful tradeoff: spin up a separate microservice, maintain a second repo and CI pipeline, wire up routing, and deal with deployment overhead. So most teams kept everything in TypeScript on Node.js — even the one or two endpoints that really didn't belong there.

route.go changes that architecture decision. You can now pick the right language for a single hot route without splitting your app into microservices. And with AI coding agents making it much easier to write and maintain idiomatic Go alongside TypeScript, the old "context-switching tax" is shrinking fast.

Server efficiency and real-world cost#

Node.js is great for React rendering and everyday I/O, but under heavy CPU work or high concurrency, a single-threaded JS runtime pays a real tax in memory, garbage collection, and CPU time.

Go compiles to a small static binary with a lightweight concurrency model (goroutines) and a fast networking stack. In the Next.js team's benchmarks, the difference is hard to ignore:

  • route.go vs route.ts: Across 200 requests on a production workload, active CPU time dropped from 23.4s to 4.5s (81% less CPU, over 5× lower).
  • Rewriting next start in Go: Passing next start --experimental-new-server runs a new Go-based production server that owns the public port and invokes route.go directly without hopping through Node.js — lifting throughput from 5,956 to 25,818 req/s (4.3× higher) and cutting p99 latency by 59%.

On modern cloud and serverless pricing — where you pay for active CPU, memory, or container count — running hot paths (webhooks, streaming proxies, data pipelines) in compiled native code directly means lower server bills and steadier tail latency. Rust is also on the roadmap after Go.

Why Go is worth learning as a frontend developer#

Even if you identify as a frontend engineer, Go is quietly becoming part of your daily stack:

  • esbuild is written in Go.
  • TypeScript 7's native compiler is being ported to Go.
  • Now Next.js itself is adding route.go and rewriting next start in Go.

TypeScript isn't going anywhere for UI and product code, and you don't need to become a systems engineer overnight. But learning Go's basics — especially net/http, structs, and error handling — is quickly turning from a "nice to have" into a practical advantage for frontend and full-stack developers.

What else shipped in Next.js 16.5#

Even if you never touch Go, 16.5 has solid day-to-day upgrades:

  • ~4.2× faster cold Turbopack builds (and 38% less memory, 14% smaller disk cache on Vercel's dashboard benchmark).
  • Cross-deployment caching for 'use cache: remote': Unchanged cached functions now reuse entries from previous deployments instead of starting cold on every deploy.
  • next build --analyze: Generate a bundle report directly from your production build without a second compilation.
  • Automatic Turbopack cache GC: Enabled by default so .next stops growing forever during long dev sessions.
  • Per-link prefetch="navigation": Override await navigation() on high-probability links (like a "Next unread" button) so they prefetch full cached content.
  • next upgrade --ci: Sets up a scheduled GitHub Actions workflow where a coding agent opens upgrade PRs automatically.
  • Safe mode for next/image (experimental.imgOptSafeMode): Sandboxed, memory-safe image decoding for untrusted images.

Should you use route.go today?#

Not in production yet — it's experimental and comes with real constraints:

  • Requires Turbopack (no Webpack) and Go 1.24+.
  • Go routes are dynamic only — no ISR, generateStaticParams, or output: 'export'.
  • React rendering, Server Actions, and route.ts still run on Node.js.

The takeaway: Worth trying in a side project or for a single hot API route, and a big signal of where Next.js is headed — a polyglot full-stack framework where the runtime isn't locked to Node.js anymore.

← Back to all news

Get new posts in your inbox

One email when a new post is out: short, diagram-first explanations of JavaScript, React and Next.js. No spam, unsubscribe any time.