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
[gatsby-link] Add a callback for preloading #17952
Comments
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing! Thanks for being a part of the Gatsby community! 💪💜 |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
I would like to take this one 🙂 |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Thanks again for being part of the Gatsby community! 💪💜 |
Hey @jzabala & @onestopjs, Could you clarify a little bit more about what benefit this would give you? I don't think this is the right approach to get to the solution you're after. This would fix your issue in certain cases but you would need to add onPreload for the same link every time. Let's say you have a header & footer navigation, it means you'll have to add onPreload to both on them to make it work 💯. For me it seems like we're missing some preload apis to attach to a route. |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Thanks again for being part of the Gatsby community! 💪💜 |
Summary
Add a callback to Gatsby Link for preloading
Basic example
Motivation
Gatsby Link uses IntersectionObserver to preload linked pages which are visible. I think it would be really useful to be able to pass a callback function to Gatsby Link which will be called when preloading has been triggered.
In my plugin
gatsby-theme-localization
I have a wrapper for Gatsby Link which preloads namespaces on hover. However, it is not sufficient as Gatsby preloads page data earlier. Having such callback would enable me to preload namespaces whenever Gatsby decides to.I am sure that there are many other use cases where this would be really valuable.
I am more than willing to work on this if people agree that it would be a nice feature.
The text was updated successfully, but these errors were encountered: