Advertisement
Subsequent.js 14, the newest model of Vercel’s React-based framework for internet growth, previews a compiler enchancment for dynamic content material.
Introduced October 26, Subsequent.js 14 presents an experimental preview of partial prerendering, a compiler optimization for dynamic content material that generates a quick preliminary static response. Partial prerendering builds on analysis and growth into server-side rendering, static-site technology, and incremental static revalidation. Builders don’t have to be taught new APIs to make use of partial prerendering.
Subsequent.js 14 additionally presents a secure implementation of Server Actions, for outlining asynchronous server capabilities to be known as instantly from elements, without having to manually create API endpoints. Beforehand in an alpha state, Server Actions are built-in into the App Router mannequin. Constructed on internet fundamentals equivalent to varieties and the FormData web API, Server Actions needs to be acquainted to builders who’ve used server-centric frameworks prior to now, based on Vercel. Mutating knowledge, re-rendering the web page, or redirecting can happen in a single community spherical journey, guaranteeing the right knowledge is displayed on the shopper even when the upstream supplier is gradual. Additionally, totally different actions could be composed and reused.
Subsequent.js builders have been working to enhance native growth efficiency in each the Pages and App Router since Subsequent.js 13. The Turbopack Rust-based bundler, optimized for JavaScript and TypeScript and Vercel’s successor to Webpack, is anticipated to maneuver to “secure” in an upcoming minor launch. Webpack will nonetheless be supported for ecosystem plugins and customized configurations.
Advertisement
Lastly, Subsequent.js 14 introduces some metadata enhancements. Earlier than internet web page content material could be streamed from the server, necessary metadata concerning the viewport, coloration scheme, and theme first should be despatched to the browser. Guaranteeing these meta
tags are despatched with preliminary web page content material helps clean the consumer expertise, stopping web page flickering. In Subsequent.js 14, blocking and non-blocking metadata have been decoupled. Solely a small set of metadata choices are blocking; the intent is to make sure non-blocking metadata is not going to forestall {a partially} pre-rendered web page from serving the static shell.
Predecessor Next.js 13 was launched a 12 months in the past, adopted by a number of level releases.
Advertisement
Copyright © 2023 IDG Communications, Inc.