Skip to content

Commit 98f15ce

Browse files
authored
chore: update READMEs (#1594)
* chore: update readmes * chore: changes from review
1 parent ae2c103 commit 98f15ce

File tree

3 files changed

+57
-31
lines changed

3 files changed

+57
-31
lines changed

README.md

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,8 @@
22

33
# Next.js Runtime
44

5-
<p align="center">
6-
<a aria-label="npm version" href="https://www.npmjs.com/package/@netlify/plugin-nextjs">
7-
<img alt="" src="https://img.shields.io/npm/v/@netlify/plugin-nextjs">
8-
</a>
9-
<a aria-label="MIT License" href="https://img.shields.io/npm/l/@netlify/plugin-nextjs">
10-
<img alt="" src="https://img.shields.io/npm/l/@netlify/plugin-nextjs">
11-
</a>
12-
</p>
13-
14-
## What's new in this version
15-
16-
For full details of everything that's new, check out
17-
[the v4 release notes](https://github.com/netlify/next-runtime/blob/main/docs/release-notes/v4.md)
5+
Next.js is supported natively on Netlify, and in most cases you will not need to install or configure anything. This
6+
repo includes the packages used to support Next.js on Netlify.
187

198
## Deploying
209

@@ -55,21 +44,9 @@ by targeting the `/_next/image/*` route:
5544

5645
## Next.js Middleware on Netlify
5746

58-
Next.js Middleware works out of the box on Netlify, but check out the
59-
[docs on some caveats](https://github.com/netlify/next-runtime/blob/main/docs/middleware.md). By default, middleware
60-
runs using SSR. For better results, you should enable [Netlify Edge Functions](#netlify-edge-functions), which ensures
61-
middleware runs at the edge. To use Netlify Edge Functions for middleware or to enable
62-
[edge server rendering](https://nextjs.org/blog/next-12-2#edge-server-rendering-experimental), set the environment
63-
variable `NEXT_USE_NETLIFY_EDGE` to `true`.
64-
65-
### No nested middleware in Next 12.2.0
66-
67-
In Next 12.2.0, nested middleware [has been deprecated](https://nextjs.org/docs/messages/middleware-upgrade-guide) in
68-
favor of root level middleware. If you are not using edge functions then this means that you won't get the benefits of
69-
using a CDN, and ISR will not work.
70-
71-
To fix this issue, you can run your middleware on [Netlify Edge Functions](#netlify-edge-functions) by setting the
72-
environment variable `NEXT_USE_NETLIFY_EDGE` to `true`.
47+
Next.js Middleware works out of the box on Netlify. By default, middleware runs using Netlify Edge Functions. For legacy
48+
support for running Middleware at the origin, set the environment variable `NEXT_DISABLE_NETLIFY_EDGE` to `true`. Be
49+
aware that this will result in slower performance, as all pages that match middleware must use SSR.
7350

7451
## Monorepos
7552

@@ -127,11 +104,12 @@ package = "@netlify/plugin-nextjs"
127104

128105
## Manually upgrading from an older version of the Next.js Runtime
129106

130-
If you previously set these values, they're no longer needed and can be removed:
107+
If you previously set these values, they're no longer needed and should be removed:
131108

132109
- `distDir` in your `next.config.js`
133110
- `node_bundler = "esbuild"` in `netlify.toml`
134111
- `external_node_modules` in `netlify.toml`
112+
- The environment variable `NEXT_USE_NETLIFY_EDGE` can be removed as this is now the default
135113

136114
The `serverless` and `experimental-serverless-trace` targets are deprecated in Next 12, and all builds with this Next
137115
Runtime will now use the default `server` target. If you previously set the target in your `next.config.js`, you should
@@ -144,5 +122,6 @@ files must be placed in `public`, not in the root of the site.
144122

145123
## Feedback
146124

147-
If you think you have found a bug in this repo, [please open an issue](https://github.com/netlify/next-runtime/issues).
148-
If you have comments or feature requests, [see the dicussion board](https://github.com/netlify/next-runtime/discussions)
125+
If you think you have found a bug in Next.js on Netlify,
126+
[please open an issue](https://github.com/netlify/next-runtime/issues). If you have comments or feature requests,
127+
[see the discussion board](https://github.com/netlify/next-runtime/discussions)

packages/next/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
![Next.js Runtime](https://github.com/netlify/next-runtime/raw/main/next-on-netlify.png)
2+
3+
<p align="center">
4+
<a aria-label="npm version" href="https://www.npmjs.com/package/@netlify/next">
5+
<img alt="" src="https://img.shields.io/npm/v/@netlify/next">
6+
</a>
7+
<a aria-label="MIT License" href="https://img.shields.io/npm/l/@netlify/next">
8+
<img alt="" src="https://img.shields.io/npm/l/@netlify/next">
9+
</a>
10+
</p>
11+
12+
# `@netlify/next`
13+
14+
The `@netlify/next` package makes Next.js even better.
15+
16+
## Next.js Advanced Middleware
17+
18+
Regular Next.js Middleware doesn’t provide access to the actual response, or allow you to modify the request. The
19+
`@netlify/next` library brings the power of Netlify Edge Functions to Next.js Middleware. It gives full access to the
20+
request and response objects, allowing you to modify requests before they are sent to your Next.js app, and modify
21+
responses before they are sent to the browser. This allows you to personalize pages on the fly, even if they are
22+
statically-generated. It includes baked-in support for:
23+
24+
- HTML rewrites
25+
- Page data transforms
26+
- Modifying request headers
27+
- Access to response body
28+
29+
For full details,
30+
[see the docs](https://docs.netlify.com/integrations/frameworks/next-js/middleware/#next-js-advanced-middleware-with-the-netlify-next-library).

packages/runtime/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
![Next.js Runtime](https://github.com/netlify/next-runtime/raw/main/next-on-netlify.png)
2+
3+
# `@netlify/plugin-nextjs`
4+
5+
<p align="center">
6+
<a aria-label="npm version" href="https://www.npmjs.com/package/@netlify/plugin-nextjs">
7+
<img alt="" src="https://img.shields.io/npm/v/@netlify/plugin-nextjs">
8+
</a>
9+
<a aria-label="MIT License" href="https://img.shields.io/npm/l/@netlify/plugin-nextjs">
10+
<img alt="" src="https://img.shields.io/npm/l/@netlify/plugin-nextjs">
11+
</a>
12+
</p>
13+
14+
This package handles the build process for Next.js sites on Netlify. You should not normally need to install it
15+
yourself, as it is used automatically during builds of Next.js sites. See
16+
[the docs for using Next.js on Netlify](https://docs.netlify.com/integrations/frameworks/next-js/overview/) for more
17+
details.

0 commit comments

Comments
 (0)