DEV Community

Discussion on: Hyperscript Tagged Markup (HTM): JSX alternative using standard tagged templates, with compiler support.

 
embiem profile image
Martin Beierling-Mutz

Yes exactly, in most build setups using HTM will be compiled just like JSX is.

After thinking about it a bit more, these are my reasons why to use HTM over JSX:

  • it's less magic, as you can see that it's a Tagged Template
  • because of less magic, it's also more beginner friendly
  • it's closer to HTML, without JSX limitations like class/className

And the biggest reason: no build step! I mean, look at the example... it's a 3.7KB js dependency and you can build preact apps!

To me, this is a taste of the future. A future where build tools won't be necessary anymore. Until then, we still need to transpile, code-split, optimize etc. using build/bundle tools like webpack.