Is ViewComponent the Future of Rails?

I've heard a lot about this library called ViewComponent from Github, and I wanted to see what the excitement is all about. So after spending a few days playing with the library, I was surprised by what I found.
🎥 Join my new Ruby on Rails Course here: bit.ly/3psxFEP
Read the tutorial here: mixandgo.com/learn/ruby-on-ra...
Link to the Github repository: github.com/mixandgo/react_vs_...
The article that I reference in the video: thenewstack.io/what-a-former-...
#rubyonrails #hotwire #react #reactjs #rails7 #viewcomponent

Пікірлер: 32

  • @SebastianSastre
    @SebastianSastre6 ай бұрын

    Fantastic review. Really fair evaluation.

  • @mixandgo

    @mixandgo

    6 ай бұрын

    Thanks for watching Sebastian

  • @DevBishwasBh
    @DevBishwasBh Жыл бұрын

    Thanks for sharing.

  • @mixandgo

    @mixandgo

    Жыл бұрын

    Glad you liked it

  • @denisbolomier3577
    @denisbolomier3577 Жыл бұрын

    thx for this video !

  • @mixandgo

    @mixandgo

    Жыл бұрын

    You bet!

  • @dfriis
    @dfriis Жыл бұрын

    Thanks for the video! I like how you look both at what's good and what could be better. I'm curious why not just use partials to obtain the same benefits you mention (reusability, design system, etc.)?

  • @mixandgo

    @mixandgo

    Жыл бұрын

    It's possible to do that using partials. It's just that this library makes it a bit easier if you're willing to depend on a 3rd party library for that. But you should always think twice about using a library for such a big part of your app. History has proven that's often a bad idea. Personally, I like to stick to partials as much as possible.

  • @dfriis

    @dfriis

    Жыл бұрын

    @@mixandgo Thanks for sharing. That was exactly my thinking. I feel I've been down this path before with a 'clever' new approach that turns out to be more of a burden later.

  • @mixandgo

    @mixandgo

    Жыл бұрын

    @@dfriis yup, same here.

  • @gamerneversleep4200
    @gamerneversleep4200 Жыл бұрын

    i just started learning rails

  • @ashutoshdevshali2933
    @ashutoshdevshali2933 Жыл бұрын

    I am under the impression that we should be using the rails api and any of js framework in frontend to build new applications. Now that stimulus and viewcomponent is here what do you think can these be used instead? Is it worth learning and using? I want to know your thoughts on this

  • @mixandgo

    @mixandgo

    Жыл бұрын

    Of course. That is exactly why Hotwire is so interesting. Instead of building two different apps, not to mention all the challenges that come with that, you only build one.

  • @ashutoshdevshali2933

    @ashutoshdevshali2933

    Жыл бұрын

    @@mixandgo thank you for the reply. I will be learning to work with hotwire and see what I have been missing.

  • @silencipher

    @silencipher

    Жыл бұрын

    I also have the same impression. Rails asset pipeline changes frequently and upgrading rails versions is a pain because of this. Using rails for apis only and using a frontend framework seems to use the best of both worlds

  • @mixandgo

    @mixandgo

    Жыл бұрын

    @@silencipher I disagree. To me, Hotwire is the way to go.

  • @RogerAlmeida82
    @RogerAlmeida82 Жыл бұрын

    What is that chrome extension that fill the form automatically? 🤔

  • @mixandgo

    @mixandgo

    Жыл бұрын

    chrome.google.com/webstore/detail/fake-filler/bnjjngeaknajbdcgpfkgnonkmififhfo

  • @JarmamStuff
    @JarmamStuff Жыл бұрын

    I appreciate that you gave it a good in-depth look and worked to find the useful aspects. I just can't shake the feeling that this is pretty over-engineered even for what it *is* able to achieve. You mention that with some updates this might become more useful - what additions could you imagine to make this a good pickup?

  • @mixandgo

    @mixandgo

    Жыл бұрын

    I would love to see an easy way to isolate and/or incorporate all dependencies, so if for example you have a form that depends on a controller, or some non-global css. A gem (like devise) would be a close example. What I'm going for is, plug and play functionality. Forms are the first thing that comes to mind.

  • @mdrenovac
    @mdrenovac Жыл бұрын

    you have a misspelling on one of your links above, instead of 'mixandgo', you've for 'mxiandgo'..

  • @mixandgo

    @mixandgo

    Жыл бұрын

    Thank you Martin

  • @hectorlabra1028
    @hectorlabra1028 Жыл бұрын

    What vscode theme is this?

  • @mixandgo

    @mixandgo

    Жыл бұрын

    I think it's Community Material Theme Palenight High Contrast

  • @crr4141
    @crr4141 Жыл бұрын

    Man but is not a good idea create a lot of components wrapped in helpers, uf you create a lot of helpers your aplications run slow because helpers is loading in the initial time when start your aplication for this reason was creating concept as drapoer to create decorator and load in demand. What do you opinion?

  • @mixandgo

    @mixandgo

    Жыл бұрын

    I don't think that's the case... why do you say that?

  • @siyaram2855
    @siyaram285511 ай бұрын

    reusable? ain't partial does that job?

  • @sufyaniqbal3636
    @sufyaniqbal3636 Жыл бұрын

    Just like Angular components but instead of type script Ruby is involved.

  • @mixandgo

    @mixandgo

    Жыл бұрын

    I don't think that's a fair comparison. Everything happens on the back-end here. There's no client-side logic at all (unless you add JS).

  • @drnicwilliams

    @drnicwilliams

    Жыл бұрын

    Right, it’s a component system for server side organisation/rendering, independent of how you might do your JavaScript or CSS.

  • @siyaram2855
    @siyaram285511 ай бұрын

    Does it make sense for regular web apps? At first it makes sense, then you see the complexity of the code going uphill. viewcomponent is produce of react fanboys. They want to complicate everything possible in name of testability