From a5e09ab1e8270684fd1cb77d2ece7b7f0715af59 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Wed, 8 Dec 2021 09:42:46 +0000 Subject: [PATCH 1/4] chore: remove beta warning --- src/helpers/verification.js | 10 ---------- src/index.js | 5 ----- 2 files changed, 15 deletions(-) diff --git a/src/helpers/verification.js b/src/helpers/verification.js index d89aabf428..05150a5760 100644 --- a/src/helpers/verification.js +++ b/src/helpers/verification.js @@ -110,13 +110,3 @@ exports.checkZipSize = async (file, maxSize = LAMBDA_MAX_SIZE) => { greenBright`\n\nFor more information on fixing this, see ${blueBright`https://ntl.fyi/large-next-functions`}`, ) } - -exports.logBetaMessage = () => - console.log( - greenBright( - outdent` - Thank you for trying the Essential Next.js beta plugin. - Please share feedback (both good and bad) at ${blueBright`https://ntl.fyi/next-beta-feedback`} - `, - ), - ) diff --git a/src/index.js b/src/index.js index 115a4196f9..b7bb8c9808 100644 --- a/src/index.js +++ b/src/index.js @@ -10,7 +10,6 @@ const { verifyNetlifyBuildVersion, checkNextSiteHasBuilt, checkForRootPublish, - logBetaMessage, checkZipSize, checkForOldFunctions, } = require('./helpers/verification') @@ -25,7 +24,6 @@ module.exports = { cache, }, }) { - logBetaMessage() const { publish } = netlifyConfig.build checkForRootPublish({ publish, failBuild }) verifyNetlifyBuildVersion({ failBuild, ...constants }) @@ -89,7 +87,4 @@ module.exports = { const { basePath } = await getNextConfig({ publish: netlifyConfig.build.publish, failBuild }) await unpatchNextFiles(basePath) }, - onEnd() { - logBetaMessage() - }, } From 9a354354c9e7b611455d9994b5f19af0cd85c127 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Wed, 8 Dec 2021 09:43:01 +0000 Subject: [PATCH 2/4] chore: update readme for GA --- README.md | 57 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 10d4189b48..38725c9a46 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@ -![Next.js on Netlify Build Plugin](next-on-netlify.png) +![Essential Next.js Build Plugin](next-on-netlify.png) -# Essential Next.js Build Plugin (beta) - -:warning: This is the beta version of the Essential Next.js plugin. For the stable version, refer to -[Essential Next.js plugin v3](https://github.com/netlify/netlify-plugin-nextjs/tree/v3#readme) :warning: +# Essential Next.js Build Plugin

@@ -19,36 +16,46 @@ Version 4 is a complete rewrite of the Essential Next.js plugin. For full details of everything that's new, check out [the v4 release notes](https://github.com/netlify/netlify-plugin-nextjs/blob/main/docs/release-notes/v4.md) -## Installing the beta +## Installing the plugin + +The plugin should be installed automatically for new Next.js sites on Netlify. You can also install it manually like +this: - Install the module: ```shell -npm install -D @netlify/plugin-nextjs@beta +npm install -D @netlify/plugin-nextjs ``` -- Change the `publish` directory to `.next` and add the plugin to `netlify.toml` if not already installed: +...then add it to your `netlify.toml` file: ```toml -[build] -publish = ".next" - [[plugins]] package = "@netlify/plugin-nextjs" ``` -If you previously set a custom `distDir` in your `next.config.js`, or set `node_bundler` or `external_node_modules` in -your `netlify.toml` these are no longer needed and can be removed. +## Migrating from an older version of the plugin + +You can manually upgrade from the previous version of the plugin by running the following command: + +```shell +npm install -D @netlify/plugin-nextjs@latest +``` + +Change the `publish` directory to `.next`: + +```toml +[build] +publish = ".next" +``` + +If you previously set a custom `distDir` in your `next.config.js`, or set `node_bundler = "esbuild"` or +`external_node_modules` in your `netlify.toml` these are no longer needed and can be removed. The `serverless` and `experimental-serverless-trace` targets are deprecated in Next 12, and all builds with this plugin will now use the default `server` target. If you previously set the target in your `next.config.js`, you should remove it. -If you are using a monorepo you will need to change `publish` to point to the full path to the built `.next` directory, -which may be in a subdirectory. If you have changed your `distDir` then it will need to match that. - -If you are using Nx, then you will need to point `publish` to the folder inside `dist`, e.g. `dist/apps/myapp/.next`. - If you currently use redirects or rewrites on your site, see [the Rewrites and Redirects guide](https://github.com/netlify/netlify-plugin-nextjs/blob/main/docs/redirects-rewrites.md) for information on changes to how they are handled in this version. @@ -57,7 +64,15 @@ If you want to use Next 12's beta Middleware feature, this will mostly work as e [read the docs on some caveats and workarounds](https://github.com/netlify/netlify-plugin-nextjs/blob/main/docs/middleware.md) that are currently needed. -## Beta feedback +## Monorepos + +If you are using a monorepo you will need to change `publish` to point to the full path to the built `.next` directory, +which may be in a subdirectory. If you have changed your `distDir` then it will need to match that. + +If you are using Nx, then you will need to point `publish` to the folder inside `dist`, e.g. `dist/apps/myapp/.next`. + +## Feedback -Please share any thoughts, feedback or questions about the beta -[in our discussion](https://github.com/netlify/netlify-plugin-nextjs/discussions/706). +If you think you have found a bug in the plugin, +[please open an issue](https://github.com/netlify/netlify-plugin-nextjs/issues). If you have comments or feature +requests, [see the dicussion board](https://github.com/netlify/netlify-plugin-nextjs/discussions) From 8b6c1cbcc55fde793db8cd5a07e19b021b39396a Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Mon, 13 Dec 2021 16:23:03 +0000 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Kyle Rollins --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 38725c9a46..84f4df486b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Version 4 is a complete rewrite of the Essential Next.js plugin. For full detail ## Installing the plugin -The plugin should be installed automatically for new Next.js sites on Netlify. You can also install it manually like +The plugin installs automatically for new Next.js sites on Netlify. You can also install it manually like this: - Install the module: @@ -27,7 +27,7 @@ this: npm install -D @netlify/plugin-nextjs ``` -...then add it to your `netlify.toml` file: +...then add the plugin to your `netlify.toml` file: ```toml [[plugins]] @@ -49,8 +49,10 @@ Change the `publish` directory to `.next`: publish = ".next" ``` -If you previously set a custom `distDir` in your `next.config.js`, or set `node_bundler = "esbuild"` or -`external_node_modules` in your `netlify.toml` these are no longer needed and can be removed. +If you previously set these values, they're no longer needed and can be removed: +- `distDir` in your `next.config.js` +- `node_bundler = "esbuild"` in `netlify.toml` +- `external_node_modules` in `netlify.toml` The `serverless` and `experimental-serverless-trace` targets are deprecated in Next 12, and all builds with this plugin will now use the default `server` target. If you previously set the target in your `next.config.js`, you should remove From ddbc40ace469c3961b912250c346f70d93ed7b3d Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Tue, 14 Dec 2021 09:51:27 +0000 Subject: [PATCH 4/4] chore: add ISR link --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 84f4df486b..7be0dda210 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,7 @@ Version 4 is a complete rewrite of the Essential Next.js plugin. For full detail ## Installing the plugin -The plugin installs automatically for new Next.js sites on Netlify. You can also install it manually like -this: - -- Install the module: +The plugin installs automatically for new Next.js sites on Netlify. You can also install it manually like this: ```shell npm install -D @netlify/plugin-nextjs @@ -50,6 +47,7 @@ publish = ".next" ``` If you previously set these values, they're no longer needed and can be removed: + - `distDir` in your `next.config.js` - `node_bundler = "esbuild"` in `netlify.toml` - `external_node_modules` in `netlify.toml` @@ -73,6 +71,11 @@ which may be in a subdirectory. If you have changed your `distDir` then it will If you are using Nx, then you will need to point `publish` to the folder inside `dist`, e.g. `dist/apps/myapp/.next`. +## Incremental Static Regeneration (ISR) + +The Essential Next.js plugin now fully supports ISR on Netlify. For more details see +[the ISR docs](https://github.com/netlify/netlify-plugin-nextjs/blob/main/docs/isr.md). + ## Feedback If you think you have found a bug in the plugin,