> it's valid HTML with attributes that tell Vue how to bind to it. It's really not that difficult.
You mean it has at least three JS-like DSLs (which are not JS, and have different rules depending on which context they are in). In addition it has a very weird binding system which I described at length in the linked comment.
Yup. "Not that difficult".
Meanwhile JSX is a single consistent DSL that directly maps to function calls:
other tags, strings, or valid Javascript expressions
That's it. Even "html-like" attributes that people seem to not like... are exactly what HTML attributes are in actual Javascript DOM APIs [1] [2]
The amount of custom attributes, custom DSLs and gotchas just in the "HTML" part of Vue is staggering in comparison: https://pbs.twimg.com/media/DbVEoKOX0AEEen6?format=jpg&name=...
And funnily enough it ends up being compiled to what React is in the first place (here's the output of a Hello World app in Vue):
var render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"div",
{ attrs: { id: "app" } },
[
_c("img", {
attrs: { alt: "Vue logo", src: require("./assets/logo.png") }
}),
_c("HelloWorld", { attrs: { msg: "Welcome to Your Vue.js App" } })
],
1
)
}
Look, it's exactly what React without JSX is [3]. Only in React you don't need to invent a custom scripting language and binding rules.
[1] https://developer.mozilla.org/en-US/docs/Web/API/Element/att...
[2] And I'm really sad to see React team seriously discuss caving in to mob and considering replacing className with class etc.
[3] https://reactjs.org/docs/react-without-jsx.html