Comment by em-bee
1 day ago
that's the thing, XML should have become javascript native so that we could write inline HTML more easily like JSX from react allows us to do.
1 day ago
that's the thing, XML should have become javascript native so that we could write inline HTML more easily like JSX from react allows us to do.
It did somewhat. It was called E4X.
more like it almost did. bummer. thanks for the pointer. sad to find out that the attempt was made but rejected. i wonder why.
Essentially, people didn't use it.
I think the reason is that it solved the "problem" of integrating XML into JavaScript, as if being good at XML was an end in itself. Once XML started being replaced by JSON in earnest, what was the pressing need for E4X? Doing stuff in SOAP or WS-* presumably, but that wasn't a common use case in browser JavaScript, though it might have come in handy if Node.js took off a bit earlier.
JSX took off because it helped frontend developers solve problems outside of JSX. Look at examples of its use and it's heavily intertwined with the rest of what you'd see on a webpage (HTML, JS and CSS), and you never get the sense that JSX is a "self-licking ice cream cone".