5.1.0

Latest release in branch 5
Released 8 years ago (March 26, 2018)

Software Next.js
Branch 5
Status
End of life
First official release version 5.0.0
First official release date 8 years ago (February 05, 2018)
Requirement Node.js 6+
Release notes https://nextjs.org/blog/next-5
Source code https://github.com/vercel/next.js/tree/5.1.0
Download https://www.npmjs.com/package/next/v/5.1.0
Next.js 5 Releases View full list

What Is New in Next.js 5

Next.js 5 focuses on foundational upgrades for performance and developer experience. The core changes revolve around a faster, more reliable compiler and bundler, alongside improvements to core features like client-side navigation and static optimization.

Category Key Changes
Core & Performance Upgraded to Webpack 4, Babel 7, improved next/link and next/router prefetching.
Developer Experience Faster hot reloading, clearer error messages, and a more detailed build output.
Static Export & Optimization Enhanced next export and fixes for static page handling.
Bug Fixes & Polish Numerous fixes for CSS-in-JS, dynamic imports, API routes, and overall stability.

How does Next.js 5 improve build speed and performance?

The jump to Webpack 4 and Babel 7 is the headline act for performance. In practice, this translates to significantly faster build and compilation times. The updated toolchain also enables better tree-shaking and modern JavaScript optimizations out of the box.

Client-side navigation gets smarter with improved prefetching for next/link. The router now more efficiently loads pages in the background, making page transitions feel instantaneous. This matters because it directly improves the perceived performance of your application for end-users.

What are the developer experience upgrades in this release?

Development feedback loops are tighter. Hot Module Replacement is more reliable and faster, so your changes reflect in the browser almost instantly. When errors do occur, you get clearer, more actionable messages that point directly to the issue in your source code.

The build process now gives you a detailed breakdown, including page sizes. Seeing the size of each first-load page helps you spot optimization opportunities early. It's a small change that encourages performance-aware development from the start of a project.

Are there changes for static site generation (next export)?

Yes, static export gets important refinements. The next export command is more robust, with fixes for scenarios involving dynamically routed pages and custom _error.js pages. This makes generating a fully static site a smoother process.

Handling of static optimization for pages without getInitialProps is also polished. These pages are now automatically rendered as static HTML more reliably, ensuring you get the fastest possible page loads without extra configuration.

FAQ

Is upgrading to Webpack 4 and Babel 7 in Next.js 5 automatic?
Yes, the upgrade is seamless for most projects. Next.js 5 includes these updates internally. You should check your custom .babelrc or Webpack configurations for compatibility, as some plugin APIs may have changed.

Does the improved prefetching work with all uses of next/link?
The enhancements apply to default prefetching behavior. For links that use prefetch={false} or are outside the viewport initially, the behavior remains unchanged. The update optimizes the timing and priority of prefetch requests for visible links.

Will my CSS-in-JS library break with this update?
It's unlikely. This release includes specific fixes for CSS-in-JS interoperability, especially for libraries that inject styles during server-side rendering. If you were using workarounds, you might be able to remove them. Test your styles after upgrading.

What should I do if I see a build error after upgrading?
First, check the new, more detailed error output. The message often includes the file and line number. Common issues relate to deprecated Babel 6 plugins or Webpack 3 configuration in a custom next.config.js. Update or remove outdated dependencies.

Are there any breaking changes for API Routes or dynamic imports?
No major breaking changes for these features. The release includes bug fixes that make them more stable. For example, dynamic imports within components are now handled more consistently during both server and client rendering.

Releases In Branch 5

Version Release date
5.1.0 8 years ago
(March 26, 2018)
5.0.0 8 years ago
(February 05, 2018)
5.0.0-universal-alpha.22 8 years ago
(February 03, 2018)
5.0.0-universal-alpha.23 8 years ago
(February 03, 2018)
5.0.0-universal-alpha.21 8 years ago
(February 02, 2018)
5.0.0-universal-alpha.18 8 years ago
(February 01, 2018)
5.0.0-universal-alpha.19 8 years ago
(February 01, 2018)
5.0.0-universal-alpha.20 8 years ago
(February 01, 2018)
5.0.0-universal-alpha.17 8 years ago
(January 31, 2018)
5.0.0-universal-alpha.15 8 years ago
(January 30, 2018)
5.0.0-universal-alpha.16 8 years ago
(January 30, 2018)
5.0.0-universal-alpha.12 8 years ago
(January 29, 2018)
5.0.0-universal-alpha.13 8 years ago
(January 29, 2018)
5.0.0-universal-alpha.14 8 years ago
(January 29, 2018)
5.0.0-universal-alpha.11 8 years ago
(January 20, 2018)
5.0.0-universal-alpha.6 8 years ago
(January 19, 2018)
5.0.0-universal-alpha.7 8 years ago
(January 19, 2018)
5.0.0-universal-alpha.8 8 years ago
(January 19, 2018)
5.0.0-universal-alpha.9 8 years ago
(January 19, 2018)
5.0.0-universal-alpha.10 8 years ago
(January 19, 2018)
5.0.0-universal-alpha.5 8 years ago
(January 15, 2018)
5.0.0-universal-alpha.3 8 years ago
(January 13, 2018)
5.0.0-universal-alpha.4 8 years ago
(January 13, 2018)
5.0.0-universal-alpha.1 8 years ago
(January 11, 2018)
5.0.0-universal-alpha.2 8 years ago
(January 11, 2018)
5.0.0-zones.1 8 years ago
(November 27, 2017)