| This isn't entirely accurate as ember essentially diffs the dynamic values, but not DOM (or vDOM). In Ember the DOM is typically produced from pre-compiled templates and values are used to hydrate those templates or choose which templates are rendered. Obviously exceptions exist, but this is by far the most common scenario. When ember goes to "Detect" what changed, is basically ignores the DOM, and looks at the dynamic joint values such as {{#if firstName}} or {{lastName}}. Using this information, in then decides what DOM mutations are needed to bring the DOM back into sync. As a side note: Babel.js has some related optimizations for JSX/react uses. This all means, for DOM creation and updates the actual DOM is used. Now this may sound scary, as we all hear the DOM can be slow. But as it turns out, some aspects of the DOM are actually quite fast, and often faster then the alternatives. For example: * fragment.cloneNodes to produce new content
* node.textContent to update content – nicely leaves content inert, without needing costly JS based XSS escaping. There are obviously downsides to either approach and as such likely some hybrid is ideal. |