solid-js 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev.cjs +15 -16
- package/dist/dev.js +15 -16
- package/dist/solid.cjs +15 -16
- package/dist/solid.js +15 -16
- package/package.json +2 -2
- package/web/dist/dev.cjs +4 -3
- package/web/dist/dev.js +4 -3
- package/web/dist/server.cjs +3 -3
- package/web/dist/server.js +3 -3
- package/web/dist/web.cjs +4 -3
- package/web/dist/web.js +4 -3
package/dist/dev.cjs
CHANGED
|
@@ -249,7 +249,7 @@ function createResource(source, fetcher, options) {
|
|
|
249
249
|
fetcher = source;
|
|
250
250
|
source = true;
|
|
251
251
|
}
|
|
252
|
-
options
|
|
252
|
+
options || (options = {});
|
|
253
253
|
if (options.globalRefetch !== false) {
|
|
254
254
|
Resources || (Resources = new Set());
|
|
255
255
|
Resources.add(load);
|
|
@@ -506,7 +506,7 @@ function startTransition(fn) {
|
|
|
506
506
|
queue: new Set(),
|
|
507
507
|
running: true
|
|
508
508
|
});
|
|
509
|
-
t.done
|
|
509
|
+
t.done || (t.done = new Promise(res => t.resolve = res));
|
|
510
510
|
t.running = true;
|
|
511
511
|
}
|
|
512
512
|
batch(fn);
|
|
@@ -1508,20 +1508,19 @@ function Suspense(props) {
|
|
|
1508
1508
|
const key = sharedConfig.context.id + sharedConfig.context.count;
|
|
1509
1509
|
p = sharedConfig.load(key);
|
|
1510
1510
|
if (p) {
|
|
1511
|
-
if (typeof p !== "object" || !("then" in p))
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
}
|
|
1511
|
+
if (typeof p !== "object" || !("then" in p)) p = Promise.resolve(p);
|
|
1512
|
+
const [s, set] = createSignal(undefined, {
|
|
1513
|
+
equals: false
|
|
1514
|
+
});
|
|
1515
|
+
flicker = s;
|
|
1516
|
+
p.then(err => {
|
|
1517
|
+
if (error = err) return set();
|
|
1518
|
+
sharedConfig.gather(key);
|
|
1519
|
+
setHydrateContext(ctx);
|
|
1520
|
+
set();
|
|
1521
|
+
setHydrateContext();
|
|
1522
|
+
p = undefined;
|
|
1523
|
+
});
|
|
1525
1524
|
}
|
|
1526
1525
|
}
|
|
1527
1526
|
const listContext = useContext(SuspenseListContext);
|
package/dist/dev.js
CHANGED
|
@@ -245,7 +245,7 @@ function createResource(source, fetcher, options) {
|
|
|
245
245
|
fetcher = source;
|
|
246
246
|
source = true;
|
|
247
247
|
}
|
|
248
|
-
options
|
|
248
|
+
options || (options = {});
|
|
249
249
|
if (options.globalRefetch !== false) {
|
|
250
250
|
Resources || (Resources = new Set());
|
|
251
251
|
Resources.add(load);
|
|
@@ -502,7 +502,7 @@ function startTransition(fn) {
|
|
|
502
502
|
queue: new Set(),
|
|
503
503
|
running: true
|
|
504
504
|
});
|
|
505
|
-
t.done
|
|
505
|
+
t.done || (t.done = new Promise(res => t.resolve = res));
|
|
506
506
|
t.running = true;
|
|
507
507
|
}
|
|
508
508
|
batch(fn);
|
|
@@ -1504,20 +1504,19 @@ function Suspense(props) {
|
|
|
1504
1504
|
const key = sharedConfig.context.id + sharedConfig.context.count;
|
|
1505
1505
|
p = sharedConfig.load(key);
|
|
1506
1506
|
if (p) {
|
|
1507
|
-
if (typeof p !== "object" || !("then" in p))
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
}
|
|
1507
|
+
if (typeof p !== "object" || !("then" in p)) p = Promise.resolve(p);
|
|
1508
|
+
const [s, set] = createSignal(undefined, {
|
|
1509
|
+
equals: false
|
|
1510
|
+
});
|
|
1511
|
+
flicker = s;
|
|
1512
|
+
p.then(err => {
|
|
1513
|
+
if (error = err) return set();
|
|
1514
|
+
sharedConfig.gather(key);
|
|
1515
|
+
setHydrateContext(ctx);
|
|
1516
|
+
set();
|
|
1517
|
+
setHydrateContext();
|
|
1518
|
+
p = undefined;
|
|
1519
|
+
});
|
|
1521
1520
|
}
|
|
1522
1521
|
}
|
|
1523
1522
|
const listContext = useContext(SuspenseListContext);
|
package/dist/solid.cjs
CHANGED
|
@@ -246,7 +246,7 @@ function createResource(source, fetcher, options) {
|
|
|
246
246
|
fetcher = source;
|
|
247
247
|
source = true;
|
|
248
248
|
}
|
|
249
|
-
options
|
|
249
|
+
options || (options = {});
|
|
250
250
|
if (options.globalRefetch !== false) {
|
|
251
251
|
Resources || (Resources = new Set());
|
|
252
252
|
Resources.add(load);
|
|
@@ -503,7 +503,7 @@ function startTransition(fn) {
|
|
|
503
503
|
queue: new Set(),
|
|
504
504
|
running: true
|
|
505
505
|
});
|
|
506
|
-
t.done
|
|
506
|
+
t.done || (t.done = new Promise(res => t.resolve = res));
|
|
507
507
|
t.running = true;
|
|
508
508
|
}
|
|
509
509
|
batch(fn);
|
|
@@ -1427,20 +1427,19 @@ function Suspense(props) {
|
|
|
1427
1427
|
const key = sharedConfig.context.id + sharedConfig.context.count;
|
|
1428
1428
|
p = sharedConfig.load(key);
|
|
1429
1429
|
if (p) {
|
|
1430
|
-
if (typeof p !== "object" || !("then" in p))
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
}
|
|
1430
|
+
if (typeof p !== "object" || !("then" in p)) p = Promise.resolve(p);
|
|
1431
|
+
const [s, set] = createSignal(undefined, {
|
|
1432
|
+
equals: false
|
|
1433
|
+
});
|
|
1434
|
+
flicker = s;
|
|
1435
|
+
p.then(err => {
|
|
1436
|
+
if (error = err) return set();
|
|
1437
|
+
sharedConfig.gather(key);
|
|
1438
|
+
setHydrateContext(ctx);
|
|
1439
|
+
set();
|
|
1440
|
+
setHydrateContext();
|
|
1441
|
+
p = undefined;
|
|
1442
|
+
});
|
|
1444
1443
|
}
|
|
1445
1444
|
}
|
|
1446
1445
|
const listContext = useContext(SuspenseListContext);
|
package/dist/solid.js
CHANGED
|
@@ -242,7 +242,7 @@ function createResource(source, fetcher, options) {
|
|
|
242
242
|
fetcher = source;
|
|
243
243
|
source = true;
|
|
244
244
|
}
|
|
245
|
-
options
|
|
245
|
+
options || (options = {});
|
|
246
246
|
if (options.globalRefetch !== false) {
|
|
247
247
|
Resources || (Resources = new Set());
|
|
248
248
|
Resources.add(load);
|
|
@@ -499,7 +499,7 @@ function startTransition(fn) {
|
|
|
499
499
|
queue: new Set(),
|
|
500
500
|
running: true
|
|
501
501
|
});
|
|
502
|
-
t.done
|
|
502
|
+
t.done || (t.done = new Promise(res => t.resolve = res));
|
|
503
503
|
t.running = true;
|
|
504
504
|
}
|
|
505
505
|
batch(fn);
|
|
@@ -1423,20 +1423,19 @@ function Suspense(props) {
|
|
|
1423
1423
|
const key = sharedConfig.context.id + sharedConfig.context.count;
|
|
1424
1424
|
p = sharedConfig.load(key);
|
|
1425
1425
|
if (p) {
|
|
1426
|
-
if (typeof p !== "object" || !("then" in p))
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
}
|
|
1426
|
+
if (typeof p !== "object" || !("then" in p)) p = Promise.resolve(p);
|
|
1427
|
+
const [s, set] = createSignal(undefined, {
|
|
1428
|
+
equals: false
|
|
1429
|
+
});
|
|
1430
|
+
flicker = s;
|
|
1431
|
+
p.then(err => {
|
|
1432
|
+
if (error = err) return set();
|
|
1433
|
+
sharedConfig.gather(key);
|
|
1434
|
+
setHydrateContext(ctx);
|
|
1435
|
+
set();
|
|
1436
|
+
setHydrateContext();
|
|
1437
|
+
p = undefined;
|
|
1438
|
+
});
|
|
1440
1439
|
}
|
|
1441
1440
|
}
|
|
1442
1441
|
const listContext = useContext(SuspenseListContext);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-js",
|
|
3
3
|
"description": "A declarative JavaScript library for building user interfaces.",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -144,5 +144,5 @@
|
|
|
144
144
|
"compiler",
|
|
145
145
|
"performance"
|
|
146
146
|
],
|
|
147
|
-
"gitHead": "
|
|
147
|
+
"gitHead": "b0aa7b227de8a3b4dc686690207d54a8af244efc"
|
|
148
148
|
}
|
package/web/dist/dev.cjs
CHANGED
|
@@ -59,7 +59,7 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
59
59
|
while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
|
|
60
60
|
} else if (bEnd === bStart) {
|
|
61
61
|
while (aStart < aEnd) {
|
|
62
|
-
if (!map || !map.has(a[aStart]))
|
|
62
|
+
if (!map || !map.has(a[aStart])) a[aStart].remove();
|
|
63
63
|
aStart++;
|
|
64
64
|
}
|
|
65
65
|
} else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
@@ -88,7 +88,7 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
88
88
|
while (bStart < index) parentNode.insertBefore(b[bStart++], node);
|
|
89
89
|
} else parentNode.replaceChild(b[bStart++], a[aStart++]);
|
|
90
90
|
} else aStart++;
|
|
91
|
-
} else
|
|
91
|
+
} else a[aStart++].remove();
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -347,6 +347,7 @@ function spreadExpression(node, props, prevProps = {}, isSVG, skipChildren) {
|
|
|
347
347
|
return prevProps;
|
|
348
348
|
}
|
|
349
349
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
350
|
+
if (solidJs.sharedConfig.context && !current) current = [...parent.childNodes];
|
|
350
351
|
while (typeof current === "function") current = current();
|
|
351
352
|
if (value === current) return current;
|
|
352
353
|
const t = typeof value,
|
|
@@ -449,7 +450,7 @@ function cleanChildren(parent, current, marker, replacement) {
|
|
|
449
450
|
const el = current[i];
|
|
450
451
|
if (node !== el) {
|
|
451
452
|
const isParent = el.parentNode === parent;
|
|
452
|
-
if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent &&
|
|
453
|
+
if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent && el.remove();
|
|
453
454
|
} else inserted = true;
|
|
454
455
|
}
|
|
455
456
|
} else if (current instanceof Node) parent.replaceChild(node, current);else parent.insertBefore(node, marker);
|
package/web/dist/dev.js
CHANGED
|
@@ -56,7 +56,7 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
56
56
|
while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
|
|
57
57
|
} else if (bEnd === bStart) {
|
|
58
58
|
while (aStart < aEnd) {
|
|
59
|
-
if (!map || !map.has(a[aStart]))
|
|
59
|
+
if (!map || !map.has(a[aStart])) a[aStart].remove();
|
|
60
60
|
aStart++;
|
|
61
61
|
}
|
|
62
62
|
} else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
@@ -85,7 +85,7 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
85
85
|
while (bStart < index) parentNode.insertBefore(b[bStart++], node);
|
|
86
86
|
} else parentNode.replaceChild(b[bStart++], a[aStart++]);
|
|
87
87
|
} else aStart++;
|
|
88
|
-
} else
|
|
88
|
+
} else a[aStart++].remove();
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -344,6 +344,7 @@ function spreadExpression(node, props, prevProps = {}, isSVG, skipChildren) {
|
|
|
344
344
|
return prevProps;
|
|
345
345
|
}
|
|
346
346
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
347
|
+
if (sharedConfig.context && !current) current = [...parent.childNodes];
|
|
347
348
|
while (typeof current === "function") current = current();
|
|
348
349
|
if (value === current) return current;
|
|
349
350
|
const t = typeof value,
|
|
@@ -446,7 +447,7 @@ function cleanChildren(parent, current, marker, replacement) {
|
|
|
446
447
|
const el = current[i];
|
|
447
448
|
if (node !== el) {
|
|
448
449
|
const isParent = el.parentNode === parent;
|
|
449
|
-
if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent &&
|
|
450
|
+
if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent && el.remove();
|
|
450
451
|
} else inserted = true;
|
|
451
452
|
}
|
|
452
453
|
} else if (current instanceof Node) parent.replaceChild(node, current);else parent.insertBefore(node, marker);
|
package/web/dist/server.cjs
CHANGED
|
@@ -575,8 +575,8 @@ function getHydrationKey() {
|
|
|
575
575
|
function generateHydrationScript({
|
|
576
576
|
eventNames = ["click", "input"],
|
|
577
577
|
nonce
|
|
578
|
-
}) {
|
|
579
|
-
return `<script${nonce ? ` nonce="${nonce}"` : ""}>var e,t;e=window._$HY||(_$HY={events:[],completed:new WeakSet,r:{}}),t=e=>e&&e.hasAttribute&&(e.hasAttribute("data-hk")?e:t(e.host&&e.host instanceof Node?e.host:e.parentNode)),["${eventNames.join('","')}"].forEach((o=>document.addEventListener(o,(o=>{let s=o.composedPath&&o.composedPath()[0]||o.target,a=t(s);a&&!e.completed.has(a)&&e.events.push([a,o])})))),e.init=(t,o)=>{e.r[t]=[new Promise(((e,t)=>o=e)),o]},e.set=(t,o,s)=>{(s=e.r[t])&&s[1](o),e.r[t]=[o]},e.unset=t=>{delete e.r[t]},e.load=(t,o)=>{if(o=e.r[t])return o[0]};</script
|
|
578
|
+
} = {}) {
|
|
579
|
+
return `<script${nonce ? ` nonce="${nonce}"` : ""}>var e,t;e=window._$HY||(_$HY={events:[],completed:new WeakSet,r:{}}),t=e=>e&&e.hasAttribute&&(e.hasAttribute("data-hk")?e:t(e.host&&e.host instanceof Node?e.host:e.parentNode)),["${eventNames.join('","')}"].forEach((o=>document.addEventListener(o,(o=>{let s=o.composedPath&&o.composedPath()[0]||o.target,a=t(s);a&&!e.completed.has(a)&&e.events.push([a,o])})))),e.init=(t,o)=>{e.r[t]=[new Promise(((e,t)=>o=e)),o]},e.set=(t,o,s)=>{(s=e.r[t])&&s[1](o),e.r[t]=[o]},e.unset=t=>{delete e.r[t]},e.load=(t,o)=>{if(o=e.r[t])return o[0]};</script><!--xs-->`;
|
|
580
580
|
}
|
|
581
581
|
function injectAssets(assets, html) {
|
|
582
582
|
for (let i = 0; i < assets.length; i++) {
|
|
@@ -586,7 +586,7 @@ function injectAssets(assets, html) {
|
|
|
586
586
|
}
|
|
587
587
|
function injectScripts(html, scripts, nonce) {
|
|
588
588
|
const tag = `<script${nonce ? ` nonce="${nonce}"` : ""}>${scripts}</script>`;
|
|
589
|
-
const index = html.indexOf("
|
|
589
|
+
const index = html.indexOf("<!--xs-->");
|
|
590
590
|
if (index > -1) {
|
|
591
591
|
return html.slice(0, index) + tag + html.slice(index);
|
|
592
592
|
}
|
package/web/dist/server.js
CHANGED
|
@@ -572,8 +572,8 @@ function getHydrationKey() {
|
|
|
572
572
|
function generateHydrationScript({
|
|
573
573
|
eventNames = ["click", "input"],
|
|
574
574
|
nonce
|
|
575
|
-
}) {
|
|
576
|
-
return `<script${nonce ? ` nonce="${nonce}"` : ""}>var e,t;e=window._$HY||(_$HY={events:[],completed:new WeakSet,r:{}}),t=e=>e&&e.hasAttribute&&(e.hasAttribute("data-hk")?e:t(e.host&&e.host instanceof Node?e.host:e.parentNode)),["${eventNames.join('","')}"].forEach((o=>document.addEventListener(o,(o=>{let s=o.composedPath&&o.composedPath()[0]||o.target,a=t(s);a&&!e.completed.has(a)&&e.events.push([a,o])})))),e.init=(t,o)=>{e.r[t]=[new Promise(((e,t)=>o=e)),o]},e.set=(t,o,s)=>{(s=e.r[t])&&s[1](o),e.r[t]=[o]},e.unset=t=>{delete e.r[t]},e.load=(t,o)=>{if(o=e.r[t])return o[0]};</script
|
|
575
|
+
} = {}) {
|
|
576
|
+
return `<script${nonce ? ` nonce="${nonce}"` : ""}>var e,t;e=window._$HY||(_$HY={events:[],completed:new WeakSet,r:{}}),t=e=>e&&e.hasAttribute&&(e.hasAttribute("data-hk")?e:t(e.host&&e.host instanceof Node?e.host:e.parentNode)),["${eventNames.join('","')}"].forEach((o=>document.addEventListener(o,(o=>{let s=o.composedPath&&o.composedPath()[0]||o.target,a=t(s);a&&!e.completed.has(a)&&e.events.push([a,o])})))),e.init=(t,o)=>{e.r[t]=[new Promise(((e,t)=>o=e)),o]},e.set=(t,o,s)=>{(s=e.r[t])&&s[1](o),e.r[t]=[o]},e.unset=t=>{delete e.r[t]},e.load=(t,o)=>{if(o=e.r[t])return o[0]};</script><!--xs-->`;
|
|
577
577
|
}
|
|
578
578
|
function injectAssets(assets, html) {
|
|
579
579
|
for (let i = 0; i < assets.length; i++) {
|
|
@@ -583,7 +583,7 @@ function injectAssets(assets, html) {
|
|
|
583
583
|
}
|
|
584
584
|
function injectScripts(html, scripts, nonce) {
|
|
585
585
|
const tag = `<script${nonce ? ` nonce="${nonce}"` : ""}>${scripts}</script>`;
|
|
586
|
-
const index = html.indexOf("
|
|
586
|
+
const index = html.indexOf("<!--xs-->");
|
|
587
587
|
if (index > -1) {
|
|
588
588
|
return html.slice(0, index) + tag + html.slice(index);
|
|
589
589
|
}
|
package/web/dist/web.cjs
CHANGED
|
@@ -59,7 +59,7 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
59
59
|
while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
|
|
60
60
|
} else if (bEnd === bStart) {
|
|
61
61
|
while (aStart < aEnd) {
|
|
62
|
-
if (!map || !map.has(a[aStart]))
|
|
62
|
+
if (!map || !map.has(a[aStart])) a[aStart].remove();
|
|
63
63
|
aStart++;
|
|
64
64
|
}
|
|
65
65
|
} else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
@@ -88,7 +88,7 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
88
88
|
while (bStart < index) parentNode.insertBefore(b[bStart++], node);
|
|
89
89
|
} else parentNode.replaceChild(b[bStart++], a[aStart++]);
|
|
90
90
|
} else aStart++;
|
|
91
|
-
} else
|
|
91
|
+
} else a[aStart++].remove();
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -346,6 +346,7 @@ function spreadExpression(node, props, prevProps = {}, isSVG, skipChildren) {
|
|
|
346
346
|
return prevProps;
|
|
347
347
|
}
|
|
348
348
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
349
|
+
if (solidJs.sharedConfig.context && !current) current = [...parent.childNodes];
|
|
349
350
|
while (typeof current === "function") current = current();
|
|
350
351
|
if (value === current) return current;
|
|
351
352
|
const t = typeof value,
|
|
@@ -448,7 +449,7 @@ function cleanChildren(parent, current, marker, replacement) {
|
|
|
448
449
|
const el = current[i];
|
|
449
450
|
if (node !== el) {
|
|
450
451
|
const isParent = el.parentNode === parent;
|
|
451
|
-
if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent &&
|
|
452
|
+
if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent && el.remove();
|
|
452
453
|
} else inserted = true;
|
|
453
454
|
}
|
|
454
455
|
} else if (current instanceof Node) parent.replaceChild(node, current);else parent.insertBefore(node, marker);
|
package/web/dist/web.js
CHANGED
|
@@ -56,7 +56,7 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
56
56
|
while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
|
|
57
57
|
} else if (bEnd === bStart) {
|
|
58
58
|
while (aStart < aEnd) {
|
|
59
|
-
if (!map || !map.has(a[aStart]))
|
|
59
|
+
if (!map || !map.has(a[aStart])) a[aStart].remove();
|
|
60
60
|
aStart++;
|
|
61
61
|
}
|
|
62
62
|
} else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
@@ -85,7 +85,7 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
85
85
|
while (bStart < index) parentNode.insertBefore(b[bStart++], node);
|
|
86
86
|
} else parentNode.replaceChild(b[bStart++], a[aStart++]);
|
|
87
87
|
} else aStart++;
|
|
88
|
-
} else
|
|
88
|
+
} else a[aStart++].remove();
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -343,6 +343,7 @@ function spreadExpression(node, props, prevProps = {}, isSVG, skipChildren) {
|
|
|
343
343
|
return prevProps;
|
|
344
344
|
}
|
|
345
345
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
346
|
+
if (sharedConfig.context && !current) current = [...parent.childNodes];
|
|
346
347
|
while (typeof current === "function") current = current();
|
|
347
348
|
if (value === current) return current;
|
|
348
349
|
const t = typeof value,
|
|
@@ -445,7 +446,7 @@ function cleanChildren(parent, current, marker, replacement) {
|
|
|
445
446
|
const el = current[i];
|
|
446
447
|
if (node !== el) {
|
|
447
448
|
const isParent = el.parentNode === parent;
|
|
448
|
-
if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent &&
|
|
449
|
+
if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);else isParent && el.remove();
|
|
449
450
|
} else inserted = true;
|
|
450
451
|
}
|
|
451
452
|
} else if (current instanceof Node) parent.replaceChild(node, current);else parent.insertBefore(node, marker);
|