-
Notifications
You must be signed in to change notification settings - Fork 432
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
Allow to override turbo fetch response (or export FetchRequest class) #898
base: main
Are you sure you want to change the base?
Conversation
@omohokcoj This PR might be of interest #1000, since it touches the same files as this PR. |
@seanpdoyle @dhh Have you guys looked at this? Oleksandr and Pete from Docuseal (Open Source Document Signing built with Rails and Turbo) added a Turbo version of Instantclick, and the perceived speed benefits are simply amazing (they can be experienced on their page. |
I'd like to see us add instaclick functionality straight into Turbo, if anyone feels like investigating that. |
Maybe a good place to “start” turbo/src/core/frames/link_interceptor.js Lines 7 to 17 in 3d30fe1
turbo/src/observers/link_click_observer.js Lines 12 to 24 in 3d30fe1
|
I'm attempting to implement http://instantclick.io functionality (prefetch on link hover) in my turbo app - one of the ways to implement it is via turbo:before-fetch-request event handler with the ability to override turbo fetch response:
8de3c39
https://gist.github.com/omohokcoj/781a18b3615e4e721ae5fa7f5d5c44ec (prefetch on hover implementation on top of the
turbo:before-fetch-request
event)Another way to implement it is via the
FetchRequest
class monkey patch (not exported in turbo currently).Would appreciate it a lot if any of those two commits (or both) could be merged and released in the next version.
Related issue: #174