From 72e9d4e80c5148996956d6a51e4f5bff9473f1d7 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Tue, 26 Oct 2021 15:13:16 +0100 Subject: [PATCH] chore: add v4 release notes --- README.md | 3 +++ docs/large-functions.md | 6 ++++-- docs/release-notes/v4.md | 30 ++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 docs/release-notes/v4.md diff --git a/README.md b/README.md index d75a8b8858..e1b24ed6c6 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@

+## What's new in this version + +Version 4 is a complete rewrite of the Essential Next.js plugin. For full details of everything that's new, see [the v4 release notes](https://github.com/netlify/netlify-plugin-nextjs/blob/main/docs/release-notes/v4.md) ## Installing the beta diff --git a/docs/large-functions.md b/docs/large-functions.md index c4e95b8966..9b660591c1 100644 --- a/docs/large-functions.md +++ b/docs/large-functions.md @@ -10,7 +10,9 @@ There are two possible causes for this, each with its own solution. The list of [functions] excluded_files = "node_modules/electron/**/*" ``` - If you do need large modules (e.g. if you are running Puppeteer in a Next API route), consider changing to a Netlify function. + If you do need large modules (e.g. if you are running Puppeteer in a Next API route), consider changing to a Netlify function which will have less overhead than the equivalent Next.js function. - **Large numbers of pre-rendered pages** -If you have a very large number of pre-rendered pages, these can take up a lot of space in the function. There are two approaches to fixing this. One is to consider deferring the building of the pages. If you set `fallback = "blocking"`, the rendering will be deferred until the first user requests the page. This is a good choice for low-traffic pages. It reduces build and deploy time, and can make your bundle a lot smaller. The other option is to enable an experimental feature that moves static files out of the function bundle. To do this, set the environment variable `EXPERIMENTAL_MOVE_STATIC_PAGES` to true. + If you have a very large number of pre-rendered pages, these can take up a lot of space in the function. There are two approaches to fixing this. One is to consider deferring the building of the pages. If you return `fallback: "blocking"` from `getStaticPaths` the rendering will be deferred until the first user requests the page. This is a good choice for low-traffic pages. It reduces build and deploy time, and can make your bundle a lot smaller. + + The other option is to enable an experimental feature that moves static files out of the function bundle. To do this, set the environment variable `EXPERIMENTAL_MOVE_STATIC_PAGES` to true. diff --git a/docs/release-notes/v4.md b/docs/release-notes/v4.md new file mode 100644 index 0000000000..12bff5c91e --- /dev/null +++ b/docs/release-notes/v4.md @@ -0,0 +1,30 @@ +# Essential Next.js plugin v4 release notes + +This is a full rewrite of the Essential Next.js plugin, with a new architecture that gives greater compatibility and stability. + +## What's new + +- Full support for Next.js rewrites, redirects and headers. +- Removes requirement for the `target` to be set to `serverless`, which is deprecated in Next 12. +- 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. +- Bundling now uses Next.js's own node-file-trace, giving more predictable results and smaller uploads. +- Full support for Netlify's new [persistent On-Demand Builders](https://ntl.fyi/odb). Return `fallback: "blocking"` from `getStaticPaths` and your rendering will be deferred until the first page load, then persisted globally. +- A new image server, built on Nuxt's [ipx](https://github.com/unjs/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. + +## Installing the beta + +If you would like to try the beta, you should install it manually like this: + +- Install the module: +```shell +npm install -D @netlify/plugin-nextjs@beta +``` +- Change the `publish` directory to `.next` and add the plugin to `netlify.toml` if not already installed: +```toml +[build] +publish = ".next" + +[[plugins]] +package = "@netlify/plugin-nextjs" +```