• bashlk@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    I really like the quote in this post about how simplicity moves the complexity elsewhere. Personally, I share some of the sentiment that the author has. I have working with React since 2016 and while I will still continue to use it for the foreseeable future, I still see glimpses of something better in other frontend frameworks. Maybe this is an illusion, what I’ve noticed lately is that all framework / library sites make big claims about what they are capable of and the real limitations are only discovered when you actually use them. But a few months ago, I helped out on a Vue project and I can’t help but think that it does many things better.

    • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      1 year ago

      I like the concept of React, but I find it’s much more complex than it needs to be. A lot of the complexity comes from the fact that’s not opinionated enough. For example, React is agnostic regarding what causes a render to happen, so now you have to manage the whole lifecycle as the user and decide whether the component should repaint or not.

      There’s a ClojureScript library called Reagent that uses React internally. However, it made the decision to use reactive atoms as the repainting mechanism. Components observe the state of the atom, and when it changes the component repaints. With this strategy you only have to care about the render portion of the lifecycle. To be fair, React hooks now work similarly to that.

      Another approach I found interesting was HTMX where UI is basically treated as a dumb terminal and all the logic happens server side. I do find there is a lot of value in decoupling business logic from rendering by design.