When To Use React Instead Of Hotwire In Rails 7?

  Рет қаралды 7,788

Deanin

Deanin

Жыл бұрын

I've seen too many people be rude and just assume Hotwire is always the best solution for everyone all the time. It made me a sad panda.
Join this channel to help support these videos:
/ @deanin
Follow me on social media:
linktr.ee/deanin
If you liked this video, please consider subscribing: t.co/RZ4EwP0F2a
#Deanin #Software #Programming

Пікірлер: 72
@Deanin
@Deanin Жыл бұрын
So I made another rant... 😅Not aimed at anyone who watches these videos, but I might have received one too made rude DMs because I made a React tutorial, and seen one too many bad Reddit takes recently lol. Don't cancel me pls.
@SupeRails
@SupeRails Жыл бұрын
Thanks for your contribution in Rails + React tutorials. Indeed, the market demand for Rails + React jobs is 10x higher than for Hotwire + Rails jobs. Thus, going all-in with React is a safer bet. Me personally, I love the Hotwire approach because it allows me to be much more productive as an solo developer working on a project. Whereas having React in small projects is overkill. In large projects it can make more sense. But again, if it's a project with 4+ devs, you can have a dedicate React person that has nothing to do with Rails, and the Rails devs can just be supplying API endpoints. So with that logic, it makes no sense for me as a Rails dev to invest my time into enhancing my React skills: I'd better be great at Ruby & Rails API.
@Deanin
@Deanin Жыл бұрын
Yeah I mean to each their own. I wouldn't expect someone to use React over Hotwire in the same way I don't expect them to use Hotwire over React. It's just an issue for me when people try to pass their opinions off as the optimal solution when some guy is just trying to get a job. Personally covering React and importmaps without JSX made me throw up a little, but that exact video was made because that solution was required for someone's take home interview. So I'm not a fan, but there's clearly demand so when people lose it on Reddit about not doing it the Rails way I'm like, come on man. The person is just trying to feed their family lol. I used to work in a job where pretty much every problem boiled down to doing it in a ridiculous suboptimal way, so I can appreciate that sometimes your hands are tied lol. I think the epitomy of this was a legacy application that had a literal two week setup process before we wrote some documentation on how to do it and found out you needed to comment out the tests to make it work. 🤡 I wouldn't advise commenting out tests, and yet that ended up being the solution for a solid 3 months 😭 As for the proper Rails way of doing things and Hotwire, I'll never hide that I'm not a Rails dev at heart. That's why I send people to you. 😂 I still get caught using findElementById in my stimulus controllers.
@ShlomoGoldenberg777
@ShlomoGoldenberg777 Жыл бұрын
I always knew react + rails is the ultimate combination to get a decent job in long run. I remember when I decided to start learning web development so I wanted to learn rails, because the pay is the best. Then find out react is kinda better for front end so I wanted to use both of them to maximize my chances to get first job. First I was using importmaps which are absolutely useless and I wasted so much time trying to set it up so I gave up. Then I find out that I can use esbuild which is 10x better. I understand what you trying to say here. In my opinion you better off learning react + rails mainly.
@Deanin
@Deanin Жыл бұрын
Yeeaah, I personally wouldn't advise someone to learn pure Rails if they're looking for a job. It's just a bit unrealistic when you consider how much more prevalent the competition is lol. I usual try to steer them towards MERN or .Net just because it's a lot easier to find a job that is searching for some of those skills. --- As for importmaps, they're easier to use if they're all you need to use. Just make sure to check that they work for the product you're working on and you should be fine.
@markpostura
@markpostura 11 ай бұрын
@@Deanin Good morning thanks for the content, where would you recommend me to start to learn how to use react on rails? @StevenSeagull777
@mariaineslucas3196
@mariaineslucas3196 7 ай бұрын
I’m in the exact same situation where I’m trying to combine Three JS, React and Rails and close to losing my mind. Now looking for comparisons like this because I’m just getting so confused between all these packages and versions of Rails
@hautbois78
@hautbois78 4 ай бұрын
The timeliness of this video is spot on for me. I have been tasked with re-writing a legacy Sinatra app in Rails 7. Our current apps all have React frontends (because our FE devs are React devs). Planning out this simple project brought up a lot of questions regarding maintainability for the team. Thank you for sharing your point of view and always being a great resource.
@DevBishwasBh
@DevBishwasBh Жыл бұрын
This comment is to help the rails community. You're awesome.
@guillermoemmanuelsanchezin1664
@guillermoemmanuelsanchezin1664 Жыл бұрын
This wasn't the video I was looking for but I watched it completely because I highly relate to what you were saying. I'm finishing a degree which does not have a really good market in my country, so I decided to try programming and started on October of this year. If it is difficult for people to get a junior position just imagine how difficult it is for the ones who don't have a CS background. I know that in Tech it doesn't matter if you're studying a CS degree, but I heard that some platforms can potentially reject applicants if they don't fulfill that background requirement. So one must try to make their profile as marketable as posible, and I think react+rails should be the go way in doing a portfolio for a newbie trying to find their first job.
@awksedgreep
@awksedgreep Жыл бұрын
“Hoping DHH doesn’t reinvent rails again” Love it. I feel like Rails 7 should finally be a way forward. Fingers crossed.
@ashutoshdevshali2933
@ashutoshdevshali2933 Жыл бұрын
Hey man, I personally feel that rails as a backend api is the best use case for it. But following all the buzz around hotwire I gave it a try last week. It was quite easy to do stuff without touching frontend as what it claims to be but i don't know I just don't feel comfortable enough and I would still go with rails as an api and react in frontend for a project I know is going to be much more than an MVP. Yes hotwire and stimulus could be a savior when we are building a customized admin in rails. Either the whole community has to start using it or it will just remain as a thing as good to know.
@clumsyjester459
@clumsyjester459 Жыл бұрын
Sounds like you need to give Unpoly a try. It can turn any server-side rendered page into an SPA and has a much simpler architecture and doesn't require you to change your backend at all.
@dmitriyobidin6049
@dmitriyobidin6049 Жыл бұрын
RoR + Hotwire is perfect(from my pov) for 1 type of projects - internal systems/portals for enterprises that are not computation-heavy. It will give you fastest development speed, iterations, etc. Others - it's always a compromise, when you have to take into consideration product market and job market.
@vaultek_
@vaultek_ Жыл бұрын
Guys if you are angry listen to this . Dean is just giving his honest view of this monopoly that guys in reddit do, and plus on that, the stack that I use for my startup is rails in the backend , integrated with graphql because I really love the separations of concern in rails you have models, mailers, resolvers , mutations etc... and next js and apollo in the frontend, and is going absolutly good fine and perfect , and also in the case of action cable , you don't need that, just use pusher more best than everything , well tested proper api, and bla bla bla.
@Deanin
@Deanin Жыл бұрын
Haha it's all good. I think in general people are going to have a bit of a tribalistic defense of whatever their choice is. For me personally, I'll defend my choice of using the right tool for the job which quite often isn't "The Rails Way" I'm just happy to have a video to link to in the future when I get the odd comment on a video asking me why I didn't use Hotwire instead of If anyone actually gets heated over a video like this, that probably says more about them than anything else lol. How is next js and Apollo working out by the way? I still haven't had the chance to look into nextjs but it seems interesting from what I've seen from Fireship videos
@vaultek_
@vaultek_ Жыл бұрын
@@Deanin yeah dude people are soo crazy about something that no one cares about , if you use react over hotwire, nobody will care, I am just telling them that you are a content creator and because of that you are teaching everything, I really like next and apollo, it works fine to me, and also I am managing all my libraries with nx monorepo, so in nx you have a folders called app and libs, app is for your apps and cypress e2e and in libs you have your shared libraries with jest and others, and because I maintain 2 startups I can shared that libraries and published them and use them in other apps, it really good, like rails engines
@vaultek_
@vaultek_ Жыл бұрын
@@Deanin and also take a look at next js , it has a lot of cool features, routes folder structure, in react that is a pain the but, I have a project in react that have more than 100 routes and my index file is like hell, to index on, so that a point for next, and I also you can do any of this fetching technicks , server side rendering, static site generation, client side rendering like react and other 2 that I don't use them that often , and you know the CEO gap of react, next handles that very well, there is a lot , I recommand to take a look at it, have a good day deanin
@rumble1925
@rumble1925 5 күн бұрын
I'm a bit surprised inertiajs isn't talked about more in the rails community. It's basically glue between your server and frontend routing. You get nice routing and ability to just use frontend frameworks for what they excel at, but keep your data handling and state on your server.
@RogerioNascimento1
@RogerioNascimento1 Жыл бұрын
Thanks for the video. I’m with you on this. I struggle sometimes to understand why there’s so much passion involved in technological decisions. Maybe that’s the main reason system architectural decisions must be taken by the most experienced developers in the project. We need to use the best tool for the scenario always…. And “best tool” must be comply of what’s best within the entire architecture. There can always be middle ground decisions: - there could be a gradual migration from one technology to the other… - there could be some pre-existent skill that is valid to be used for the moment - sometimes you need fast-and-dirty and then you have time to come back and fix later And there are the cases you mentioned: job interview, etc etc There are plenty of real world scenarios… and cheering up for one technology in despite of the other.. is professionally immature
@stpaquet
@stpaquet Жыл бұрын
You can bring part of React in Rails. I mean that it can be used as an alternative to view_component with the benefit of React. Also, you are right: a lot of existing projects have multiple backends... thus React being used actually. There is one thing I would not use in a new project: importmap. it looks like coffee script to me ;-) Most of the existing libraries are easier to import using webpack or esbuild (which I prefer over webpack ) Last point: Stimulus! Yep, I like it. I see it as a way to better support Javascript in Rails app. Previous versions of Rails were a bit messy on how to import and structure and reuse JS in Rails projects. Stimulus brings a framework that is structuring JS in Rails projects in a way that is closer to the industry standards. Thanks for sharing your opinion, which I found very balanced and rooted to the real developer's life.
@Deanin
@Deanin Жыл бұрын
Importmap and Coffeescript is a hilarious comparison, thank you for that haha. Completely agree with you. In general I don't really mind what people use, I think as long as someone has the option to use something and they want to, then more power to them. I'll give them my 2 cents if I feel it's warranted, but then I'll still do a tutorial on it because other people probably need/want to know. Then again, one of the first tutorials I did on this channel was running Python inside a Rails app, so I'm probably not the best influence hahaha.
@amani_art
@amani_art Жыл бұрын
Rails frontend doesn't make any sense. Things change every few years
@jl789nz
@jl789nz 11 ай бұрын
You could make the same argument about any JS framework as well. Using Rails for front end makes a lot of sense in a lot of cases. For me the best reason to learn React is for getting a job, not because it's a better way to build out a Rails app.
@thevocoder
@thevocoder 3 ай бұрын
@@jl789nzI thought the same as you
@GreenspudTrades
@GreenspudTrades 3 ай бұрын
They drastically refactor JS frameworks too every year.
@bj0rnen
@bj0rnen Жыл бұрын
I’ve been working with Rails for about 13 years or so and the only front end Rails thing I use is their UJS library. Where I work right now, we have a more traditional web app that uses JS on top of server side HTML rendering, and parts that are highly interactive are written in React.
@clumsyjester459
@clumsyjester459 Жыл бұрын
Have you tried Unpoly? For 95% of all projects React is still overkill and you can get a much simpler setup that still behaves like an SPA with Unpoly.
@bj0rnen
@bj0rnen Жыл бұрын
@@clumsyjester459 for simple things we mostly use vanilla JS. I haven’t tried Unpoly but I’ll give it a look.
@user-xedwsg
@user-xedwsg 3 ай бұрын
Is everything in a single monolithic app? Or is the react stuff in a different repo/project?
@bj0rnen
@bj0rnen 3 ай бұрын
@@user-xedwsg monolithic repo
@viktornovitskyi9457
@viktornovitskyi9457 Жыл бұрын
I totally agree with what you say. Thanks for the video.
@tapank415
@tapank415 Жыл бұрын
I personally go with whatever stack throw me at, just give me enough time to get a feel of it. if docs & available resources are good enough! i'm ready to rock. advice for newbie devs: Learn/Understand the architecture not the framework specific features. & also speaking of which tech stack to use its really depend upon scenario, for personal projects go with whatever you want, commercial one needs team discussion before making any decisions yourself, also must look at team expertise, time & budget, client requirements etc.
@Deanin
@Deanin Жыл бұрын
Yeah, completely agree. I think being able to appreciate the team/business side of it might be something that comes from experience. So that might be on me for losing sight of the fact that not everyone has that experience yet. It's just frustrating seeing how reluctant people can be to help when someone is veering off the DHH path with Rails lol.
@sheriffawzy2998
@sheriffawzy2998 9 ай бұрын
YOU ARE TOTALLY RIGHT, THANKS A MILLION.
@KapnKregg
@KapnKregg Жыл бұрын
What's funny is that the rest of the industry (the React/TypeScript/JavaScript world) is starting to slowly move back toward the monolith architecture. You can see this with the move to things like Remix and RedwoodJS and BlitzJS to a lesser degree.
@DevBishwasBh
@DevBishwasBh Жыл бұрын
Rails is awesome.
@DarkSolidity
@DarkSolidity 10 ай бұрын
Rails backend with react frontend seems like the natural solution to the problem. After learning frontend development react would be the better solution for a responsive interface
@JonathonPickett
@JonathonPickett Жыл бұрын
I so wish I could like this rant again!
@ellerium
@ellerium Жыл бұрын
I do removed the like and liked it again 😂
@PurelyDef
@PurelyDef 11 ай бұрын
I think there are a lot of contrived examples in this rant that aren’t needed tbh. React is just.. a better framework. Rails is good at backend infrastructure, but the front end stuff is an absolute nightmare. Stimulus + turboframes is just awful to work with for dozens of reasons. If you want to make a VERY simple static website, like the websites we had in the 90s, then rails is the way to go. If you want to make a large, modern application that has dynamic flows and reactive components, react is just far, far better. The hundreds of hours you'll waste trying to debug stimulus and turboframes just isn't worth it
@ellerium
@ellerium Жыл бұрын
I feel the need to like this video twice.
@melchior-chr.v.brincken8006
@melchior-chr.v.brincken8006 Жыл бұрын
The other problem is, that companies do not take on Junior RoR devs, because they cost them the first year and than jump ship for a better pay. React might be the way for me to get onboard.
@keeterkirk
@keeterkirk Жыл бұрын
You’re 100% right
@kurtm9744
@kurtm9744 8 ай бұрын
Has anyone done a deep dive into Svelte vs. Stimulus + Turbo? I like that Svelte lets you compartmentalize all HTML, CSS, and JavaScript together into Svelte files. But beyond that, does anyone know if it has more syntactic sugar or shortcuts for front end things like sorting data or image carousels? I feel like Stimulus has less of that and would require more custom JS.
@seriouslyiknowhowtoread
@seriouslyiknowhowtoread 6 ай бұрын
Svelte looks amazing I was blown away by it.
@danielb.2873
@danielb.2873 Жыл бұрын
Why use React at all?
@Deanin
@Deanin Жыл бұрын
Good one.
@vaultek_
@vaultek_ Жыл бұрын
@@Deanin lol
@SyedMSawaid
@SyedMSawaid 7 ай бұрын
Casual Wide Dean
@Andy-rl8jo
@Andy-rl8jo 9 ай бұрын
I’d definitely appreciate a tutorial on making tutorials
@llejk
@llejk Жыл бұрын
Uh, well but is this a rant about hotwire? Seems this is more about a very specific case of people advising for frameworks despite nobody asked.
@gsiicam
@gsiicam Жыл бұрын
Good video :)
@DarkSolidity
@DarkSolidity 10 ай бұрын
Why would an app need 2 backends
@siyaram2855
@siyaram2855 Жыл бұрын
I have posted a comment with a link hope it doesn't get flagged.
@Deanin
@Deanin Жыл бұрын
It didn't get flagged but it also didn't give me a notification for it 😮‍💨
@ellerium
@ellerium Жыл бұрын
I’ll create another comment only to increase the # of comments on the video. Because it talks so much with my opinion I would believe if you say you just read my mind 😂
@ramonchavez981
@ramonchavez981 7 ай бұрын
Whatever happened to PI planning? I like your videos but you seem to be a little bias about hotwire, hotwire has been designed for people that know ROR and some JS, and make it easier for them to implement SPAs at a very easy level without having to require them to learn a whole new framework. And yes hotwire isn't all SPA, but it works well for it. And don't forget, that ROR is an amazing framework for creating applications very fast.
@lucazarts25
@lucazarts25 11 ай бұрын
You're funny 😂😂
@canertasanalumni5923
@canertasanalumni5923 Жыл бұрын
Tell people use Emberjs, Ember + Rails
@SeanLazer
@SeanLazer 8 ай бұрын
If someone is trying to get a job I'd say that's not very good advice
@canertasanalumni5923
@canertasanalumni5923 8 ай бұрын
Yeah but it depends actually. Ember and Rails is a very rare combination not many jobs there. But if you find a junior job in startup then after you have 2-3 years experience with it companies who looks for ember and rails combination, you are the number one candidate most of the time. Thats how I found my abroad job after 1.5 years of experience. I think rails has better community then ember. However you can jump only Ember or Rails job afterwards(which I already did it 4 months ago)@@SeanLazer
@cyrilchubenko2657
@cyrilchubenko2657 Ай бұрын
I don't like where the RoR is going
@emiribrahimbegovic813
@emiribrahimbegovic813 Жыл бұрын
take this ANGRY comment!
@seriouslyiknowhowtoread
@seriouslyiknowhowtoread 6 ай бұрын
Why use react? Because it pays the bills .
@opjoter
@opjoter Жыл бұрын
The man really compared "market share" of apples and oranges (React vs Rails) by showing number of google searchs, you can't be serious man...
Why I Personally Don't Use Ruby On Rails
14:23
Deanin
Рет қаралды 21 М.
Hotwire Demystified - Jamie Gaskins
34:18
Ruby Central
Рет қаралды 11 М.
DELETE TOXICITY = 5 LEGENDARY STARR DROPS!
02:20
Brawl Stars
Рет қаралды 16 МЛН
🍟Best French Fries Homemade #cooking #shorts
00:42
BANKII
Рет қаралды 61 МЛН
Final muy inesperado 🥹
00:48
Juan De Dios Pantoja
Рет қаралды 11 МЛН
PINK STEERING STEERING CAR
00:31
Levsob
Рет қаралды 19 МЛН
The Ruby On Rails Junior Developer Problem
16:03
Deanin
Рет қаралды 18 М.
Is This Good News For Ruby On Rails 7?!
14:40
Deanin
Рет қаралды 10 М.
Adding Tailwind UI to Ruby on Rails
26:36
CJ Avilla
Рет қаралды 5 М.
Shopping Cart Order Sessions In Rails 7 With Turbo
26:21
The Hidden Cost Of GraphQL And NodeJS
28:35
ThePrimeTime
Рет қаралды 182 М.
How to use Hotwire in Rails
24:26
GoRails
Рет қаралды 54 М.
Frontendless Rails frontend - Vladimir Dementyev
34:35
Ruby Central
Рет қаралды 10 М.
DELETE TOXICITY = 5 LEGENDARY STARR DROPS!
02:20
Brawl Stars
Рет қаралды 16 МЛН