luwes / js-diff-benchmark

Simple benchmark for testing your DOM diffing algorithm.
67 stars 5 forks source link

snabbdom is broken on prepend/insert #39

Open dy opened 4 years ago

dy commented 4 years ago
  // insert
  diff(parent,[], [e1,e3,e5], null);
  diff(parent,[...parent.childNodes],[e1,e2,e3,e4,e5], null);
  parent.childNodes // e1, e2, e3, e5, e4

  // prepend
  diff(parent,[], [e4,e5], null);
  diff(parent,[e4,e5],[e1,e2,e3,e4,e5], null);
  parent.childNodes // e4, e5, e1, e2, e3

That is so regardless of the last argument.