No, you also have to relearn, just not as much. The React docs rightly state "JSX is not HTML" because you cannot use comments, doctype and it's a shame that JSX deviates from HTML in attribute names. Having to use className instead of class annoys me to no end and is why I prefer preact (they use class). Also autoComplete and spellCheck - just why? Converting this-that to thisThat makes sense but renaming attributes without necessity was a stupid decision.
So if you imagine that it's going through performing a document.createElement() call for each node then setting attributes then it makes sense. The only alternative is to maintain a list of mappings from HTML attribute to JS DOM attribute as part of the library, which would be a waste of bandwidth and irritating to maintain. The real problem is that JSX looks like HTML but is not describing HTML.
Actually, that's a React issue, not a JSX one.
JSX is attribute agnostic. You can use it with another view library like Mithril and not worry about those shenanigans (class, autocomplete and spellcheck will work out of the box).
Also if you use a sophisticated IDE that shouldn't be an annoyance at all.
Class is a reserved word. This is why they stuck with the dom attribute names. Because it is JS, not html :)
<For={item in items}>
<!-- multiple elements -->
</For>
<p For={item in items}><!-- single element --></p>
This syntax works for every component ("For" is just another component).But not only does it mean that users don't have to learn a new language and concepts, but it mean the maintainers don't have to develop a new language and all the corner cases, feature requests and bugs that come with it.
And in the case of lit-html, you also eliminate compilers completely because there's also no non-standard markup-in-JS syntax.
m2.textContent = instance.text;
Use Moon.compile(template) to get a better idea of outputs.It is the best mix of expressiveness, ease, and clarity I've found.
Now I have worked on designing a new structure for web applications that I’m planning on writing further about. The view API of components in Moon closely models my vision for the future of the web. Moon’s philosophy is to have a consistent API in order to create views to display data.
:)
A weird fixation.
https://news.ycombinator.com/item?id=15156363
If he's 14, then he's pretty much an attention needing dude (as he submitted this moon library at least 5 times and his "I'm 13 yo" tweets at least 3 times). At the same time, he claims that he does not like to mention his age.