I’ve been meaning to look at the template-string-based rendering libraries like nanohtml and hyperhtml for a while. So, I wrote some code with hyperhtml.
On one hand, their implementations are readable and fairly straightforward, which is important if you’re building a sufficiently complex thing.
On the other, doing a lot of DOM-defining template strings tends to get unwieldy once you start making nested stuff. Counterintuitively, there’s a world of difference between it and templates that are mostly uninterrupted HTML like the ones in Svelte. Fragmented HTML split up into various JS functions actually gives you a worse sense of the resulting structure than something like D3, which creates DOM pieces in code. It ends up feeling like JSX.
Well, ✓. I tried it.