Is ViewComponent the Future of Rails?

Поділитися
Вставка
  • Опубліковано 18 сер 2022
  • 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

КОМЕНТАРІ • 33

  • @SebastianSastre
    @SebastianSastre 6 місяців тому +1

    Fantastic review. Really fair evaluation.

    • @mixandgo
      @mixandgo  6 місяців тому

      Thanks for watching Sebastian

  • @DevBishwasBh
    @DevBishwasBh Рік тому +1

    Thanks for sharing.

  • @denisbolomier3577
    @denisbolomier3577 Рік тому +1

    thx for this video !

  • @hectorlabra1028
    @hectorlabra1028 Рік тому

    What vscode theme is this?

    • @mixandgo
      @mixandgo  Рік тому

      I think it's Community Material Theme Palenight High Contrast

  • @RogerAlmeida82
    @RogerAlmeida82 Рік тому +1

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

    • @mixandgo
      @mixandgo  Рік тому

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

  • @gamerneversleep4200
    @gamerneversleep4200 Рік тому

    i just started learning rails

  • @ashutoshdevshali2933
    @ashutoshdevshali2933 Рік тому +1

    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  Рік тому +1

      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 Рік тому +2

      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  Рік тому +3

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

  • @mdrenovac
    @mdrenovac Рік тому

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

  • @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  Рік тому +1

      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  Рік тому +1

      @@dfriis yup, same here.

  • @JarmamStuff
    @JarmamStuff Рік тому +1

    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  Рік тому +2

      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.

  • @siyaram2855
    @siyaram2855 11 місяців тому

    reusable? ain't partial does that job?

  • @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
    @siyaram2855 11 місяців тому

    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

  • @sufyaniqbal3636
    @sufyaniqbal3636 Рік тому +1

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

    • @mixandgo
      @mixandgo  Рік тому +3

      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 Рік тому +2

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