PSA: morphdom v2 released
patrick-steele-idem opened this issue · 5 comments
FYI, I just published morphdom@2
with some improvements:
- Fixed #47 - Detect and handle reorder of siblings
onNodeAdded
is now called for all on child nodes and not just the root node (closes PR #57)- Simplified code and reduced overall code size
- NOTE: Performance is about the same or slightly better than the previous version of
morphdom
based on benchmarks - Added examples:./examples/
Breaking changes
onNodeAdded
is now called for all on child nodes (not just the root node)- Removed deprecated options:
onBeforeMorphEl
(useonBeforeElUpdated
instead)onBeforeMorphElChildren
(useonBeforeElChildrenUpdated
instead)
See: morphdom/CHANGELOG
When you have a chance to upgrade please let me know if you see any issues.
Cheers.
Thanks @patrick-steele-idem!
That's exciting news @patrick-steele-idem!
FYI, I tried out upgrading morphdom in yo-yo locally and it appears to have broken the following tests:
- event attribute gets removed (expected 1, actual 2)
- input values get copied (expected 'hi', actual '')
@timwis thanks for taking a look. The breaking test looks to be due to the following breaking change in morphdom
:
- Removed options:
onBeforeMorphEl
(useonBeforeElUpdated
instead)onBeforeMorphElChildren
(useonBeforeElChildrenUpdated
instead)
Fortunately, it should be a simple change to the following line:
https://github.com/maxogden/yo-yo/blob/656992c1553782c779c9de4c711614b16c7f342a/index.js#L11
Something like the following should work:
if (opts.onBeforeMorphEl) { // If you need to support the old `onBeforeMorphEl`
opts.onBeforeElUpdated = opts.onBeforeMorphEl
}
if (!opts.onBeforeElUpdated) opts.onBeforeElUpdated = copier
We should close this issue now that #51 has landed 😸
Thanks @kristoferjoseph!