OpenAINext.jsFeb 26, 2025, 8:00 PM

Next.js 15.2

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

openaienmodel: gpt-5-mini-2025-08-07

Next.js 15.2

Key Points

  • Redesigned error overlay and higher-fidelity stack traces
  • Streaming metadata: initial UI can render before generateMetadata completes
  • Turbopack: ~57% faster compiles and ~30% lower dev memory

Summary

Next.js 15.2 improves the developer experience with a redesigned error overlay and higher-fidelity stack traces, introduces streaming metadata so async generateMetadata doesn't block initial UI, and delivers notable Turbopack performance improvements. The release also adds experimental support for React View Transitions and a Node.js runtime option for Middleware.

Key Points

  • Redesigned error UI and stack traces

    • New error overlay highlights message, code frame, and call stack while reducing library noise.
    • Uses React owner stacks to surface the subcomponent responsible for errors and includes an in-overlay feedback control.
    • New dev indicator shows rendering mode, Turbopack compile status, and quick access to active errors.
  • Streaming metadata

    • generateMetadata can run async without delaying initial paint; browsers get initial UI before metadata finishes.
    • Bots/crawlers still receive full HTML by default; use the htmlLimitedBots option in next.config.js to customize behavior.
  • Turbopack performance

    • Early adopters report up to ~57% faster compile times versus 15.1 and ~30% reduced memory usage in dev for large apps.
    • Persistent caching and production build optimizations are in progress and being dogfooded.
  • Experimental features

    • React View Transitions (feature flag) to animate between views: enable via experimental.viewTransition.
    • Node.js Middleware runtime (experimental.nodeMiddleware) lets middleware run in Node.js; not recommended for production yet (requires canary).
  • Other notable changes

    • "use cache" moving toward beta, image quality support in next/image, API-only create-next-app flag, lint and error-reporting improvements.

Upgrade

  • Automated codemod:
npx @next/codemod@canary upgrade latest
  • Manual:
npm install next@latest react@latest react-dom@latest
  • New project:
npx create-next-app@latest

Quick config snippets

  • Enable View Transitions (experimental):
// next.config.js
module.exports = {
  experimental: { viewTransition: true },
}
  • Enable Node.js Middleware (experimental):
// next.config.js
module.exports = {
  experimental: { nodeMiddleware: true },
}
  • Example middleware runtime flag:
export const config = { runtime: 'nodejs' }

Notes for engineers

  • Experimental flags are not production-recommended; Node.js Middleware will error on the stable channel unless using next@canary.
  • Streaming metadata improves TTFP/first paint but preserves crawler behavior; adjust htmlLimitedBots for custom bot treatment.
  • If Turbopack is slower for your app, collect repro metrics and report them to help the team investigate.

Links

Refer to the release post and Next.js docs for detailed migration steps, examples, and edge-case guidance.

Full Translation

Translations

A translation section that keeps the flow of the original article.

openaijamodel: gpt-5-mini-2025-08-07

Next.js 15.2

Next.js 15.2 — 概要

Next.js 15.2 には、エラーのデバッグやメタデータ処理、Turbopack に関する更新などが含まれます。

主な更新点

  • エラーのデバッグと診断: 開発中のエラー特定と解析を支援する改善。
  • メタデータ: metadata / head 関連の取り扱いや挙動に関する更新。
  • Turbopack: ビルドやバンドルの安定性・パフォーマンス改善。
  • その他: パフォーマンス最適化やバグ修正などの追加改善。

公開日: 2025-02-26T20:00:00.000Z

詳細は公式のリリースノートを参照してください。