OpenAINext.jsMar 9, 2020, 6:50 PM

Next.js 9.3

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.3 — SSG & SSR APIs, Preview Mode, and Sass

Key Points

  • getStaticProps/getServerSideProps added
  • Preview Mode for CMS drafts
  • Built-in Sass and smaller runtime

Summary

Next.js 9.3 introduces first-class SSG and SSR data-fetching APIs (getStaticProps, getStaticPaths, getServerSideProps), Preview Mode for showing CMS drafts, built-in Sass support (global and CSS modules), automatic static 404 optimization, and a ~32KB smaller runtime. All changes are backwards compatible and can be adopted incrementally.

Upgrade: run npm i next@latest react@latest react-dom@latest.

Key Points

  • New data-fetching APIs

    • getStaticProps: fetch at build time (server-only; tree-shaken from client bundles). Use for CMS-driven or publicly cacheable pages that should be pre-rendered.
    • getStaticPaths: provide dynamic route paths to pre-render at build time; return fallback: false (unknown paths 404) or fallback: true (on-demand static generation with a loading state).
    • getServerSideProps: fetch on every request (SSR); runs server-side and is tree-shaken from the client.
  • Preview Mode

    • Lets you bypass static output to render draft content from a CMS for previewing without changing the published static files.
  • Styling & runtime

    • Built-in Sass support: import .scss for global styles and .module.scss for locally scoped CSS modules.
    • 404 now automatically served statically for faster, more reliable responses.
    • Runtime reduced by ~32KB for better baseline performance.
  • Other

    • Discussions moved to GitHub Discussions for community Q&A.
    • No breaking changes; getInitialProps remains supported but new APIs are recommended for new pages.

Full Translation

Translations

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

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

Next.js 9.3 の新機能

Next.js 9.3

Next.js 9.3 は、静的サイト生成の改善、SCSS のネイティブサポート、バンドルサイズの削減、静的な 404 ページなど、多くの新機能と改善を導入します。

主な変更点

  • 静的サイト生成の改善(static-site generation の強化)
  • SCSS のネイティブサポート(native support for SCSS)
  • バンドルサイズの削減(reduced bundle sizes)
  • 静的な 404 ページのサポート(static 404 pages)
  • その他の細かな改良と最適化

これらにより、パフォーマンスの向上や開発体験の改善が期待できます。