- From: <bugzilla@jessica.w3.org>
- Date: Wed, 12 Nov 2014 16:04:21 +0000
- To: public-webapps-bugzilla@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27310
Leo Horie <leohorie@hotmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |leohorie@hotmail.com
--- Comment #2 from Leo Horie <leohorie@hotmail.com> ---
There's more to diffing than just input states. For example, trashing the whole
DOM via innerHTML destroys application state such as an element having an event
handler, or a variable pointing to a node in the DOM tree.
The overarching reason libraries are using a virtual dom diff strategy is to be
able to apply multiple changes to a DOM tree atomically, while keeping
unchanged nodes intact for performance reasons (as opposed to recreating them
and restoring their states). Other js frameworks' data binding algorithms
(dirty checking, Object.observe + rAF, KVO + rAF, etc) also have this same
fundamental goal.
Non-diff strategies currently require a library to recursively visit every node
in a DOM tree (since there's no way to efficiently compile a list of
js-value-to-DOM-placeholder mappings), plus implement DOM versions of
Array::splice, etc.
A `.diffHTML` whose usage is similar to `.innerHTML`, but with diff semantics,
would be an immediately obvious way for a naive developer to apply js data to
the DOM.
--
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Wednesday, 12 November 2014 16:04:23 UTC