Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat(develop): add explicit express handler for page-data requests #27882
feat(develop): add explicit express handler for page-data requests #27882
Changes from 4 commits
f53f901
d28c8ba
08b2d64
ee81ad6
9fddbd9
70e207a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
prod-404
internal plugin is actually also used ingatsby develop
/404/
page (that this plugin clones into/404.html
) wasn't removing clone which meant that 404 page removals didn't actually removed/404.html
pageThere 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 don't know much about this plugin, just want to understand: why does it hook into
onCreatePage
instead of creating its own page? And where do we actually create the source404
page?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.
Ok, so explanation for this plugin - when user creates
src/pages/404.js
, the actual path for page is/404/
(that's whatgatsby-plugin-page-creator
does) which translated to/404/index.html
when generating .html file - this is fine, but a lot of hosting solutions handle/404.html
as potential default to show 404 page (I think Netlify does this for sure). So we do special case 404 kind of page and create "duplicate" page for itThe
src/pages/404.js
is also not only case when we do this - if user creates page programatically increatePages
- this will work too.Note that this is mostly needed for production builds, but our shared runtime (both dev and prod) also uses
/404.html
in multiple places, so the way this plugin works impact both develop and prod.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.
Just to clarify - we will actually use the new page data utility here? (i.e. #27939)
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.
That's the plan. It should look similar as https://github.com/gatsbyjs/gatsby/pull/27939/files#diff-e4535fc084e00493cdf64059b0257b3ba2ee3fe54ec9396daf87158b0679905cL193-R200 part in websocket manager