Skip to content

Comment on Show HN: Fast Jekyll Alternative in TypeScript with JSXparent

Comments

sbjsOP

Also it was very tempting to have JSX compile into literal strings, effectively being a composable variant of tagged template literals with better IDE support, so that <a href={123}/> compiles to a function that returns `<a href="123"></a>`. It would have simplified the conceptual model significantly, and the implementation almost as much.

But because it would still be joining a bunch of strings together, it's literally about the same speed as the current implementation (which just adds the whole tree to a single array and joins it only once), so there's no real gain there.

And we lose script/style/tag hoisting, which is necessary for components to work the way they do, unless the JSX system is hacked in another (less simple) way to allow for it than currently.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.