Earlier quoted context omitted.
> 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?
It's pretty much identical. 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.
Faster DOM
51–54 of 54 posts
Re: Faster DOM
#52I 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?
Re: Faster DOM
#53Earlier quoted context omitted.
Yeah, that stuck out to me, too. I'm still a bit fuzzy on how to interpret the author's original intent.
I think he meant "C++ (now Rust)", referring to the Servo browser using Rust - https://servo.org/
Re: Faster DOM
#54At what point does fiddling with the DOM get complicated and unpredictable enough that WebGL and/or Canvas starts to look like the saner alternative? On that note, I just stumbled on an old framework that's been out of development since 2012 called Blossom. It looks like it uses Canvas instead of the DOM. Does anybody have any history with it?
At the point when you decide you don't care about accessibility or actually rendering any interesting text.