Skip to content

fix: run edge middleware on data requests #1382

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 4 commits into from
Jun 13, 2022
Merged

fix: run edge middleware on data requests #1382

merged 4 commits into from
Jun 13, 2022

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Jun 10, 2022

Summary

Next.js now runs middleware on internal data requests, so this PR updates the edge function to not skip these.

Test plan

  1. Load the middleware demo
  2. Open network panel
  3. Mouse over the "add header to static page" link
  4. Check if the 3.json request has an x-middleware-date header

When we have e2e canary tests, or it is released in Next then we can add tests for this.

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

proud capy

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.

@ascorbic ascorbic requested a review from a team June 10, 2022 15:52
@github-actions github-actions bot added the type: bug code to address defects in shipped code label Jun 10, 2022
@netlify
Copy link

netlify bot commented Jun 10, 2022

Deploy Preview for netlify-plugin-nextjs-demo canceled.

Name Link
🔨 Latest commit adedc5c
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/62a6f4396a135c0008abaa86

@netlify
Copy link

netlify bot commented Jun 10, 2022

Deploy Preview for netlify-plugin-nextjs-static-root-demo canceled.

Name Link
🔨 Latest commit adedc5c
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/62a6f439949f73000912ccfe

@netlify
Copy link

netlify bot commented Jun 10, 2022

Deploy Preview for netlify-plugin-nextjs-export-demo canceled.

Name Link
🔨 Latest commit adedc5c
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/62a6f4397548fd000803272d

@netlify
Copy link

netlify bot commented Jun 10, 2022

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

Name Link
🔨 Latest commit adedc5c
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/62a6f439b8a1cd0009309877
😎 Deploy Preview https://deploy-preview-1382--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 10, 2022

Deploy Preview for netlify-plugin-nextjs-next-auth-demo canceled.

Name Link
🔨 Latest commit adedc5c
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/62a6f4398d4ad9000895778e

@netlify
Copy link

netlify bot commented Jun 10, 2022

Deploy Preview for next-plugin-edge-middleware canceled.

Name Link
🔨 Latest commit adedc5c
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/62a6f43919201b00095cc2fb

@netlify
Copy link

netlify bot commented Jun 10, 2022

Deploy Preview for next-plugin-rsc-demo canceled.

Name Link
🔨 Latest commit adedc5c
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-rsc-demo/deploys/62a6f439b8a1cd000930987c

@netlify
Copy link

netlify bot commented Jun 10, 2022

Deploy Preview for next-i18next-demo canceled.

Name Link
🔨 Latest commit adedc5c
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/62a6f439ed7f740008d3120c

@netlify
Copy link

netlify bot commented Jun 10, 2022

Deploy Preview for next-plugin-canary failed.

Name Link
🔨 Latest commit adedc5c
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/62a6f4397548fd0008032732

@cypress
Copy link

cypress bot commented Jun 10, 2022



Test summary

21 0 0 0


Run details

Project netlify-plugin-nextjs-default-demo
Status Passed
Commit 955b041 ℹ️
Started Jun 12, 2022 4:25 PM
Ended Jun 12, 2022 4:27 PM
Duration 01:32 💡
OS Linux Ubuntu - 20.04
Browser Chrome 102

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 10, 2022



Test summary

7 0 0 0


Run details

Project netlify-plugin-nextjs-static-demo
Status Passed
Commit 955b041 ℹ️
Started Jun 12, 2022 4:26 PM
Ended Jun 12, 2022 4:28 PM
Duration 01:16 💡
OS Linux Ubuntu - 20.04
Browser Chrome 102

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 10, 2022



Test summary

2 0 0 0


Run details

Project netlify-plugin-nextjs-nx-monorepo-demo
Status Passed
Commit 955b041 ℹ️
Started Jun 12, 2022 4:27 PM
Ended Jun 12, 2022 4:28 PM
Duration 01:09 💡
OS Linux Ubuntu - 20.04
Browser Chrome 102

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

@ericapisani ericapisani left a comment

Choose a reason for hiding this comment

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

LGTM

When we have e2e canary tests, or it is released in Next then we can add tests for this.

When you have a moment (and if you haven't already/it doesn't already exist), could you create a Github issue for this so we don't forget?

@kodiakhq kodiakhq bot merged commit 55755df into main Jun 13, 2022
@kodiakhq kodiakhq bot deleted the mk/data-middleware branch June 13, 2022 08:27
@orinokai orinokai mentioned this pull request Jul 12, 2022
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants