OpenAINext.jsMay 11, 2020, 3:00 PM

Next.js 9.4

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 9.4 — Fast Refresh, ISR, built-in fetch, env

Key Points

  • Fast Refresh enabled by default
  • Incremental Static Regeneration (beta)
  • Built-in fetch polyfill for Node and browsers

Summary

Next.js 9.4 (2020-05-11) adds Fast Refresh by default, Incremental Static Regeneration (ISR, beta), built-in fetch for Node and browsers, .env support plus NEXT_PUBLIC_ prefix, Web Vitals reporting, absolute imports/aliases, configurable Sass options, and new CMS examples. These changes focus on developer experience, predictable static regeneration, and simpler configuration.

Key Points

  • Fast Refresh (default): reliable hot reloading that preserves component state, with a redesigned error overlay showing accurate locations and editor click-to-open.
  • Incremental Static Regeneration (beta): background re-generation of static pages via unstable_revalidate, serving static pages with no downtime and bounded re-generation concurrency.
  • Environment variables: automatic .env loading; prefix variables with NEXT_PUBLIC_ to inline them into the browser bundle (no next.config.js needed).
  • Built-in fetch polyfill: fetch() is available in both Node and browsers; remove server-side polyfills like node-fetch or isomorphic-unfetch.
  • Web Vitals: export reportWebVitals(metric) from pages/_app.js to forward Core Web Vitals to analytics.
  • Absolute imports & aliases: set baseUrl in jsconfig.json/tsconfig.json and use paths for custom aliases (e.g. @/design-system/*).
  • Configurable Sass: use sassOptions in next.config.js to set includePaths and other compiler options.
  • Extras: new CMS examples (Contentful, DatoCMS, Prismic, Sanity, TakeShape) and improved log output.

Upgrade notes

  • Fast Refresh is enabled automatically; verify hot-reload behavior in your app.
  • ISR is beta and uses unstable_revalidate; test re-generation logic and monitor failures.
  • Remove server-side fetch polyfills and rely on built-in fetch() in data fetching functions.
  • Move browser-exposed env vars to NEXT_PUBLIC_ and use .env files for local/production variables.

Full Translation

Translations

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

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

Next.js 9.4

Next.js 9.4

Next.js 9.4 は以下の新機能を導入しました:

  • React Fast Refresh — 開発時のホットリロード体験を改善する新しい React のリフレッシュ機能。
  • Incremental Static Regeneration — ページ単位で静的コンテンツのインクリメンタル再生成を可能にする仕組み。
  • New Environment Support — 環境変数や実行環境に関する新しいサポート。
  • Built-in Fetch — サーバー/クライアントで使える組み込みの fetch サポート。
  • その他多数

公開日: 2020-05-11T15:00:00.000Z