Skip to content
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

fix(gatsby): copy slices overrides to 404.html copy #38337

Merged
merged 2 commits into from
Jul 3, 2023
Merged

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Jul 3, 2023

Description

When creating copy of 404 / 500 pages (from /404/ to /404.html), slices overrides where not copied over. This casued slice aliasing not work in those pages.

Tests

Yes, e2e cases added to dev and prod runtimes

Related Issues

Fixes #38263

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 3, 2023
@pieh pieh removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 3, 2023
@pieh pieh marked this pull request as ready for review July 3, 2023 10:42

originalStatusPageByStatus[status] = storedPage
originalStatusPageByPath[action.payload.path] = storedPage
if (!originalPage || !isEqual(originalPage, pageToStore)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

isEqual check here was added (on top of using action.payload.slices) so that cases like src/pages/404.js + onCreatePage hook that adds slices (or context) can work as otherwise original page would be used and we would ignore potential future edits to the page.

@LekoArts LekoArts added the topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) label Jul 3, 2023
@LekoArts LekoArts changed the title fix: copy slices overrides to 404.html copy fix(gatsby): copy slices overrides to 404.html copy Jul 3, 2023
@LekoArts LekoArts merged commit 6c7a0e3 into master Jul 3, 2023
@LekoArts LekoArts deleted the fix/404-slices branch July 3, 2023 10:57
This was referenced Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sliceMap doesn't seem to work in a 404 page created via createPage
2 participants