Comment by 90s_dev
JSX supports
* Autocompletion
* Type checking
* Syntax highlighting
* Lack of runtime string parsing
Tagged template literals don't.
JSX supports
* Autocompletion
* Type checking
* Syntax highlighting
* Lack of runtime string parsing
Tagged template literals don't.
Of course tagged string literals can be compiled down to a form where no string parsing occurs. This is a really old technique; I implemented it, like many others, in PHP in late 1990s.
Vut inside an IDE or an LSP, tagged literal strings need quite a bit more special support than JSX, AFAICT.
I believe the argument was that jsx doesn't support that either, which should be correct as far as I know.
They're all features in the jsx ecosystem that are provided by other libs, which are often preconfigured with projects utilizing jsx.
I did miss a lot of the tooling I've gotten used to the last time I made a weekend project utilizing lit webcomponents for sure, but I believe the people advocating for it usually rejoice in having less tooling in their development pipeline - it's just a fundamental disconnect between people that have learned and gotten used to current frontend development and people that don't really want to bother with it, looking for simpler solutions with less moving parts.
JSX has a constrained interface that is a tree of objects with some properties on each. I guess you can have a lsp for lit-html but it will inherit the unconstrained nature of html, which is everything being string, and therefore useless as a programming interface.
JSX does not support any of these, it was coded by others.
tagged template literals can have all of these, some already exist¹ and doesn't need a build step.
1. https://marketplace.visualstudio.com/items?itemName=bierner....