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): Support numbers in navigate function #25611
Conversation
Your pull request can be previewed in Gatsby Cloud: https://build-8fa4b2e7-48a7-475c-96ee-0b6dab9a0b8d.staging-previews.gtsb.io |
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.
This does sidestep the serviceworker check (line 70) but I presume that's intentional?
I would half expect this kind of change to require more code to change. Nice to see it can be this simple.
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'm testing a few things, I don't think this covers all cases that gatsby needs.
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.
Can you add an e2e test? I get browser errors when testing this with gatsby-link
or isn't this meant for gatsby link?
@wardpeet I don't think it's intended for gatsby-link. More a programmatic API. I haven't tested gatsby-link and it might take more to make that work |
@pvdz I don't think so? This is effectively equivalent to pressing the back or forwards button on the browser. |
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.
looks good to me and was apparently checked with Ward so good to go
Description
Browsers supports navigating with numbers to jump multiple steps forward or backward in the history. Gatsby hasn't supported this yet, but we should to be as aligned with the browsers as we can! This adds that support.
Documentation
Related Issues
Fixes #24739