this post was submitted on 08 Mar 2023
3 points (80.0% liked)

Frontend Web Development

290 readers
2 users here now

Community to discuss stuff all things related to frontend web development. (sharing resources, discussion etc.)

founded 3 years ago
top 2 comments
sorted by: hot top controversial new old
[โ€“] bashlk 3 points 1 year ago (1 children)

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.

[โ€“] [email protected] 1 points 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.