-
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
feat(gatsby): trailingSlash
config option
#34268
Conversation
adjust createPath in page-creator
…n functionality in gatsby-plugin-gatsby-cloud (#34526)
Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
beforeEach(() => { | ||
cy.visit(`/`).waitForRouteChange() | ||
}) | ||
it(`page-creator without slash`, () => { |
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.
I don't feel strongly about this, so feel free to ignore it.
We could parameterize a large amount of these tests to clean them up a bit. Something like:
[
{title: `page-creator without slash`, button: `page-creator-without`, expected: `/page-2/`},
...
].forEach({title, button, expected} => it(title, () => {
cy.getTestElement(button).click()
cy.waitForRouteChange().assertRoute(expected)
});
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.
Yeah, that could be a good follow-up for some time
@@ -0,0 +1,21 @@ | |||
// TODO(v5): Remove legacy setting and default to "always" |
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.
Do we have a task/issue for all of these v5 TODOs?
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.
We'll eventually look at those once v5 approaches
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.
🚢 🇮🇹
Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com> Co-authored-by: Jude Agboola <marvinjudehk@gmail.com> Co-authored-by: Ty Hopp <tyhopp@users.noreply.github.com> Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
Description
Adds as per RFC the
trailingSlash
option togatsby-config.js
with the three main options:always
never
ignore
For backwards compatibility reasons were' also adding (in v4) the
legacy
option that will be the default for v4. In v5 it'll be removed andalways
is the default. This is due to different behaviors across page creation where we can't just set it toalways
yet.createPage
calls (both page creator, FS route api & manual call)gatsbyPath
of FS routesDocumentation
The
gatsby-config.js
doc page was updated. Possibly other pages in the docs could be updated, too.Related Issues
[ch42938]
[ch44034]
#34205
#31372