Next.js is the React framework for production. Next.js provides zero-configuration automatic code splitting, filesystem based routing, hot code reloading and universal rendering.
Hello, Product Hunt! 👋🏻
We are proud today to introduce the production-ready Next.js 8, featuring:
- Serverless Next.js
- Massive build-time memory usage reduction
- Build-time environment configuration
- Prefetch performance improvements
- Smaller initial HTML size
- Improved on-demand entries
- Faster port listening in development
- Faster Static Export
- Head element deduplication
- New crossOrigin config option
- Removed inline Javascript
- Example of API Authentication
As always, we have strived to ensure all these benefits are completely backwards compatible. For most Next.js applications, all you need to do is run:
`npm i next@latest react@latest react-dom@latest`
We are thankful to our community and everyone who has bet on our success. Since our last blog post, we have seen companies like AT&T, Starbucks and Twitch relaunch their public-facing websites and apps with Next.js.
Serverless Next.js
You can now enable serverless mode in Next.js config, that will give you:
- Low-level API for implementing serverless deployment
- Every page in the pages directory becomes a serverless function (lambda)
- Creates the smallest possible serverless function (50Kb base zip size)
- Optimized for fast cold start of the function
- The serverless function has 0 dependencies (they are included in the function bundle)
- And more!Massive memory usage reduction
We have contributed to webpack to improve Next.js's (and the rest of the webpack ecosystem's!) build performance and resource utilization. As a result, we were able to achieve up to 16 times better memory usage with no degradation in performance.
Build-time configuration
With Next.js 8 we are introducing a new key to `next.config.js` named `env` to provide configuration values to the application.
Prefetch performance improvements
In Next.js 8 prefetch uses a link tag with `rel="preload"` instead of a script tag. It also only starts prefetching after `onload` to allow the browser to manage resources.
DX Improvements
- Improved on-demand entries
- Faster port listening in development
- Faster Static Export
- Head element deduplication
To get a more in-depth look at all the new features, check our our blog post.
Also feel free to join us on Spectrum. Next.js community has over 4,570 members!
Next.js