Skip to content

fix: correct handling of data route JSON files #864

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 5 commits into from
Dec 2, 2021
Merged

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Dec 2, 2021

Summary

Currently, the JSON files for statically-rendered routes were not being moved into the correct location for loading from the CDN. This PR moves them into _next/data/build-id/, rather than alongside the HTML.

It also fixes a bug in the fielsystem patching funcitons that load missing files from the CDN when required by Next. They were failing because even though they downloaded properly, Next would run stat() which would fail.

This adds lots of links to the test site index page, so that we can load all the different sorts of test page.

Test plan

  1. Visit a rewrite route that points to a static page and observe that it doesn't 404
  2. Load a static data file and check the response headers to see that there is no x-render-mode, meaning that it was served from the CDN.

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

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.

@netlify
Copy link

netlify bot commented Dec 2, 2021

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

🔨 Explore the source changes: 7623cc6

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/61a8ea492f48340007fd6e55

@netlify
Copy link

netlify bot commented Dec 2, 2021

✔️ Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo canceled.

🔨 Explore the source changes: 7623cc6

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/61a8ea49b652c60008e8fee2

@github-actions github-actions bot added the type: chore work needed to keep the product and development running smoothly label Dec 2, 2021
@ascorbic ascorbic changed the title chore: wip testing static props fix: correct handling of data route JSON files Dec 2, 2021
@github-actions github-actions bot added the type: bug code to address defects in shipped code label Dec 2, 2021
@ascorbic ascorbic removed the type: chore work needed to keep the product and development running smoothly label Dec 2, 2021
@ascorbic ascorbic marked this pull request as ready for review December 2, 2021 15:05
@ascorbic ascorbic requested a review from tiffafoo December 2, 2021 15:05
Copy link

@tiffafoo tiffafoo left a comment

Choose a reason for hiding this comment

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

🔥

@kodiakhq kodiakhq bot merged commit adea889 into main Dec 2, 2021
@kodiakhq kodiakhq bot deleted the mk/static-props-test branch December 2, 2021 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge priority: high type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants