logoalt Hacker News

hsn915yesterday at 11:36 PM3 repliesview on HN

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

ethan_smithtoday at 3:36 AM

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.

silverwindtoday at 6:52 AM

Virtual DOM is a useless abstraction, there are numerous libs that perform fine without it.

show 1 reply
sethaurustoday at 2:59 AM

Other than quibbling over the word "template", how does that differ from what TFA is describing?

show 1 reply