←back to thread

218 points mdhb | 1 comments | | HN request time: 0.438s | 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. ethan_smith ◴[] No.44393489[source]
A native virtual DOM implementation would also drastically reduce memory overhead since browser engines could optimize diffing algorithms at the C++ level instead of requiring megabytes of JavaScript framework code to be downloaded, parsed and executed on every page load.