Hacker News new | ask | show | jobs
by brainbag 969 days ago
I've done and loved at least 15 years of Rails, but not since the new Hotwire/Turbo/Stimulus releases. I've played with it a bit in side projects and it seems interesting, though I'm still skeptical that it's a good model for apps that plan to stick around for a while.

One of the things I've found difficult coming back to Rails is how spread out all of the behavior is in so many different files and partials and helpers. While SPAs have a lot of trade-off, organizing related code into components works so much better than any experience I had with server-side MVC, especially when using something like TypeScript and Remix's islands that very effectively isolate even further into logical modules. What little I've done with Hotwire/Turbo made it seem like very basic behavior is even more spread out and even harder to reason about for someone who didn't write it, which seems like it would make maintenance and refactoring in Rails even more time-consuming and perilous than it already is.

I'm really interested in the technology because I hear such glowing reviews of it, but I'm not sure I see it. I'd love to see a non-dogmatic comparison of SPAs vs Rails with Hotwire/Turbo MPA for post-MVP longer-term projects.

1 comments

You hereby have permission to organize code as you would like!

I think your complaint is fair but I'm not sure it is a fault with Rails so much as I've rarely seen anyone interested in organizing their Rails code more than the default.

Personally, I think it is really helpful, especially when it's as easy as using modules or having interfaces between modules. If you want feature-based structure, I'm pretty sure you can do it but that'll be a bit more involved. There are some gems out there that support those efforts.

I've found with Stimulus/Hotwire/Turbo that separation of concerns and finely composed partials can help a lot.