
























We are excited to introduce Next.js 10.2, featuring:
next dev.Update today by running npm i next@latest.
With Next.js 10.1, we improved Fast Refresh and decreased installation times. We're excited to share additional performance improvements enabled through webpack 5.
Today, we're expanding the rollout of webpack 5 to Next.js applications. Starting from Next.js 10.2, all applications that do not use a custom webpack configuration in their next.config.js will automatically use webpack 5.
When webpack 5 is enabled, you'll automatically get new features and improvements like:
next build runs. Only changed files will be recompiled, leading to increased performance. Vercel customer Scale observed a 63% speedup on subsequent builds.next build runs is now deterministic, improving browser caching of JavaScript assets in production. Hashes are kept the same when the content of a page does not change.export * tracks more information and no longer flags the default export as used. Inner-module tree-shaking is also enabled, allowing for imports that are only used in an unused export to be tree shaken.We've worked hard to ensure a smooth transition from webpack 4 to 5. The Next.js core test suite with over 3,400 integration tests runs on every pull request with webpack 5 support enabled.
If your application has a custom webpack configuration, we recommend following the documentation to enable webpack 5. After upgrading to webpack 5 in Next.js, please share any feedback with us.
We've improved the Next.js CLI initialization making boot time for next dev up to 24% faster after the first run. For example, next dev for vercel.com went from 3.3s to 2.5s.
We're on a mission to make your local development experience real-time (20x faster). Stay tuned for additional startup performance improvements in upcoming releases.
Route changes are now announced to screen readers and other assistive technology by default.
The example below shows the heading "Real Data. Real Performance" being announced by macOS VoiceOver on client-side navigation. The page name is found by first looking for an <h1> element, falling back to document.title, and lastly to the pathname.
Thank you to Kyle Boss and Kitty Giraudel for helping land this feature.
Next.js rewrites, redirects, and headers now support a new has property allowing you to match against incoming headers, cookies, and query strings.
Vercel customer Joyn uses has to optimize content for both discoverability and performance. For example, you could redirect old browsers based on the User-Agent:
Another example could be redirecting users based on their location:
Finally, you could redirect if a user is already logged in:
To learn more and explore additional examples, check out the redirects documentation.
82% of web pages for desktop use web fonts. Custom fonts are important for the branding, design, and cross-browser/device consistency of your site. However, using a web font should not come at the cost of performance.
Next.js now supports Automatic Webfont Optimization when using web fonts. By default, Next.js will automatically inline font CSS at build time, eliminating an extra round trip to fetch font declarations. This results in improvements to First Contentful Paint (FCP) and Largest Contentful Paint (LCP). For example:
Automatic Webfont Optimization currently supports Google Fonts and we're working to expand support further to other font providers. We're also planning to add control over loading strategies and font-display values. By optimizing fonts by default, we're able to help developers ship faster websites and improve their Core Web Vitals without any additional effort.
Thank you our partners at Google and Janicklas Ralph for helping land this feature.
We're excited to announce Tobias Koppers, the author of webpack, has joined the Next.js team at Vercel.
We are thankful to our community, including all the external feedback and contributions that helped shape this release.
This release was brought to you by the contributions of: @rpxs, @lemarier, @RayhanADev, @janicklas-ralph, @devknoll, @felipeptcho, @rishabhpoddar, @sokra, @m-leon, @turadg, @PierreBerger, @divmain, @dominikwilkowski, @pranavp10, @ijjk, @santidalmasso, @HaNdTriX, @jamesgeorge007, @garmeeh, @leerob, @shuding, @feute, @timneutkens, @alexvilchis, @Timer, @malixsys, @sahilrajput03, @marcvangend, @steven-tey, @julienben, @umarsenpai, @Mzaien, @merceyz, @AntelaBrais, @SystemDisc, @M1ck0, @jbmoelker, @jaisharx, @amannn, @vkarpov15, @gaelhameon, @4ortytwo, @Simply007, @styxlab, @xCloudzx, @wodCZ, @emmanuelgautier, @leosuncin, @ludder, @geritol, @vassbence, @vvo, @portenez, @arshad, @tarunama, @flybayer, @Hanaffi, @SokratisVidros, @chibicode, @kylemarshall18, and @jarrodwatts.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。