Menu
Next.js adds incremental static pages regeneration

Next.js adds incremental static pages regeneration

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

Credit: Dreamstime

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 include 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.

In addition, 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.

Furthermore, JavaScript bundles use content hashes instead of the build ID - which allows for pages that have not changed between deploys to stay in the browser cache without having to be downloaded again - while Fast Refresh, introduced in Next.js 9.4, has been refined to show more helpful application error messages.

Delving deeper, production React profiling is also available - 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, with the feature is labelled as experimental in documentation. Finally, beta support is offered for the Webpack 5 module bundler, which has improvements such as better tree-shaking and persistent caching.


Follow Us

Join the newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

Tags javascript

Events

Featured

Slideshows

Meet the Reseller News 30 Under 30 Tech Awards 2020 winners

Meet the Reseller News 30 Under 30 Tech Awards 2020 winners

This year’s Reseller News 30 Under 30 Tech Awards were held as an integral part of the first entirely virtual Emerging Leaders​ forum, an annual event dedicated to identifying, educating and showcasing the New Zealand technology market’s rising stars. The 30 Under 30 Tech Awards 2020 recognised the outstanding achievements and business excellence of 30 talented individuals​, across both young leaders and those just starting out. In this slideshow, Reseller News honours this year's winners and captures their thoughts about how their ideas of leadership have changed over time.​

Meet the Reseller News 30 Under 30 Tech Awards 2020 winners
Reseller News Exchange Auckland: Beyond the myths — how partners can master cloud security

Reseller News Exchange Auckland: Beyond the myths — how partners can master cloud security

This exclusive Reseller News Exchange event in Auckland explored the challenges facing the partner community on the cloud security frontier, as well as market trends, customer priorities and how the channel can capitalise on the opportunities available. In association with Arrow, Bitdefender, Exclusive Networks, Fortinet and Palo Alto Networks. Photos by Gino Demeer.

Reseller News Exchange Auckland: Beyond the myths — how partners can master cloud security
Reseller News welcomes industry figures at 2020 Hall of Fame lunch

Reseller News welcomes industry figures at 2020 Hall of Fame lunch

Reseller News welcomed 2019 inductees - Leanne Buer, Ross Jenkins and Terry Dunn - to the fourth running of the Reseller News Hall of Fame lunch, held at the French Cafe in Auckland. The inductees discussed the changing face of the IT channel ecosystem in New Zealand and what it means to be a Reseller News Hall of Fame inductee. Photos by Gino Demeer.

Reseller News welcomes industry figures at 2020 Hall of Fame lunch
Show Comments