Essential Next.js plugin version 4 has been released

Hello!

I’m pleased to share that version 4.0.0 of the Essential Next.js plugin has now been released. Huge thanks to everybody who has helped with beta testing over the past month. There have been an incredible 275 comments in the beta discussion topic.

If you haven’t checked out the beta, you’re in for a treat, as version 4 is packed full of new features. It’s a complete rewrite, with a new architecture that is more stable, faster to build and deploy, and with full support for loads more Next.js features. Thanks to everyone who helped test all of these!

We also have one extra special added feature that wasn’t in the beta: full support for ISR! This has been the number one feature request since the first days of Next on Netlify, and we’re super excited to be able to share this with you. This is available because of the new support for time to live (TTL) in Netlify On Demand Builders, and is a great addition for large sites in particular.

Here is a run-down of the main new features in version 4:

  • Full support for incremental static regeneration (ISR).

  • Full support for Next.js rewrites, redirects and headers.

  • Beta support for Next 12 Middleware

  • Faster builds and deploys. Instead of generating one function per route, there are just three functions per site and a much smaller list of rewrites.

  • Full support for Netlify’s new persistent On-Demand Builders. Return fallback: "blocking" from getStaticPaths and your rendering will be deferred until the first page load, then persisted globally.

  • A new image server for next/image, built on Nuxt’s ipx. This is a high-performance, framework-agnostic image server based on sharp. This implementation uses On-Demand Builders to persist transformed images globally. Improved source image caching reduces time to first byte for new transforms.

  • Simplified configuration. You no longer need to set any Netlify-specific configuration options. For example, in a monorepo all you need to do is set publish to point to your .next directory and you can build the site in any way you like.

  • Removes requirement for the target to be set to serverless, which is deprecated in Next 12.

  • Bundling now uses Next.js’s own Node File Trace, giving more predictable results and smaller uploads.

New Next.js sites will have this version installed today. Because this is a major version bump, existing sites won’t be upgraded automatically, but you can click the button on your dashboard to update it. You can also install it from npm:

npm add -D @netlify/plugin-nextjs@latest

There is one configuration change that you need to make, which is to change the publish directory from out to .next. You can do this in the Netlify UI or in netlify.toml:


[build]

publish = ".next"

You can also remove most special configuration that you might have added, as it should now all work out of the box. For more information, see the release notes.

If you have feedback, please open an issue or start a discussion in the plugin repo

2 Likes

I’m hit with a timeout whenever I try to open a ISR page. It also has a very long delay in the beginning, indicating that it is SSR and not using the build time pre-render pages as intermediary while in the background refreshing.

Is there a way to increase the timeout threshold ? 10s is very little. If it’s a bandwidth related choice, why not tie it to the revalidation interval. So that some can revalidate longer tasks less frequent and have the same demand as some with high frequency short revalidations? :thinking:

Please don’t post the same issue on multiple threads @gzi.

Please continue this discussion on the on thread you opened