Skip to content

Commit ea72c18

Browse files
authored
Merge branch 'main' into mk/als-test
2 parents 6632c4f + b9891bb commit ea72c18

File tree

17 files changed

+355
-237
lines changed

17 files changed

+355
-237
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"packages/runtime": "4.30.2",
2+
"packages/runtime": "4.30.3",
33
"packages/next": "1.4.3"
44
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Next.js Middleware works out of the box on Netlify. By default, middleware runs
5656
support for running Middleware at the origin, set the environment variable `NEXT_DISABLE_NETLIFY_EDGE` to `true`. Be
5757
aware that this will result in slower performance, as all pages that match middleware must use SSR.
5858

59-
For more details on Next.js Middleware with Netlify, see the [middleware docs](https://github.com/netlify/next-runtime/blob/main/docs/middleware.md).
59+
For more details on Next.js Middleware with Netlify, see the [middleware docs](https://docs.netlify.com/integrations/frameworks/next-js/middleware/).
6060

6161
### Limitations
6262

@@ -74,7 +74,7 @@ If you are using Nx, then you will need to point `publish` to the folder inside
7474
## Incremental Static Regeneration (ISR)
7575

7676
The Next.js Runtime fully supports ISR on Netlify. For more details see
77-
[the ISR docs](https://github.com/netlify/next-runtime/blob/main/docs/isr.md).
77+
[the ISR docs](https://docs.netlify.com/integrations/frameworks/next-js/incremental-static-regeneration/).
7878

7979
Note that Netlify has a minimum TTL of 60 seconds for revalidation.
8080

@@ -144,7 +144,7 @@ Runtime will now use the default `server` target. If you previously set the targ
144144
remove it.
145145

146146
If you currently use redirects or rewrites on your site, see
147-
[the Rewrites and Redirects guide](https://github.com/netlify/next-runtime/blob/main/docs/redirects-rewrites.md) for
147+
[the Rewrites and Redirects guide](https://docs.netlify.com/integrations/frameworks/next-js/redirects-and-rewrites/) for
148148
information on changes to how they are handled in this version. In particular, note that `_redirects` and `_headers`
149149
files must be placed in `public`, not in the root of the site.
150150

demos/middleware/middleware.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,25 @@ export async function middleware(req: NextRequest) {
5959
return response
6060
}
6161

62+
if(pathname.startsWith('/matcher-cookie')) {
63+
response = NextResponse.next()
64+
response.cookies.set('missingCookie', 'true')
65+
return response
66+
}
67+
6268
if (pathname.startsWith('/conditional')) {
6369
response = NextResponse.next()
6470
response.headers.set('x-modified-edge', 'true')
6571
response.headers.set('x-is-deno', 'Deno' in globalThis ? 'true' : 'false')
6672
return response
6773
}
6874

75+
if (pathname.startsWith('/missing')) {
76+
response = NextResponse.next()
77+
response.headers.set('x-cookie-missing', 'true')
78+
return response
79+
}
80+
6981
if (pathname.startsWith('/shows')) {
7082
if (pathname.startsWith('/shows/222')) {
7183
response = NextResponse.next()
@@ -119,6 +131,7 @@ export const config = {
119131
'/headers',
120132
{ source: '/static' },
121133
{ source: '/cookies' },
134+
{ source: '/matcher-cookie'},
122135
{ source: '/shows/((?!99|88).*)' },
123136
{
124137
source: '/conditional',
@@ -130,5 +143,14 @@ export const config = {
130143
},
131144
],
132145
},
146+
{
147+
source: '/missing',
148+
missing: [
149+
{
150+
type: 'cookie',
151+
key: 'missingCookie',
152+
}
153+
],
154+
},
133155
],
134156
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const MatcherCookie = () => {
2+
return (
3+
<div>
4+
<p>The cookie "missingCookie" should be set to true</p>
5+
</div>
6+
)
7+
}
8+
9+
export default MatcherCookie

demos/middleware/pages/missing.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import * as React from 'react'
2+
import Link from 'next/link'
3+
4+
const Missing = () => {
5+
return (
6+
<div>
7+
<p>Will Check if 'missingCookie' is missing and display headers</p>
8+
<p>To test go to <Link href="/matcher-cookie">cookies page</Link> and come back</p>
9+
</div>
10+
)
11+
}
12+
13+
export default Missing

docs/isr.md

Lines changed: 0 additions & 81 deletions
This file was deleted.

docs/large-functions.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/middleware.md

Lines changed: 0 additions & 54 deletions
This file was deleted.

docs/redirects-rewrites.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

docs/release-notes/v4.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ stability.
66
## What's new
77

88
- Full support for
9-
[incremental static regeneration (ISR)](https://github.com/netlify/next-runtime/blob/main/docs/isr.md).
9+
[incremental static regeneration (ISR)](https://docs.netlify.com/integrations/frameworks/next-js/incremental-static-regeneration/).
1010
- Full support for
11-
[Next.js rewrites, redirects and headers](https://github.com/netlify/next-runtime/blob/main/docs/redirects-rewrites.md).
12-
- Beta support for [Next.js 12 Middleware](https://github.com/netlify/next-runtime/blob/main/docs/middleware.md)
11+
[Next.js rewrites, redirects and headers](https://docs.netlify.com/integrations/frameworks/next-js/redirects-and-rewrites/).
12+
- Beta support for [Next.js 12 Middleware](https://docs.netlify.com/integrations/frameworks/next-js/middleware/)
1313
- Faster builds and deploys. Instead of generating one function per route, there are just three functions per site and a
1414
much smaller list of rewrites.
1515
- Full support for Netlify's new [persistent On-Demand Builders](https://ntl.fyi/odb). Return `fallback: "blocking"`
@@ -41,10 +41,10 @@ If you previously set these values, they're no longer needed and can be removed:
4141
- `external_node_modules` in `netlify.toml`
4242

4343
If you currently use redirects or rewrites on your site, see
44-
[the Rewrites and Redirects guide](https://github.com/netlify/next-runtime/blob/main/docs/redirects-rewrites.md) for
44+
[the Rewrites and Redirects guide](https://docs.netlify.com/integrations/frameworks/next-js/redirects-and-rewrites/) for
4545
information on changes to how they are handled in this version. If you currently have `_redirects` or `_headers` files
4646
in the root of your site, these will need to be moved into "public".
4747

4848
If you want to use Next.js 12's beta Middleware feature, this will mostly work as expected but please
49-
[read the docs on some caveats and workarounds](https://github.com/netlify/next-runtime/blob/main/docs/middleware.md)
49+
[read the docs on some caveats and workarounds](https://docs.netlify.com/integrations/frameworks/next-js/middleware/)
5050
that are currently needed.

0 commit comments

Comments
 (0)