惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
腾讯CDC
S
Securelist
Know Your Adversary
Know Your Adversary
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 【当耐特】
V2EX - 技术
V2EX - 技术
J
Java Code Geeks
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Hugging Face - Blog
Hugging Face - Blog
Cisco Talos Blog
Cisco Talos Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
W
WeLiveSecurity
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
博客园 - Franky
S
Security Affairs
博客园 - 司徒正美
V
V2EX
K
Kaspersky official blog
T
Threatpost
NISL@THU
NISL@THU
博客园 - 叶小钗
Help Net Security
Help Net Security
PCI Perspectives
PCI Perspectives
IT之家
IT之家
小众软件
小众软件
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Last Week in AI
Last Week in AI
Jina AI
Jina AI
爱范儿
爱范儿
罗磊的独立博客
N
News and Events Feed by Topic
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
L
LINUX DO - 热门话题
Google Online Security Blog
Google Online Security Blog
雷峰网
雷峰网
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint

Next.js Blog

July 2026 Security Release Next.js Security Release and Our Next Patch Release Turbopack: What's New in Next.js 16.3 Next.js 16.3: AI Improvements Next.js 16.3: Instant Navigations Next.js Across Platforms: Adapters, OpenNext, and Our Commitments Next.js 16.2: AI Improvements Next.js 16.2 Turbopack: What's New in Next.js 16.2 Building Next.js for an agentic future Inside Turbopack: Building Faster by Building Less Next.js 16.1 Next.js Security Update: December 11, 2025 Security Advisory: CVE-2025-66478 Next.js 16 Next.js 16 (beta) Next.js 15.5 Next.js 15.4 Next.js 15.3 Building APIs with Next.js Next.js 15.2 Composable Caching with Next.js Next.js 15.1 Our Journey with Caching Next.js 15 Turbopack Dev is Now Stable Next.js 15 RC 2 Next.js 15 RC Next.js 14.2 Next.js 14.1 Next.js 14 How to Think About Security in Next.js Next.js 13.5 Next.js App Router Update Next.js 13.4 Next.js 13.3 Next.js 13.2 Next.js 13.1 Next.js 13 Next.js 12.3 Next.js 12.2 Layouts RFC Next.js 12.1 Next.js 12 Next.js 11.1 Next.js 11 Next.js 10.2 Next.js 10.1 Incrementally Adopting Next.js Next.js 10 Next.js 9.5 Next.js 9.4 Next.js 9.3 Next.js 9.2 Next.js 9.1.7 Introducing Create Next App Next.js 9.1 Next.js 9.0.7 Next.js 9 Next.js 8.1 Next.js 8.0.4 Styling Next.js with Styled JSX Next.js 8 Webpack Memory Improvements Next.js 8 Next.js 7 Next.js 6.1 Next.js 6 and Nextjs.org Next.js 5: Universal Webpack, CSS Imports, Plugins and Zones
Next.js 5.1: Faster Page Resolution, Environment Config & More
Arunoda Susiripala, Tim Neutkens · 2018-03-27 · via Next.js Blog

We are happy to introduce Next.js 5.1, which features support for environment configuration, phases, source maps, and new Next.js plugins.

Major performance improvements are introduced: resolving pages is 102x faster, and error pages are loaded more efficiently.

To upgrade or install, run:

In addition to bumping Next.js, we upgrade the peer dependencies react and react-dom

Be sure to upgrade next-plugins like @zeit/next-css, @zeit/next-sass, @zeit/next-less or @zeit/next-typescript as well.

Faster page resolution

Thanks to the architectural changes in Next.js 5.0, we were able to simplify the logic that resolves pages based on url path. These changes were based on research from @oliviertassinari. Previously resolving a page took an average of 2.347ms. With the new logic resolving the same page takes on average 0.023ms. That's a 102x speedup for one of the most commonly invoked methods in Next.js applications.

