It seems so obviously bad to have to write your CSS and HTML in javascript. I don't get why people keep coming back to it. I mean, I get that the point is to add something that plain CSS and HTML don't do on their own, but it seems so much better to start with regular CSS/HTML and enhance... keep the standard syntax and semantics everywhere you possibly can, so that the dev only has to deal with framework-specific sy…
I mean, that is basically JSX is it not? I agree with your points, however. How the W3C has not come up with a good solution is beyond me.
Yes, exactly.
I get that many devs have learned and internalized how JSX (and the rest of react) renders to HTML and CSS, and have come to understand the mechanism well enough to debug when mistakes are made and things go wrong. But time and effort dealing with the framework takes away from time and effort spent on the thing you're actually trying to build. It just pays to minimize that where you can. JSX isn't as bad as this "rawjs" but it certainly has its issues.
Beyond requiring extra dev attention, JSX is also part of and implies the whole virtual DOM diffing/rendering mechanism, which just limits the rendering optimizations the framework is capable of doing on its own. That leads to poor performance (and/or incorrect rendering), or, again, the dev spending time on something the framework could have taken care of if it had been designed differently.
Fundamentally, a framework needs to be able to figure out what needs to be rerednered and what doesn't when state changes because it can't reredner everything on any change. That's just harder and more limited when everything is rendered dynamically.
I'm not trying to bash react and JSX... obviously it was workable and did a ton to popularize the reactive approach. But I don't think anyone thinks it was perfect from the start and obviously we've learned a lot about what works and what doesn't. To me this "rawjs" is a step backwards from even where react started out.