-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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): handle case of removing trailing slash in inc builds #29953
Conversation
5948f4e
to
357d094
Compare
…uring or between builds that wouldn't result in change of artifact filenames this is to cover for cases like `gatsby-plugin-remove-trailing-slashes` that change page path during the build or case when page path might be created from some cms content and trailing slash being added or removed there
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.
Code looks good, would it make sense to add unit tests to packages/gatsby/src/commands/build-utils.ts to test the logic instead of only relying on e2e tests
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.
Thank you 👍
…9953) * add test case * add one more edge case to tests * add more assertions * fix(gatsby): [incremental builds] handle case of page path changing during or between builds that wouldn't result in change of artifact filenames this is to cover for cases like `gatsby-plugin-remove-trailing-slashes` that change page path during the build or case when page path might be created from some cms content and trailing slash being added or removed there * make normalizePagePath terser * initial setup for calcDirtyHtmlFiles unit tests * flesh out tests (cherry picked from commit 7462030)
…9953) (#30001) * add test case * add one more edge case to tests * add more assertions * fix(gatsby): [incremental builds] handle case of page path changing during or between builds that wouldn't result in change of artifact filenames this is to cover for cases like `gatsby-plugin-remove-trailing-slashes` that change page path during the build or case when page path might be created from some cms content and trailing slash being added or removed there * make normalizePagePath terser * initial setup for calcDirtyHtmlFiles unit tests * flesh out tests (cherry picked from commit 7462030) Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
Published in |
Description
This is to handle cases like:
Used in plugins like
gatsby-plugin-remove-trailing-slashes
etc.For now this add failing test scenario, will add a fix for it in next commit
Related Issues
Fixes #29946