Hotwire components that refresh themselves | Boring Rails: Skip the bullshit and ship fast
14-Jul-2025 13
Earlier this year, I made a quick tweet about a pattern that I think makes working with Hotwire apps much better.
When you need to make a bit of UI that runs some code in the background, you can use turbo_streams to ‘refresh’ the front-end when the work starts, is in-progress, and finally when it’s finished.
But the problem is that, out of the box, turbo_streams use partials. And frankly, it just kind of sucks to work with. I found myself annoying by having to match up dom_ids across files and passing in data as locals. And it’s hard to search the codebase for partials, leading to cases where you change a partial and break something elsewhere just because it wasn’t easy to find usage.
Hotwire components that refresh themselves | Boring Rails: Skip the bullshit and ship fast #ruby #rubydeveloper #rubyonrails #Hotwire #components #refresh #themselves #Boring #Rails: #bullshit #hotwire https://rubyonrails.ba/link/hotwire-components-that-refresh-themselves-boring-rails-skip-the-bullshit-and-ship-fast