I was playing with the idea of using JS objects as a template engine: http://m1el.github.io/jsonht.htm , and I'm pretty happy with it. I think DOM is pretty damn fast in modern browsers. `innerHTML` can be slower than creating elements from a JS object! Here's the script I'm using for timing: https://gist.github.com/m1el/b28625b3b9261f0fab819e866133e49... My results in Chrome are: dom: 2663.580ms, innerHTML: 10999.44…
> I was playing with the idea of using JS objects as a template engine: http://m1el.github.io/jsonht.htm , and I'm pretty happy with it. Isn't that the same as (among several other things) React's JSX?
I don't think people realize that all JSX is, is a way to elegantly write out something that transpiles down to a pure object representation of the DOM.
JSX and React have a few quirks where React means it's not quite a pure object, but the React devs are working on removing those.