Page resolution shown per request. Left is Next.js 5.0, right is Next.js 5.1
Page resolution shown per request. Left is Next.js 5.0, right is Next.js 5.1

Environment configuration

Typical Node.js environments often depend on passing environment variables to the application, for example: API_URL=https://api.vercel.com node index.js and then you can use API_URL anywhere in your application using process.env.API_URL.

With universal rendering process.env is not available on the client side. So with Next 5.1 we're introducing a new feature: publicRuntimeConfig and serverRuntimeConfig. These can be set in next.config.js and will then be available using the next/config module.

Both serverRuntimeConfig and publicRuntimeConfig are defined in next.config.js

The getConfig method from the next/config module is used to get configuration values

Improved Error Handling

Previously Next.js had a special error handling mechanism for detecting server errors when loading page bundles. A page bundle is the javascript file that is loaded on the client side to load the page, for example /_next/-/page/index.js.

If there were an error, like a build ID mismatch, the page bundle would still be served with a 200 HTTP status, but the contents would be a JSON representation of an error generated by the Next.js server. The reason for this is that there was client side error handling that depended on more than just the page being a 404. This solution worked really well, until you try to upload assets to a static file host or CDN that doesn't support a fallback.

With Next.js 5.1 we've completely refactored the error handling logic, when a page bundle returns a 404 HTTP status the router will automatically detect it and reload the page, to make sure navigation between multi-zones is possible.

In rewriting this logic, we removed the Router.onAppUpdated hook; which was mainly used to trigger a page reload. Now the page will be automatically reloaded

In addition to this, we've added a new set of integration tests on error recovery in the development mode, to avoid regressions on error recovery in future releases.

Phases / config function

Some next-plugins like @zeit/next-css are only required when Next.js is in development mode or when running next build.

You can now export a function that returns the configuration object instead of immediately exporting the object.

next.config.js exporting a function that returns the user configuration

Exporting a function will give you access to the phase in which Next.js is running, for example development, production, building, export. This allows plugins to be loaded only when needed, but also gives access to the default configuration.

We've introduced a new module called next/constants holding commonly used constants, including phases.

A next.config.js that checks for the development phase

Improved production source map generation

With the introduction of universal webpack in Next.js 5 adding source maps to your production environment became as simple as adding a few lines to next.config.js:

Manually enable source maps in next.config.js

@zeit/next-source-maps can be added to a project to automatically enable production source maps for you, add the following to next.config.js:

Using @zeit/next-source-maps to enable source maps in next.config.js

This enabled outputting of source maps for all but one file, app.js, the reason for this was that app.js consisted of multiple files (manifest.js and commons.js) combined with a webpack plugin. A side effect of this was that webpack couldn't generate source maps for the combined file.

Thanks to a pull request from @ptomasroos the app.js file was replaced by main.js. This file will hold the code that was previously compiled to manifest.js and commons.js and webpack will generate a source map for main.js. Source maps will be automatically served, allowing external error tracking tools to show the actual file an line number when errors are detected.

The source code is shown in the sources panel
The source code is shown in the sources panel

New plugins / improvements to existing ones

We've introduced two new official plugins. @zeit/next-bundle-analyzer allows for easily setting up webpack-bundle-analyzer to analyze the server side and client side bundles separately.

Additionally there were a lot of improvements to the official css, less, and sass plugins regarding hot reloading and bundling. For example there is no longer a flash of unstyled content in development mode. And styles in subcomponents get picked up as well.

You can now find the Next.js community on GitHub. Recently a list of notable companies using Next.js was posted there. Feel free to post projects in the thread.

Thank you

We would like to thank everyone who has contributed to Next.js for this release. Whether it's contributing to the core or expanding and improving our ever growing examples directory.

If you are looking to start contributing to Next.js you can find issues with the good first issue or help wanted label.

A special thank you to Trulia for their valuable feedback related to environment configuration and the new error page handling.