by a_wild_dandan · 2y ago · 0 comments
Having recently worked on two legacy apps -- one ASP.NET, one Angular -- it made me deeply appreciate React and how far UI tech has come. Phenomenal work from the React team on more optimizations via this compiler. Good article too.
"that's it" does not paint the full picture. Yes, UI = function(state) is very convenient but the way React implements it inverts the problem. Now instead of having to figure out ways of updating everything you have to go through numerous hoops to get only the things you need to update.
That's literally the point of React Compiler
> export default memo(ExampleComponent)
- Preact (like react, but tiny)
- Solid (like react, but tiny and without the stupid re-rendering, or the stupid rules of hooks)
- Lit (like react; but tiny, based on the browser-native web components, and with a class-based api)
Considering that React has a virtual dom, a separate templating language (jsx), and now also a compiler, I would not call it simple.
I ended up rolling my own state management that lets you just write a normal JS class with normal fields and methods and use that for accessing and modifying your state. No reducers, atoms, stores, etc... Just a JS class for your state and logic.
I've got the feeling that I can render anything I want the way I want with React (even 3-d worlds!) but the only framework that comes close to what my old systems could do is
https://mobx.js.org/README.html
and I cannot understand why MobX isn't more popular than it is. (Worked fine for a websocket-based app to control my smart speakers, it was trivial to make it so adjusting the speaker volume through the mobile app or buttons was reflected on my web app. Never tried a bigger app)
I miss it when working with languages other than JavaScript.
React has yet another templating language.
Sounds like we agree that JS isn't a shitty programming language, but that's hardly unique to react.