Skip to content

chore: remove beta info #937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 42 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

<p align="center">
<a aria-label="npm version" href="https://www.npmjs.com/package/@netlify/plugin-nextjs">
Expand All @@ -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

- 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@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 the plugin 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 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
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.
Expand All @@ -57,7 +64,20 @@ 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`.

## 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

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)
10 changes: 0 additions & 10 deletions src/helpers/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,3 @@ export const checkZipSize = async (file: string, maxSize: number = LAMBDA_MAX_SI
greenBright`\n\nFor more information on fixing this, see ${blueBright`https://ntl.fyi/large-next-functions`}`,
)
}

export const 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`}
`,
),
)
5 changes: 0 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
verifyNetlifyBuildVersion,
checkNextSiteHasBuilt,
checkForRootPublish,
logBetaMessage,
checkZipSize,
checkForOldFunctions,
} from './helpers/verification'
Expand All @@ -26,7 +25,6 @@ const plugin: NetlifyPlugin = {
cache,
},
}) {
logBetaMessage()
const { publish } = netlifyConfig.build
checkForRootPublish({ publish, failBuild })
verifyNetlifyBuildVersion({ failBuild, ...constants })
Expand Down Expand Up @@ -98,8 +96,5 @@ const plugin: NetlifyPlugin = {
const { basePath } = await getNextConfig({ publish: netlifyConfig.build.publish, failBuild })
await unpatchNextFiles(basePath)
},
onEnd() {
logBetaMessage()
},
}
module.exports = plugin