←back to thread

218 points mdhb | 2 comments | | HN request time: 0.688s | source
Show context
hsn915 ◴[] No.44392502[source]
What we need is not templating. What we need is a native implementation of a virtual dom.

More specifically, a native implementation of the "patch" function:

    patch(target_dom_node, virtual_dom)
Where `virtual_dom` is just a plain-data description of the DOM.

Most of the "slowness" of the DOM come from its requirement to be a 90's era Java style object hierarchy.

Don't call it "templating". Just call it "virtual dom". Everyone knows what that means.

replies(3): >>44393357 #>>44393489 #>>44394315 #
1. silverwind ◴[] No.44394315[source]
Virtual DOM is a useless abstraction, there are numerous libs that perform fine without it.
replies(1): >>44394440 #
2. nine_k ◴[] No.44394440[source]
It's a useful abstraction: you just build the full DOM with every change, a bit like a game engine. It makes so many things simpler.

It's not a free abstraction though.