wavesoft / dot-dom

.dom is a tiny (512 byte) template engine that uses virtual DOM and some of react principles
Apache License 2.0
806 stars 53 forks source link

Introducing child reconciliation #3

Closed wavesoft closed 7 years ago

wavesoft commented 7 years ago

This PR introduces proper child reconciliation algorithm, keeping the same tiny size. To achieve this, the scope has changed slightly. In detail:

• ADDED: Proper Child Reconciliation

Now only the altered DOM elements are updated, instead of the entire DOM tree:

reconciliation mov

• REPLACED: Pre-defined tag shorthands

The pre-defined set of tags is now removed. Instead, you need to manually specify the tag names you want to use.

// Previously
R(div('Hello'), document.body);

// Now
const {div} = H;
R(div('Hello'), document.body);
styfle commented 7 years ago

Nice!