Model 12’s compiler additionally boosts pace for big codebases, and builders have improved observability into compiler efficiency. Underlying enhancements to the webpack module bundler optimize Quick Refresh and make on-demand entries extra dependable.
Builders can replace to Subsequent.js 12 by working:
npm i subsequent@newest
Different enhancements in Subsequent.js 12:
- The introduction of middleware capabilities permits builders to make use of code over configuration. Builders can run code earlier than a request is accomplished. Middleware can be utilized for something that shares logic for a set of pages, together with authentication, bot safety, redirects and rewrites, server-side analytics, and different features.
- With React 18 assist, options corresponding to Suspense, computerized batching of updates, and APIs like
startTransitionare supported beneath an experimental flag, as is a brand new streaming API for server rendering with assist for
- The built-in picture optimization API now helps AVIF photos, enabling 20% smaller photos in comparison with WebP. This characteristic now could be in an opt-in state.
- Net crawlers, or search bots, will routinely server-render ISR (Incremental Static Regeneration) pages utilizing
- With output file tracing, Subsequent.js routinely traces which information are wanted by every web page and API route.
- Quick Refresh now makes use of a WebSocket connection as an alternative of an EventSource connection.
Copyright © 2021 IDG Communications, Inc.