Live data from Hacker News

Faster DOM

annevankesteren.nl

51–54 of 54 posts

Re: Faster DOM

#51
post #40

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.

[deleted]

Re: Faster DOM

#52
post #40
post #29

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?

Yes, it is. If you replace Array literals with `React.createElement`, you will (almost) get compiled JSX templates.

Re: Faster DOM

#53
post #30

Earlier 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/

It originally said "nay" and someone convinced me to change it to "née" which means nothing like "nay". I changed it back.

Re: Faster DOM

#54
post #47

At 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.

Or search engines, which are a special case of disabled users.
Post reply on HN