Skip to content
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

Disable Turbo's InstantClick #1164

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

stevepolitodesign
Copy link
Contributor

Turbo 8 introduced InstantClick. An unintended side-effect of this
feature is that page requests are not debounced when a user hovers
over a link. This is a concern for two reasons:

  1. It creates an unnecessary burden on the server, which could affect
    rate limiting.
  2. It can artificially inflate our metrics.

Turbo 8 introduced [InstantClick][]. An unintended side-effect of this
feature is that page requests are [not debounced][] when a user hovers
over a link. This is a concern for two reasons:

1. It creates an unnecessary burden on the server, which could affect
   rate limiting.
2. It can artificially inflate our metrics.

[InstantClick]: https://turbo.hotwired.dev/handbook/drive#prefetching-links-on-hover
[not debounced]: hotwired/turbo#1181 (comment)
@stevepolitodesign stevepolitodesign changed the base branch from main to suspenders-3-0-0 March 7, 2024 21:05
@stevepolitodesign stevepolitodesign marked this pull request as ready for review March 7, 2024 21:05
@stevepolitodesign stevepolitodesign mentioned this pull request Mar 7, 2024
17 tasks
@stevepolitodesign stevepolitodesign merged commit 3b3712d into suspenders-3-0-0 Mar 8, 2024
2 checks passed
@stevepolitodesign stevepolitodesign deleted the suspenders-3-0-0-instant-click branch March 8, 2024 15:14
@davidalejandroaguilar
Copy link

Just want to mention that it is debounced in some way:

To avoid prefetching links that the user is briefly hovering, Turbo waits 100ms after the user hovers over the link before prefetching it.

I agree you might want to have more control and be able to configure the delay, which is what I originally intended. However, the subsequent PR to add this received push back until this kind of customization was in high demand.

So, if you think being able to tweak the delay would be useful for you, feel free to chime in that PR.

stevepolitodesign added a commit that referenced this pull request May 10, 2024
Turbo 8 introduced [InstantClick][]. An unintended side-effect of this
feature is that page requests are [not debounced][] when a user hovers
over a link. This is a concern for two reasons:

1. It creates an unnecessary burden on the server, which could affect
   rate limiting.
2. It can artificially inflate metrics.

[InstantClick]: https://turbo.hotwired.dev/handbook/drive#prefetching-links-on-hover
[not debounced]: hotwired/turbo#1181 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants