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

Add debounce to server side listener #59

Merged
merged 3 commits into from
Apr 30, 2024

Conversation

mikker
Copy link
Contributor

@mikker mikker commented Apr 27, 2024

Annoyed by this again, it suddenly hit me that the debounce could just be on the server side instead.

This will fix the problem of a template update triggering twice when TailwindCSS: once for the template file and once for the updated CSS. This would lead to unreliable reloads.

I opted to disable it as default, as it does add a slight delay to all updates. Definitely worth it if you use Tailwind though!

Also included a note to the README about not data-turbo-tracking assets in dev. Same, with Tailwind, any template change would trigger a CSS rebuild and because of data-turbo-track it would lead to a complete refresh of the page, breaking scroll restoration.

This also seems to be the issue in #56

@murraybo
Copy link
Contributor

I tried it in my project and it looks like a real solution for the problem.

👍

@kirillplatonov
Copy link
Owner

This solution looks great! 👏 Thank you!

@kirillplatonov kirillplatonov merged commit 6ec4ad0 into kirillplatonov:main Apr 30, 2024
1 check passed
@mikker mikker deleted the debounce-listen branch April 30, 2024 11:50
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.

3 participants