!!! This is a SiteProxy proxied website, do not enter your personal information. Refer to: https://github.com/netptop/siteproxy for details !!!ร—
Paul Krill
Editor at Large

Next.js adds incremental static pages regeneration

news
Jul 27, 20202 mins

New mechanism for page updates in Next.js 9.5 promises to eliminate latency spikes and prevent pages from ever going offline

software automation gears robotic code by mazimusnd getty and bill oxford via unsplash 2400x1600
Credit: mazimusnd / Getty Images / Bill Oxford; Modified by IDG Comm

Next.js, a framework for building applications that leverage the React JavaScript UI library, is getting a refresh. Next.js 9.5 adds capabilities including incremental static regeneration and rewrites/redirects support.

Incremental static regeneration updates pages by re-rendering them in the background as traffic flows in. Traffic is served uninterrupted, statically, with the newly built page pushed only after it is done generating. Benefits include no spikes in latency and pages never going offline.

Support for rewrites aids in incremental adoption of Next.js, allowing developers to make an incoming request with a different destination path, including external URLs. Support for redirects, which are used in situations such as changing the structure of application routes, takes the form of a list of redirects in next.config.js under the redirects key.

Developed by edge network provider Vercel, open source Next.js is intended as an enterprise-level tool for purposes including building static websites, pre-rendered apps and mobile web apps.

Other new features and improvements in Next.js 9.5:

  • A basePath configuration option enables easy hosting of a Next.js application on a subpath of a ___domain. Developers may want to host an application under a subpath such as /docs so the application only covers that subsection of a ___domain.
  • A trailingSlash option is offered as part of next.config.js. When this option is set to true, Next.js will automatically add a trailing slash to URLs.
  • JavaScript bundles use content hashes instead of the build ID. This allows for pages that have not changed between deploys to stay in the browser cache without having to be downloaded again.
  • Fast Refresh, introduced in Next.js 9.4, has been refined to show more helpful application error messages.
  • Production React profiling. A previously introduced Profiler API enabled tracking of performance issues in React components, but required a separate version of ReactDOM to be used to profile in production. With Next.js 9.5, developers can automatically set up correct aliases for react-dom and scheduler modules.
  • Optional catch-all dynamic routes provide more flexibility and choice in application routing needs. The feature is labeled as experimental in documentation.
  • Beta support is offered for the Webpack 5 module bundler, which has improvements such as better tree-shaking and persistent caching.
Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorldโ€™s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorldโ€™s audience of software developers and other information technology professionals. Paul has won a โ€œBest Technology News Coverageโ€ award from IDG.

More from this author