Thanks for those replies - really interesting.

I've used React quite a bit in the past and for the past few weeks I've 
been using Hotwire in Rails 7 and have to say I really like it.

What I like is the fact that you can build your application in the 
traditional sense and it will already have some speed increases through 
Turbo Drive intercepting internal links and form submissions. Then you can 
gradually add some Turbo frames to different pages to speed things up a bit 
more using partial page re-renders. And the way they are integrated using 
CRUD feels like you're not deviating too much from the server-side mindset 
... usually just a case of adding format.turbo_stream to the responds_to 
block in the controller.

And Stimulus is a nice little library for adding a bit more nuance to 
things and also uses the controller paradigm.

Overall, it feels very Rails-like and it's obviously made easier by the 
tight integration and helper methods.

Once you start using React, you're replacing chunks of HTML (or even whole 
pages) with a virtual DOM and then having to communicate with the server to 
keep the state in sync with the database. And you either lose the ability 
for it work without React or end up writing the large parts of the view 
code in Rails AND React.

I assume that there's been a lot of work done to make integrating React and 
Rails easier, but it feels like Hotwire is good enough to cope with a large 
number of use cases without having the extra overhead of adding another 
framework into the mix.

That's just my initial thoughts from playing around with it anyway!

On Wednesday, April 24, 2024 at 10:59:06 AM UTC+1 Ian Moss wrote:

> Similar, in that for rails 5 or rails 6, many projects had a JS front-end 
> - Vue.js was pretty popular at one point, whilst react was very popular it 
> felt like overkill for many use cases. 
>
> I actually gave up on the front-end side, as the JS side was just changing 
> all the time, and it was too much to keep up with. It felt like Rails 5 / 6 
> was a bit of a mess on the front-end, ymmv.
> There was plenty of Backend / Rails API work at the time in Berlin, so no 
> biggy. It's pretty rare that one person can be good at BE and FE, though 
> there's much blagging of this fullstack aspect - better to understand how 
> to interact with the customer and their needs before this IMHO. A team of 2 
> is still a small team afterall.
>
> Back in the Rails 2/3/4 days I used to quite like the Prototype coupling, 
> and ease of creating rich/interactive front-ends. However, I full got the 
> argument that this coupling was too much. Jquery still sometimes get used. 
>
> I slightly worry that they'll break things with rails 8 and the momentum 
> gained with rails 7 will be lost. Lots of rails work is now done in eastern 
> europe, phillipines, india. Not as many people using it western europe now. 
>
> Hoping to make the Sarejevo or Romania Rails conferences later in the 
> year. 
>
>
> --
> Ian Moss
> alter.is | ruby & product consultancy services.
> http://www.linkedin.com/in/alteris 
> http://twitter.com/alterisian 
>
>
> ----- Original message -----
> From: DAZ <daz...@gmail.com>
> To: "North West Ruby User Group (NWRUG)" <nwrug-...@googlegroups.com>
> Subject: [NWRUG] Hotwire v React
> Date: Tuesday, 23 April 2024 18:52
>
> Okay everyone ... this 'debate' got going on another thread I started.
>
> I've used React before and have found using Turbo frames and Stimulus to 
> be like a breath of fresh air, especially how well they integrate with the 
> rest of the Rails stack. 
>
> Other people have said that it can quickly get messy and React is needed 
> for anything complex.
>
> Would love to hear everyone's thoughts?
>
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "North West Ruby User Group (NWRUG)" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to nwrug-member...@googlegroups.com.
> To view this discussion on the web, visit 
> https://groups.google.com/d/msgid/nwrug-members/6b2f7f85-843c-478b-a326-26a07704ab0fn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/nwrug-members/6b2f7f85-843c-478b-a326-26a07704ab0fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"North West Ruby User Group (NWRUG)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nwrug-members+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/nwrug-members/85c8c431-6094-43b2-a974-a0944483812an%40googlegroups.com.

Reply via email to