I am really struggling to get hotwire running to be honest. I now just postponed implementing it till after the launch. Any good ways of getting up to speed on hotwire and debugging it?
It’s really a different mindset shift. In react, you think about components — updating components and replacing one component with a new component. But in hotwire, you think about pages. First implement everything as full page transitions. Only after you get all your functionality working with full page transitions, then you do a pass back through it and ask: how can I minimize the amount that changed between the transition from this page to that page? “Oh, just wrap this part in a turbo frame or have this one controller action reply with a turbo stream in this one case.”
I don’t know if that’s helpful, but realizing that I needed to shift from thinking about components to pages was the a-ha when Hotwire all started making sense.
A lot of people seem to overcomplicate it by bringing their thoughts on how other modern js apps are written. It would be helpful to have a specific example of some of the things you need to work through. Reading through the [handbook](https://hotwired.dev/) should get you most of the way there.
One of my colleagues recently switched from mostly react to default full stack Rails. He was really struggling with how to filter things in a table. When I showed him how I would do it, his comment was along the lines of: “I can’t believe how simple this is. Modern JS just doesn’t work this simple any more. This is like how jquery used to work but way more organized”.
I can’t say I know enough about modern js development to validate that comment. He noted something about expectations of how the dom managing things…
So, if you’re coming with a certain mindset of how to do things, try to leave that behind a moment and read through the handbook. Especially if it involves making fetch requests to do things. That’s like, the number one “you probably shouldn’t do it like that” in Hotwire.
some things have changed a bit - so you just have to work through the kinks.
one other thing though - since railsword conf - there was an announcement that certain things have simplified but I haven't found the docs or the new simplified api's.
I wanted to try my hand at something else than software.
reply