90s_dev a day ago

JSX supports

* Autocompletion

* Type checking

* Syntax highlighting

* Lack of runtime string parsing

Tagged template literals don't.

  • owebmaster a day ago

    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....

    • 90s_dev a day ago

      The only inherent feature of JSX is compile time "parsing" whereas tagged literals inherently require runtime string parsing.

      But yeah other than that you're right. I'm just talking about first-class VS Code support. Which to me means a lot.

      • nine_k a day ago

        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.

        • 90s_dev 9 hours ago

          Do you mean at runtime but only once at startup, like parsing a Lua program into bytecode? Or do you mean at true compile time like Zig and Rust format strings?

    • 90s_dev a day ago

      Matt, who works pretty high level on VS Code, has written some amazing plugins.

      But they still don't have all the first-class features of JSX.

      I don't think this plugin works with type checking for instance.

      • ffsm8 a day ago

        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.

    • nsonha 18 hours ago

      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.

[removed] 13 hours ago
[deleted]
troupo 16 hours ago

> and don't know about lit-html yet.

You mean strings with custom non-standard syntax and weird rules of hooks, sorry, directives?