3 ms·
The template strings are sort of typed, using tagged template literals. These even come with editor support using extensions previously built for lit-html and t
by CuddleBunny 6y ago
The template strings are sort of typed, using tagged template literals. These even come with editor support using extensions previously built for lit-html and the like.
- flowerlad 6y agoYou get compile-time checks for embedded JavaScript expressions. But you don't get checks for html tags and attributes. With JSX the TypeScript compiler checks JavaScript expressions as well as mismatched tags and attributes, all without any add-ons.
- CuddleBunny 6y agoIf the tagged literal approach takes off I'm sure tooling will keep up. JSX wasn't always as well supported as it is now.
- spankalee 6y agoWith the lit-html TypeScript and VS Code plugins you _do_ get checks (and auto-completion) for HTML tags, attribute, and properties. Yes, it requires a plugin, but JSX required the parser, compiler, and type-checker to explicitly add support for it. They both require an extension to core TypeScript.