You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
morphdom does not use a virtual DOM, it simply uses the actual DOM.
Is this better? Is it faster than using a virtual dom? I ask, because as far as I know there are costs to instantiating new DOM elements (namely, createdCallback logic when the elements are made with Custom Elements v0, and constructor logic if made with v1 API). From what I know, virtual dom does not instantiate nodes in the virtual tree, and lifecycle methods never run. It's basically just a vanilla JS object structure, then finally, once the difference are ironed out, the needed element are created (and creation logic executed).
Even if using DocumentFragments, I believe that element creation logic is still fired. f.e.
vardocFrag=document.createDocumentFragment()varel=document.createElement('my-element')// runs the element's creation logicdocFrag.appendChild(el)
The text was updated successfully, but these errors were encountered:
trusktr
changed the title
Performance.
Discussion: Performance relating to morphdom vs virtual dom
Oct 18, 2016
There's also the benefit of the actual DOM being the source of truth: many JS libraries manipulate the DOM themselves. If you use virtual DOM, once those libraries change themselves in the DOM, your virtual DOM is no longer an accurate representation of the DOM.
Is this better? Is it faster than using a virtual dom? I ask, because as far as I know there are costs to instantiating new DOM elements (namely,
createdCallback
logic when the elements are made with Custom Elements v0, and constructor logic if made with v1 API). From what I know, virtual dom does not instantiate nodes in the virtual tree, and lifecycle methods never run. It's basically just a vanilla JS object structure, then finally, once the difference are ironed out, the needed element are created (and creation logic executed).Even if using DocumentFragments, I believe that element creation logic is still fired. f.e.
The text was updated successfully, but these errors were encountered: