Skip to content

feat: middleware warning #1425

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 8 commits into from
Jun 29, 2022
Merged

feat: middleware warning #1425

merged 8 commits into from
Jun 29, 2022

Conversation

sarahetter
Copy link

Summary

With Next 12.2.0's release, nested middleware no longer exists. Root level middleware run on origin will cause all of the pages to run as SSR (no static pages). If a user chooses Netlify Edge Functions, the middleware will run on edge, and the CDN static pages are served as normal.
This adds a warning to users who are using middleware but aren't using Netlify Edge Functions

Test plan

  1. Visit the Deploy Preview (insert link to specific page) ...

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal

Closes #1379

Standard checks:

  • Check the Deploy Preview's Demo site for your PR's functionality
  • Add docs when necessary

🧪 Once merged, make sure to update the version if needed and that it was published correctly.

@sarahetter sarahetter requested a review from a team June 28, 2022 15:46
@sarahetter sarahetter self-assigned this Jun 28, 2022
@netlify
Copy link

netlify bot commented Jun 28, 2022

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit 0ff6e2f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/62bc57c27c74120008cb0e5b
😎 Deploy Preview https://deploy-preview-1425--netlify-plugin-nextjs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jun 28, 2022
@netlify
Copy link

netlify bot commented Jun 28, 2022

Deploy Preview for netlify-plugin-nextjs-export-demo ready!

Name Link
🔨 Latest commit 0ff6e2f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/62bc57c2ba19160009a20c92
😎 Deploy Preview https://deploy-preview-1425--netlify-plugin-nextjs-export-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Jun 28, 2022

Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!

Name Link
🔨 Latest commit 0ff6e2f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/62bc57c2873cb900096d0a05
😎 Deploy Preview https://deploy-preview-1425--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Jun 28, 2022

Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

Name Link
🔨 Latest commit 0ff6e2f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/62bc57c2a586e8000835394d
😎 Deploy Preview https://deploy-preview-1425--netlify-plugin-nextjs-static-root-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Jun 28, 2022

Deploy Preview for next-plugin-rsc-demo ready!

Name Link
🔨 Latest commit 0ff6e2f
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-rsc-demo/deploys/62bc57c2e1189e0009932f80
😎 Deploy Preview https://deploy-preview-1425--next-plugin-rsc-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Jun 28, 2022

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit 0ff6e2f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/62bc57c2b706ce0009d6ec4e
😎 Deploy Preview https://deploy-preview-1425--netlify-plugin-nextjs-next-auth-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Jun 28, 2022

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit 0ff6e2f
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/62bc57c2431e2f000a029712
😎 Deploy Preview https://deploy-preview-1425--next-plugin-edge-middleware.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Jun 28, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 0ff6e2f
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/62bc57c203695e000882881d
😎 Deploy Preview https://deploy-preview-1425--next-i18next-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Jun 28, 2022

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit 0ff6e2f
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/62bc57c2897b520009229a0b
😎 Deploy Preview https://deploy-preview-1425--next-plugin-canary.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@cypress
Copy link

cypress bot commented Jun 28, 2022



Test summary

20 0 0 0


Run details

Project netlify-plugin-nextjs-default-demo
Status Passed
Commit ae24287 ℹ️
Started Jun 29, 2022 1:49 PM
Ended Jun 29, 2022 1:51 PM
Duration 01:26 💡
OS Linux Ubuntu - 20.04
Browser Chrome 103

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@cypress
Copy link

cypress bot commented Jun 28, 2022



Test summary

7 0 0 0


Run details

Project netlify-plugin-nextjs-static-demo
Status Passed
Commit ae24287 ℹ️
Started Jun 29, 2022 1:51 PM
Ended Jun 29, 2022 1:52 PM
Duration 01:16 💡
OS Linux Ubuntu - 20.04
Browser Chrome 103

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@cypress
Copy link

cypress bot commented Jun 28, 2022



Test summary

2 0 0 0


Run details

Project netlify-plugin-nextjs-nx-monorepo-demo
Status Passed
Commit ae24287 ℹ️
Started Jun 29, 2022 1:50 PM
Ended Jun 29, 2022 1:51 PM
Duration 01:09 💡
OS Linux Ubuntu - 20.04
Browser Chrome 103

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Copy link

@KyleBlankRollins KyleBlankRollins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sarahetter, thanks for tagging me for review! I have some thoughts about breaking the middleware content into its own section. What do you think?

@sarahetter sarahetter requested a review from nickytonline June 28, 2022 18:26
Copy link
Contributor

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a few notes about wording. I think we should remove reference to running middleware at the origin, because I don't think most people will understand what that means. I wonder if we should move the bit about enabling edge functions right up to the top of the middleware section and emphasise the fact that they really, really should enable it!

README.md Outdated
### No nested middleware in Next 12.2.0

In Next 12.2.0, nested middleware [has been deprecated](https://nextjs.org/docs/messages/middleware-upgrade-guide) in
favour of root level middleware. If you are not using edge functions then this means that you won't get the benefits of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
favour of root level middleware. If you are not using edge functions then this means that you won't get the benefits of
favor of root level middleware. If you are not using edge functions then this means that you won't get the benefits of

oops

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cries in british/canadian

ascorbic
ascorbic previously approved these changes Jun 29, 2022
@kodiakhq kodiakhq bot merged commit 3c56eda into main Jun 29, 2022
@kodiakhq kodiakhq bot deleted the middleware-warning branch June 29, 2022 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn when running middleware at origin
4 participants