-
Notifications
You must be signed in to change notification settings - Fork 86
feat: add support for Next 12.3 middleware matchers #1612
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
Conversation
✅ Deploy Preview for next-hp-edge-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-export-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for nextjs-plugin-custom-routes-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-i18next-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo canceled.
|
✅ Deploy Preview for next-plugin-edge-middleware ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-plugin-canary ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
❌ Deploy Preview for next-plugin-rsc-demo failed.
|
2452624
to
dde04aa
Compare
dde04aa
to
f0fb695
Compare
@@ -83,7 +83,7 @@ export const buildResponse = async ({ | |||
const transformed = response.dataTransforms.reduce((prev, transform) => { | |||
return transform(prev) | |||
}, props) | |||
return context.json(transformed) | |||
return new Response(JSON.stringify(transformed), response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because of https://github.com/netlify/edge-functions-bootstrap/pull/76
@@ -9,7 +9,7 @@ | |||
"lint": "next lint" | |||
}, | |||
"dependencies": { | |||
"next": "^12.2.6-canary.12", | |||
"next": "^12.2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've temporarily set this to the old version so we can test backward-compat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks sound, but did run into a couple of issues following the test plan:
- When requesting the data route (with or without the request header) I got the
x-is-deno
header, but not thex-middleware-next
header (but I'm wondering if that's normal for a data route?). - Very strangely, when I first tested the middleware demo (deployed to Netlify) and hit the first link on the page,
/shows/rewriteme
, the middleware didn't run and I got 'This should have been rewritten', instead of the/shows/100
content. However, I can't reproduce this again (I've tried re-deploying a couple of times).
So... assuming the above 2 issues are, in fact, non-issues, then it's good to go.
@orinokai 🤦🏻♂️ I meant |
Summary
Adds support for 12.3 middleware matchers, including
has
andlocale
support.Test plan
x-middleware-next
andx-is-deno
are not setx-my-header
tomy-value
. Check that headersx-middleware-next
andx-is-deno
are setx-middleware-next
andx-is-deno
are set.Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal
Fixes #1602. FIxes #1481. Fixes https://github.com/netlify/pod-ecosystem-frameworks/issues/230
Standard checks:
🧪 Once merged, make sure to update the version if needed and that it was published correctly.