Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 90f1e35

Browse files
committed
Update miso to 1.4.
1 parent 234de6b commit 90f1e35

File tree

8 files changed

+27
-32
lines changed

8 files changed

+27
-32
lines changed

frameworks/keyed/miso/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
with (import (builtins.fetchTarball {
2-
url = "https://github.com/dmjio/miso/archive/485b91f.tar.gz";
3-
sha256 = "1kfr1f6bwfqnvxlfzf1vv0v07xrlg8ashjiasrps85l1dmja6s4b";
2+
url = "https://github.com/dmjio/miso/archive/d10c2d5a0def76b91d55abe3331370fc528b6d02.tar.gz";
3+
sha256 = "0733f3i73j6aig2bdar1dfm8h806ghhqqcm1mx7sy741cdvv77n3";
44
}) {});
55
with pkgs.haskell.packages;
66
let

frameworks/keyed/miso/dist-bundle/all.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frameworks/keyed/miso/dist-bundle/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<title>Miso v1.1.0.0</title>
5+
<title>Miso v1.4.0.0</title>
66
<link href="/css/currentStyle.css" rel="stylesheet"/>
77
<script>
88
window.saveGCFromClosureOverwriting = window['gc'];

frameworks/keyed/misojs/diff.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,7 @@ window['syncChildren'] = function syncChildren(os, ns, parent, doc) {
212212
window['diff'](null, nFirst, parent, doc);
213213
/* insertBefore's semantics will append a node if the second argument provided is `null` or `undefined`.
214214
Otherwise, it will insert node['domRef'] before oLast['domRef']. */
215-
if (!oLast) {
216-
parent.insertBefore(nFirst['domRef'], oFirst['domRef']);
217-
} else {
218-
parent.insertBefore(oLast['domRef'], nFirst['domRef']);
219-
}
215+
parent.insertBefore(nFirst['domRef'], oFirst ? oFirst['domRef'] : null);
220216
os.splice(newFirstIndex, 0, nFirst);
221217
newFirstIndex++;
222218
}
@@ -225,12 +221,11 @@ window['syncChildren'] = function syncChildren(os, ns, parent, doc) {
225221
-> [ ] <- new children
226222
*/
227223
else if (newFirstIndex > newLastIndex) {
228-
tmp = oldLastIndex - oldFirstIndex;
229-
while (tmp >= 0) {
230-
parent.removeChild(os[oldFirstIndex]['domRef']);
231-
os.splice(oldFirstIndex, 1);
232-
tmp--;
224+
tmp = oldLastIndex;
225+
while (oldLastIndex >= oldFirstIndex) {
226+
parent.removeChild(os[oldLastIndex--]['domRef']);
233227
}
228+
os.splice(oldFirstIndex, tmp - oldFirstIndex + 1);
234229
break;
235230
}
236231
/* happy path, everything aligns, we continue
@@ -249,7 +244,7 @@ window['syncChildren'] = function syncChildren(os, ns, parent, doc) {
249244
-> [ c b a ] <- new children
250245
*/
251246
else if (oFirst['key'] === nLast['key'] && nFirst['key'] === oLast['key']) {
252-
window['swapDomRefs'](node, oFirst['domRef'], oLast['domRef'], parent);
247+
window['swapDomRefs'](node, oLast['domRef'], oFirst['domRef'], parent);
253248
window['swap'](os, oldFirstIndex, oldLastIndex);
254249
window['diff'](os[oldFirstIndex++], ns[newFirstIndex++], parent, doc);
255250
window['diff'](os[oldLastIndex--], ns[newLastIndex--], parent, doc);
@@ -322,10 +317,10 @@ window['syncChildren'] = function syncChildren(os, ns, parent, doc) {
322317
if (found) {
323318
/* Move item to correct position */
324319
os.splice(oldFirstIndex,0, os.splice(tmp,1)[0]);
325-
/* Swap DOM references */
326-
parent.insertBefore(node['domRef'], os[oldFirstIndex]['domRef']);
327320
/* optionally perform `diff` here */
328321
window['diff'](os[oldFirstIndex++], nFirst, parent, doc);
322+
/* Swap DOM references */
323+
parent.insertBefore(node['domRef'], os[oldFirstIndex]['domRef']);
329324
/* increment counters */
330325
newFirstIndex++;
331326
}

frameworks/keyed/misojs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<title>Miso.js v1.3.0.0</title>
5+
<title>Miso.js v1.4.0.0</title>
66
<link href="/css/currentStyle.css" rel="stylesheet"/>
77
<script src="delegate.js"></script>
88
<script src="diff.js"></script>

frameworks/non-keyed/miso/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
with (import (builtins.fetchTarball {
2-
url = "https://github.com/dmjio/miso/archive/485b91f.tar.gz";
3-
sha256 = "1kfr1f6bwfqnvxlfzf1vv0v07xrlg8ashjiasrps85l1dmja6s4b";
2+
url = "https://github.com/dmjio/miso/archive/d10c2d5a0def76b91d55abe3331370fc528b6d02.tar.gz";
3+
sha256 = "0733f3i73j6aig2bdar1dfm8h806ghhqqcm1mx7sy741cdvv77n3";
44
}) {});
55
with pkgs.haskell.packages;
66
let

frameworks/non-keyed/miso/dist-bundle/all.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frameworks/non-keyed/miso/dist-bundle/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<title>Miso v1.1.0.0</title>
5+
<title>Miso v1.4.0.0</title>
66
<link href="/css/currentStyle.css" rel="stylesheet"/>
77
<script>
88
window.saveGCFromClosureOverwriting = window['gc'];

0 commit comments

Comments
 (0)