logoalt Hacker News

leeoniyalast Friday at 11:56 AM1 replyview on HN

> There's no magic in tagged templates that somehow make them immediately better for some custom non-standard syntax compared to JSX.

they're marginally better since they have a platform-defined way to deliniate static from dynamic parts. ivi _can_ work without a runtime or build-time JS parser, while JSX cannot (because jsx has to be parsed out of full blobs of js)

on the dx/ide side, sure there's not a huge amount of difference if both had the same effort invested.


Replies

troupolast Friday at 2:11 PM

In the context of "let's create a native templating syntax for the browser" those differences between JSX and tagged templates don't matter. You still need something that the browser needs to parse and understand, you still need something for libs/frameworks to handle/understand/compile to.

My feeling is that tagged templates would actually be a worse fit in this scenario because now you would have to distinguish between "regular" tagged templates and "templating" tag templates.

show 1 reply