Skip to content

fix: resolve all pages using nft #1780

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
Nov 16, 2022
Merged

fix: resolve all pages using nft #1780

merged 8 commits into from
Nov 16, 2022

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Nov 16, 2022

Summary

Currently we don't use Next.js's generated js.nft.json files when determining the dependencies for pages - we only use them for advanced API routes. Instead we directly trace the source files themselves. This means that we may miss some dependencies that Next.js knows about. For example, see #1776

This PR changes the resolver to use nft.json files for everything, and refactors all of it to reuse a lot more of the logic and make it more testable. It adds some tests for the generated files - mainly to ensure that they actually exist.

It adds a demo page similar to the one in #1776, which has a static file read using fs.

Test plan

  1. Ensure the unit tests pass and the default demo works
  2. Check the page that uses a static file and ensure it shows the word "world"

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

Fixes #1776

image

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 November 16, 2022 14:00
@netlify
Copy link

netlify bot commented Nov 16, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 8181941
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/63750d3053da5d000848f32a
😎 Deploy Preview https://deploy-preview-1780--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 Nov 16, 2022

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

Name Link
🔨 Latest commit 8181941
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/63750d30e9bbbc0008a635da
😎 Deploy Preview https://deploy-preview-1780--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 Nov 16, 2022

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

Name Link
🔨 Latest commit 8181941
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/63750d3053da5d000848f326
😎 Deploy Preview https://deploy-preview-1780--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.

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Nov 16, 2022
@netlify
Copy link

netlify bot commented Nov 16, 2022

Deploy Preview for nextjs-plugin-next-11-demo failed.

Name Link
🔨 Latest commit 8181941
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-next-11-demo/deploys/63750d30b483db00086b37ee

@netlify
Copy link

netlify bot commented Nov 16, 2022

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

Name Link
🔨 Latest commit 8181941
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/63750d309578b600087e5191
😎 Deploy Preview https://deploy-preview-1780--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 Nov 16, 2022

Deploy Preview for nextjs-plugin-custom-routes-demo ready!

Name Link
🔨 Latest commit 8181941
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/63750d309a7bfd0009d3b5cd
😎 Deploy Preview https://deploy-preview-1780--nextjs-plugin-custom-routes-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 Nov 16, 2022

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

Name Link
🔨 Latest commit 8181941
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/63750d3098762800082794cd
😎 Deploy Preview https://deploy-preview-1780--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 Nov 16, 2022

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

Name Link
🔨 Latest commit 8181941
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/63750d308408fe0008c9d303
😎 Deploy Preview https://deploy-preview-1780--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 Nov 16, 2022

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit 8181941
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/63750d308c014d0008ba97c6
😎 Deploy Preview https://deploy-preview-1780--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.

@netlify
Copy link

netlify bot commented Nov 16, 2022

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

Name Link
🔨 Latest commit 8181941
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/63750d304b62d40008cb432b
😎 Deploy Preview https://deploy-preview-1780--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.

Copy link

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes! 🚀

@kodiakhq kodiakhq bot closed this in #1773 Nov 16, 2022
@ascorbic
Copy link
Contributor Author

WTF Kodiak?

@ascorbic ascorbic reopened this Nov 16, 2022
@ascorbic
Copy link
Contributor Author

Oh, it's because I mentioned in the other one that this PR fixes the test failure! GitHub thought I meant that that PR "fixes" this one

Copy link

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

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

🚢

@ascorbic
Copy link
Contributor Author

@kodiakhq kodiakhq bot merged commit 267ff0b into main Nov 16, 2022
@kodiakhq kodiakhq bot deleted the mk/resolve-nft branch November 16, 2022 16:26
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.

Use nft.json to resolve page dependencies
2 participants