mrmiguu / coco

Golang WebAssembly Framework
MIT License
110 stars 4 forks source link

Add DOM Patching #1

Open mrmiguu opened 5 years ago

mrmiguu commented 5 years ago

DOM currently renders from top to bottom without efficiently patching the diff of the incoming VDOM structure.

See gooact for an example of a minimal patching implementation.

mrmiguu commented 5 years ago

Basic DOM patching added: https://github.com/mrmiguu/coco/commit/9a415ce2a938ae94c4c6a89bc2dbd9ef0db776f7.

mrmiguu commented 5 years ago

Most likely linked to this.

https://github.com/sweetpalma/gooact/blob/4659085d4c1708c0538cf640dd6a05d7abb5142b/gooact.js#L75 This^ shows recursive per-element reconciling, setting attributes when the element is the same.