solid-js 1.6.2 → 1.6.3
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 +36 -15
- package/dist/dev.js +36 -15
- package/dist/server.cjs +15 -1
- package/dist/server.js +15 -1
- package/dist/solid.cjs +10 -9
- package/dist/solid.js +10 -9
- package/h/dist/h.cjs +3 -0
- package/h/dist/h.js +3 -0
- package/h/jsx-dev-runtime/package.json +8 -0
- package/h/types/hyperscript.d.ts +3 -0
- package/package.json +13 -1
- package/types/jsx.d.ts +2 -0
- package/types/render/component.d.ts +1 -1
- package/web/dist/dev.cjs +3 -3
- package/web/dist/dev.js +3 -3
- package/web/dist/web.cjs +3 -3
- package/web/dist/web.js +3 -3
package/dist/dev.cjs
CHANGED
|
@@ -335,7 +335,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
335
335
|
refetching
|
|
336
336
|
}));
|
|
337
337
|
if (typeof p !== "object" || !(p && "then" in p)) {
|
|
338
|
-
loadEnd(pr, p);
|
|
338
|
+
loadEnd(pr, p, undefined, lookup);
|
|
339
339
|
return p;
|
|
340
340
|
}
|
|
341
341
|
pr = p;
|
|
@@ -345,7 +345,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
345
345
|
setState(resolved ? "refreshing" : "pending");
|
|
346
346
|
trigger();
|
|
347
347
|
}, false);
|
|
348
|
-
return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e)));
|
|
348
|
+
return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e), lookup));
|
|
349
349
|
}
|
|
350
350
|
Object.defineProperties(read, {
|
|
351
351
|
state: {
|
|
@@ -579,7 +579,9 @@ function useContext(context) {
|
|
|
579
579
|
}
|
|
580
580
|
function children(fn) {
|
|
581
581
|
const children = createMemo(fn);
|
|
582
|
-
const memo = createMemo(() => resolveChildren(children())
|
|
582
|
+
const memo = createMemo(() => resolveChildren(children()), undefined, {
|
|
583
|
+
name: "children"
|
|
584
|
+
}) ;
|
|
583
585
|
memo.toArray = () => {
|
|
584
586
|
const c = memo();
|
|
585
587
|
return Array.isArray(c) ? c : c != null ? [c] : [];
|
|
@@ -1143,7 +1145,9 @@ function mapArray(list, mapFn, options = {}) {
|
|
|
1143
1145
|
function mapper(disposer) {
|
|
1144
1146
|
disposers[j] = disposer;
|
|
1145
1147
|
if (indexes) {
|
|
1146
|
-
const [s, set] = createSignal(j
|
|
1148
|
+
const [s, set] = createSignal(j, {
|
|
1149
|
+
name: "index"
|
|
1150
|
+
}) ;
|
|
1147
1151
|
indexes[j] = set;
|
|
1148
1152
|
return mapFn(newItems[j], s);
|
|
1149
1153
|
}
|
|
@@ -1205,7 +1209,9 @@ function indexArray(list, mapFn, options = {}) {
|
|
|
1205
1209
|
});
|
|
1206
1210
|
function mapper(disposer) {
|
|
1207
1211
|
disposers[i] = disposer;
|
|
1208
|
-
const [s, set] = createSignal(newItems[i]
|
|
1212
|
+
const [s, set] = createSignal(newItems[i], {
|
|
1213
|
+
name: "value"
|
|
1214
|
+
}) ;
|
|
1209
1215
|
signals[i] = set;
|
|
1210
1216
|
return mapFn(s, i);
|
|
1211
1217
|
}
|
|
@@ -1384,20 +1390,25 @@ function For(props) {
|
|
|
1384
1390
|
const fallback = "fallback" in props && {
|
|
1385
1391
|
fallback: () => props.fallback
|
|
1386
1392
|
};
|
|
1387
|
-
return createMemo(mapArray(() => props.each, props.children, fallback
|
|
1393
|
+
return createMemo(mapArray(() => props.each, props.children, fallback || undefined), undefined, {
|
|
1394
|
+
name: "value"
|
|
1395
|
+
}) ;
|
|
1388
1396
|
}
|
|
1389
1397
|
function Index(props) {
|
|
1390
1398
|
const fallback = "fallback" in props && {
|
|
1391
1399
|
fallback: () => props.fallback
|
|
1392
1400
|
};
|
|
1393
|
-
return createMemo(indexArray(() => props.each, props.children, fallback
|
|
1401
|
+
return createMemo(indexArray(() => props.each, props.children, fallback || undefined), undefined, {
|
|
1402
|
+
name: "value"
|
|
1403
|
+
}) ;
|
|
1394
1404
|
}
|
|
1395
1405
|
function Show(props) {
|
|
1396
1406
|
let strictEqual = false;
|
|
1397
1407
|
const keyed = props.keyed;
|
|
1398
1408
|
const condition = createMemo(() => props.when, undefined, {
|
|
1399
|
-
equals: (a, b) => strictEqual ? a === b : !a === !b
|
|
1400
|
-
|
|
1409
|
+
equals: (a, b) => strictEqual ? a === b : !a === !b,
|
|
1410
|
+
name: "condition"
|
|
1411
|
+
} );
|
|
1401
1412
|
return createMemo(() => {
|
|
1402
1413
|
const c = condition();
|
|
1403
1414
|
if (c) {
|
|
@@ -1407,11 +1418,14 @@ function Show(props) {
|
|
|
1407
1418
|
return fn ? untrack(() => child(c)) : child;
|
|
1408
1419
|
}
|
|
1409
1420
|
return props.fallback;
|
|
1410
|
-
}
|
|
1421
|
+
}, undefined, {
|
|
1422
|
+
name: "value"
|
|
1423
|
+
} );
|
|
1411
1424
|
}
|
|
1412
1425
|
function Switch(props) {
|
|
1413
1426
|
let strictEqual = false;
|
|
1414
1427
|
let keyed = false;
|
|
1428
|
+
const equals = (a, b) => a[0] === b[0] && (strictEqual ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
|
|
1415
1429
|
const conditions = children(() => props.children),
|
|
1416
1430
|
evalConditions = createMemo(() => {
|
|
1417
1431
|
let conds = conditions();
|
|
@@ -1425,8 +1439,9 @@ function Switch(props) {
|
|
|
1425
1439
|
}
|
|
1426
1440
|
return [-1];
|
|
1427
1441
|
}, undefined, {
|
|
1428
|
-
equals
|
|
1429
|
-
|
|
1442
|
+
equals,
|
|
1443
|
+
name: "eval conditions"
|
|
1444
|
+
} );
|
|
1430
1445
|
return createMemo(() => {
|
|
1431
1446
|
const [index, when, cond] = evalConditions();
|
|
1432
1447
|
if (index < 0) return props.fallback;
|
|
@@ -1434,7 +1449,9 @@ function Switch(props) {
|
|
|
1434
1449
|
const fn = typeof c === "function" && c.length > 0;
|
|
1435
1450
|
strictEqual = keyed || fn;
|
|
1436
1451
|
return fn ? untrack(() => c(when)) : c;
|
|
1437
|
-
}
|
|
1452
|
+
}, undefined, {
|
|
1453
|
+
name: "value"
|
|
1454
|
+
} );
|
|
1438
1455
|
}
|
|
1439
1456
|
function Match(props) {
|
|
1440
1457
|
return props;
|
|
@@ -1447,7 +1464,9 @@ function ErrorBoundary(props) {
|
|
|
1447
1464
|
let err;
|
|
1448
1465
|
let v;
|
|
1449
1466
|
if (sharedConfig.context && sharedConfig.load && (v = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count))) err = v[0];
|
|
1450
|
-
const [errored, setErrored] = createSignal(err
|
|
1467
|
+
const [errored, setErrored] = createSignal(err, {
|
|
1468
|
+
name: "errored"
|
|
1469
|
+
} );
|
|
1451
1470
|
Errors || (Errors = new Set());
|
|
1452
1471
|
Errors.add(setErrored);
|
|
1453
1472
|
onCleanup(() => Errors.delete(setErrored));
|
|
@@ -1462,7 +1481,9 @@ function ErrorBoundary(props) {
|
|
|
1462
1481
|
}
|
|
1463
1482
|
onError(setErrored);
|
|
1464
1483
|
return props.children;
|
|
1465
|
-
}
|
|
1484
|
+
}, undefined, {
|
|
1485
|
+
name: "value"
|
|
1486
|
+
} );
|
|
1466
1487
|
}
|
|
1467
1488
|
|
|
1468
1489
|
const suspenseListEquals = (a, b) => a.showContent === b.showContent && a.showFallback === b.showFallback;
|
package/dist/dev.js
CHANGED
|
@@ -331,7 +331,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
331
331
|
refetching
|
|
332
332
|
}));
|
|
333
333
|
if (typeof p !== "object" || !(p && "then" in p)) {
|
|
334
|
-
loadEnd(pr, p);
|
|
334
|
+
loadEnd(pr, p, undefined, lookup);
|
|
335
335
|
return p;
|
|
336
336
|
}
|
|
337
337
|
pr = p;
|
|
@@ -341,7 +341,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
341
341
|
setState(resolved ? "refreshing" : "pending");
|
|
342
342
|
trigger();
|
|
343
343
|
}, false);
|
|
344
|
-
return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e)));
|
|
344
|
+
return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e), lookup));
|
|
345
345
|
}
|
|
346
346
|
Object.defineProperties(read, {
|
|
347
347
|
state: {
|
|
@@ -575,7 +575,9 @@ function useContext(context) {
|
|
|
575
575
|
}
|
|
576
576
|
function children(fn) {
|
|
577
577
|
const children = createMemo(fn);
|
|
578
|
-
const memo = createMemo(() => resolveChildren(children())
|
|
578
|
+
const memo = createMemo(() => resolveChildren(children()), undefined, {
|
|
579
|
+
name: "children"
|
|
580
|
+
}) ;
|
|
579
581
|
memo.toArray = () => {
|
|
580
582
|
const c = memo();
|
|
581
583
|
return Array.isArray(c) ? c : c != null ? [c] : [];
|
|
@@ -1139,7 +1141,9 @@ function mapArray(list, mapFn, options = {}) {
|
|
|
1139
1141
|
function mapper(disposer) {
|
|
1140
1142
|
disposers[j] = disposer;
|
|
1141
1143
|
if (indexes) {
|
|
1142
|
-
const [s, set] = createSignal(j
|
|
1144
|
+
const [s, set] = createSignal(j, {
|
|
1145
|
+
name: "index"
|
|
1146
|
+
}) ;
|
|
1143
1147
|
indexes[j] = set;
|
|
1144
1148
|
return mapFn(newItems[j], s);
|
|
1145
1149
|
}
|
|
@@ -1201,7 +1205,9 @@ function indexArray(list, mapFn, options = {}) {
|
|
|
1201
1205
|
});
|
|
1202
1206
|
function mapper(disposer) {
|
|
1203
1207
|
disposers[i] = disposer;
|
|
1204
|
-
const [s, set] = createSignal(newItems[i]
|
|
1208
|
+
const [s, set] = createSignal(newItems[i], {
|
|
1209
|
+
name: "value"
|
|
1210
|
+
}) ;
|
|
1205
1211
|
signals[i] = set;
|
|
1206
1212
|
return mapFn(s, i);
|
|
1207
1213
|
}
|
|
@@ -1380,20 +1386,25 @@ function For(props) {
|
|
|
1380
1386
|
const fallback = "fallback" in props && {
|
|
1381
1387
|
fallback: () => props.fallback
|
|
1382
1388
|
};
|
|
1383
|
-
return createMemo(mapArray(() => props.each, props.children, fallback
|
|
1389
|
+
return createMemo(mapArray(() => props.each, props.children, fallback || undefined), undefined, {
|
|
1390
|
+
name: "value"
|
|
1391
|
+
}) ;
|
|
1384
1392
|
}
|
|
1385
1393
|
function Index(props) {
|
|
1386
1394
|
const fallback = "fallback" in props && {
|
|
1387
1395
|
fallback: () => props.fallback
|
|
1388
1396
|
};
|
|
1389
|
-
return createMemo(indexArray(() => props.each, props.children, fallback
|
|
1397
|
+
return createMemo(indexArray(() => props.each, props.children, fallback || undefined), undefined, {
|
|
1398
|
+
name: "value"
|
|
1399
|
+
}) ;
|
|
1390
1400
|
}
|
|
1391
1401
|
function Show(props) {
|
|
1392
1402
|
let strictEqual = false;
|
|
1393
1403
|
const keyed = props.keyed;
|
|
1394
1404
|
const condition = createMemo(() => props.when, undefined, {
|
|
1395
|
-
equals: (a, b) => strictEqual ? a === b : !a === !b
|
|
1396
|
-
|
|
1405
|
+
equals: (a, b) => strictEqual ? a === b : !a === !b,
|
|
1406
|
+
name: "condition"
|
|
1407
|
+
} );
|
|
1397
1408
|
return createMemo(() => {
|
|
1398
1409
|
const c = condition();
|
|
1399
1410
|
if (c) {
|
|
@@ -1403,11 +1414,14 @@ function Show(props) {
|
|
|
1403
1414
|
return fn ? untrack(() => child(c)) : child;
|
|
1404
1415
|
}
|
|
1405
1416
|
return props.fallback;
|
|
1406
|
-
}
|
|
1417
|
+
}, undefined, {
|
|
1418
|
+
name: "value"
|
|
1419
|
+
} );
|
|
1407
1420
|
}
|
|
1408
1421
|
function Switch(props) {
|
|
1409
1422
|
let strictEqual = false;
|
|
1410
1423
|
let keyed = false;
|
|
1424
|
+
const equals = (a, b) => a[0] === b[0] && (strictEqual ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
|
|
1411
1425
|
const conditions = children(() => props.children),
|
|
1412
1426
|
evalConditions = createMemo(() => {
|
|
1413
1427
|
let conds = conditions();
|
|
@@ -1421,8 +1435,9 @@ function Switch(props) {
|
|
|
1421
1435
|
}
|
|
1422
1436
|
return [-1];
|
|
1423
1437
|
}, undefined, {
|
|
1424
|
-
equals
|
|
1425
|
-
|
|
1438
|
+
equals,
|
|
1439
|
+
name: "eval conditions"
|
|
1440
|
+
} );
|
|
1426
1441
|
return createMemo(() => {
|
|
1427
1442
|
const [index, when, cond] = evalConditions();
|
|
1428
1443
|
if (index < 0) return props.fallback;
|
|
@@ -1430,7 +1445,9 @@ function Switch(props) {
|
|
|
1430
1445
|
const fn = typeof c === "function" && c.length > 0;
|
|
1431
1446
|
strictEqual = keyed || fn;
|
|
1432
1447
|
return fn ? untrack(() => c(when)) : c;
|
|
1433
|
-
}
|
|
1448
|
+
}, undefined, {
|
|
1449
|
+
name: "value"
|
|
1450
|
+
} );
|
|
1434
1451
|
}
|
|
1435
1452
|
function Match(props) {
|
|
1436
1453
|
return props;
|
|
@@ -1443,7 +1460,9 @@ function ErrorBoundary(props) {
|
|
|
1443
1460
|
let err;
|
|
1444
1461
|
let v;
|
|
1445
1462
|
if (sharedConfig.context && sharedConfig.load && (v = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count))) err = v[0];
|
|
1446
|
-
const [errored, setErrored] = createSignal(err
|
|
1463
|
+
const [errored, setErrored] = createSignal(err, {
|
|
1464
|
+
name: "errored"
|
|
1465
|
+
} );
|
|
1447
1466
|
Errors || (Errors = new Set());
|
|
1448
1467
|
Errors.add(setErrored);
|
|
1449
1468
|
onCleanup(() => Errors.delete(setErrored));
|
|
@@ -1458,7 +1477,9 @@ function ErrorBoundary(props) {
|
|
|
1458
1477
|
}
|
|
1459
1478
|
onError(setErrored);
|
|
1460
1479
|
return props.children;
|
|
1461
|
-
}
|
|
1480
|
+
}, undefined, {
|
|
1481
|
+
name: "value"
|
|
1482
|
+
} );
|
|
1462
1483
|
}
|
|
1463
1484
|
|
|
1464
1485
|
const suspenseListEquals = (a, b) => a.showContent === b.showContent && a.showFallback === b.showFallback;
|
package/dist/server.cjs
CHANGED
|
@@ -291,7 +291,21 @@ function mergeProps(...sources) {
|
|
|
291
291
|
for (let i = 0; i < sources.length; i++) {
|
|
292
292
|
let source = sources[i];
|
|
293
293
|
if (typeof source === "function") source = source();
|
|
294
|
-
if (source)
|
|
294
|
+
if (source) {
|
|
295
|
+
const descriptors = Object.getOwnPropertyDescriptors(source);
|
|
296
|
+
for (const key in descriptors) {
|
|
297
|
+
if (key in target) continue;
|
|
298
|
+
Object.defineProperty(target, key, {
|
|
299
|
+
enumerable: true,
|
|
300
|
+
get() {
|
|
301
|
+
for (let i = sources.length - 1; i >= 0; i--) {
|
|
302
|
+
const v = (sources[i] || {})[key];
|
|
303
|
+
if (v !== undefined) return v;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
}
|
|
295
309
|
}
|
|
296
310
|
return target;
|
|
297
311
|
}
|
package/dist/server.js
CHANGED
|
@@ -287,7 +287,21 @@ function mergeProps(...sources) {
|
|
|
287
287
|
for (let i = 0; i < sources.length; i++) {
|
|
288
288
|
let source = sources[i];
|
|
289
289
|
if (typeof source === "function") source = source();
|
|
290
|
-
if (source)
|
|
290
|
+
if (source) {
|
|
291
|
+
const descriptors = Object.getOwnPropertyDescriptors(source);
|
|
292
|
+
for (const key in descriptors) {
|
|
293
|
+
if (key in target) continue;
|
|
294
|
+
Object.defineProperty(target, key, {
|
|
295
|
+
enumerable: true,
|
|
296
|
+
get() {
|
|
297
|
+
for (let i = sources.length - 1; i >= 0; i--) {
|
|
298
|
+
const v = (sources[i] || {})[key];
|
|
299
|
+
if (v !== undefined) return v;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
}
|
|
291
305
|
}
|
|
292
306
|
return target;
|
|
293
307
|
}
|
package/dist/solid.cjs
CHANGED
|
@@ -327,7 +327,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
327
327
|
refetching
|
|
328
328
|
}));
|
|
329
329
|
if (typeof p !== "object" || !(p && "then" in p)) {
|
|
330
|
-
loadEnd(pr, p);
|
|
330
|
+
loadEnd(pr, p, undefined, lookup);
|
|
331
331
|
return p;
|
|
332
332
|
}
|
|
333
333
|
pr = p;
|
|
@@ -337,7 +337,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
337
337
|
setState(resolved ? "refreshing" : "pending");
|
|
338
338
|
trigger();
|
|
339
339
|
}, false);
|
|
340
|
-
return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e)));
|
|
340
|
+
return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e), lookup));
|
|
341
341
|
}
|
|
342
342
|
Object.defineProperties(read, {
|
|
343
343
|
state: {
|
|
@@ -1296,13 +1296,13 @@ function For(props) {
|
|
|
1296
1296
|
const fallback = "fallback" in props && {
|
|
1297
1297
|
fallback: () => props.fallback
|
|
1298
1298
|
};
|
|
1299
|
-
return createMemo(mapArray(() => props.each, props.children, fallback
|
|
1299
|
+
return createMemo(mapArray(() => props.each, props.children, fallback || undefined));
|
|
1300
1300
|
}
|
|
1301
1301
|
function Index(props) {
|
|
1302
1302
|
const fallback = "fallback" in props && {
|
|
1303
1303
|
fallback: () => props.fallback
|
|
1304
1304
|
};
|
|
1305
|
-
return createMemo(indexArray(() => props.each, props.children, fallback
|
|
1305
|
+
return createMemo(indexArray(() => props.each, props.children, fallback || undefined));
|
|
1306
1306
|
}
|
|
1307
1307
|
function Show(props) {
|
|
1308
1308
|
let strictEqual = false;
|
|
@@ -1319,11 +1319,12 @@ function Show(props) {
|
|
|
1319
1319
|
return fn ? untrack(() => child(c)) : child;
|
|
1320
1320
|
}
|
|
1321
1321
|
return props.fallback;
|
|
1322
|
-
});
|
|
1322
|
+
}, undefined, undefined);
|
|
1323
1323
|
}
|
|
1324
1324
|
function Switch(props) {
|
|
1325
1325
|
let strictEqual = false;
|
|
1326
1326
|
let keyed = false;
|
|
1327
|
+
const equals = (a, b) => a[0] === b[0] && (strictEqual ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
|
|
1327
1328
|
const conditions = children(() => props.children),
|
|
1328
1329
|
evalConditions = createMemo(() => {
|
|
1329
1330
|
let conds = conditions();
|
|
@@ -1337,7 +1338,7 @@ function Switch(props) {
|
|
|
1337
1338
|
}
|
|
1338
1339
|
return [-1];
|
|
1339
1340
|
}, undefined, {
|
|
1340
|
-
equals
|
|
1341
|
+
equals
|
|
1341
1342
|
});
|
|
1342
1343
|
return createMemo(() => {
|
|
1343
1344
|
const [index, when, cond] = evalConditions();
|
|
@@ -1346,7 +1347,7 @@ function Switch(props) {
|
|
|
1346
1347
|
const fn = typeof c === "function" && c.length > 0;
|
|
1347
1348
|
strictEqual = keyed || fn;
|
|
1348
1349
|
return fn ? untrack(() => c(when)) : c;
|
|
1349
|
-
});
|
|
1350
|
+
}, undefined, undefined);
|
|
1350
1351
|
}
|
|
1351
1352
|
function Match(props) {
|
|
1352
1353
|
return props;
|
|
@@ -1359,7 +1360,7 @@ function ErrorBoundary(props) {
|
|
|
1359
1360
|
let err;
|
|
1360
1361
|
let v;
|
|
1361
1362
|
if (sharedConfig.context && sharedConfig.load && (v = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count))) err = v[0];
|
|
1362
|
-
const [errored, setErrored] = createSignal(err);
|
|
1363
|
+
const [errored, setErrored] = createSignal(err, undefined);
|
|
1363
1364
|
Errors || (Errors = new Set());
|
|
1364
1365
|
Errors.add(setErrored);
|
|
1365
1366
|
onCleanup(() => Errors.delete(setErrored));
|
|
@@ -1373,7 +1374,7 @@ function ErrorBoundary(props) {
|
|
|
1373
1374
|
}
|
|
1374
1375
|
onError(setErrored);
|
|
1375
1376
|
return props.children;
|
|
1376
|
-
});
|
|
1377
|
+
}, undefined, undefined);
|
|
1377
1378
|
}
|
|
1378
1379
|
|
|
1379
1380
|
const suspenseListEquals = (a, b) => a.showContent === b.showContent && a.showFallback === b.showFallback;
|
package/dist/solid.js
CHANGED
|
@@ -323,7 +323,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
323
323
|
refetching
|
|
324
324
|
}));
|
|
325
325
|
if (typeof p !== "object" || !(p && "then" in p)) {
|
|
326
|
-
loadEnd(pr, p);
|
|
326
|
+
loadEnd(pr, p, undefined, lookup);
|
|
327
327
|
return p;
|
|
328
328
|
}
|
|
329
329
|
pr = p;
|
|
@@ -333,7 +333,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
333
333
|
setState(resolved ? "refreshing" : "pending");
|
|
334
334
|
trigger();
|
|
335
335
|
}, false);
|
|
336
|
-
return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e)));
|
|
336
|
+
return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e), lookup));
|
|
337
337
|
}
|
|
338
338
|
Object.defineProperties(read, {
|
|
339
339
|
state: {
|
|
@@ -1292,13 +1292,13 @@ function For(props) {
|
|
|
1292
1292
|
const fallback = "fallback" in props && {
|
|
1293
1293
|
fallback: () => props.fallback
|
|
1294
1294
|
};
|
|
1295
|
-
return createMemo(mapArray(() => props.each, props.children, fallback
|
|
1295
|
+
return createMemo(mapArray(() => props.each, props.children, fallback || undefined));
|
|
1296
1296
|
}
|
|
1297
1297
|
function Index(props) {
|
|
1298
1298
|
const fallback = "fallback" in props && {
|
|
1299
1299
|
fallback: () => props.fallback
|
|
1300
1300
|
};
|
|
1301
|
-
return createMemo(indexArray(() => props.each, props.children, fallback
|
|
1301
|
+
return createMemo(indexArray(() => props.each, props.children, fallback || undefined));
|
|
1302
1302
|
}
|
|
1303
1303
|
function Show(props) {
|
|
1304
1304
|
let strictEqual = false;
|
|
@@ -1315,11 +1315,12 @@ function Show(props) {
|
|
|
1315
1315
|
return fn ? untrack(() => child(c)) : child;
|
|
1316
1316
|
}
|
|
1317
1317
|
return props.fallback;
|
|
1318
|
-
});
|
|
1318
|
+
}, undefined, undefined);
|
|
1319
1319
|
}
|
|
1320
1320
|
function Switch(props) {
|
|
1321
1321
|
let strictEqual = false;
|
|
1322
1322
|
let keyed = false;
|
|
1323
|
+
const equals = (a, b) => a[0] === b[0] && (strictEqual ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
|
|
1323
1324
|
const conditions = children(() => props.children),
|
|
1324
1325
|
evalConditions = createMemo(() => {
|
|
1325
1326
|
let conds = conditions();
|
|
@@ -1333,7 +1334,7 @@ function Switch(props) {
|
|
|
1333
1334
|
}
|
|
1334
1335
|
return [-1];
|
|
1335
1336
|
}, undefined, {
|
|
1336
|
-
equals
|
|
1337
|
+
equals
|
|
1337
1338
|
});
|
|
1338
1339
|
return createMemo(() => {
|
|
1339
1340
|
const [index, when, cond] = evalConditions();
|
|
@@ -1342,7 +1343,7 @@ function Switch(props) {
|
|
|
1342
1343
|
const fn = typeof c === "function" && c.length > 0;
|
|
1343
1344
|
strictEqual = keyed || fn;
|
|
1344
1345
|
return fn ? untrack(() => c(when)) : c;
|
|
1345
|
-
});
|
|
1346
|
+
}, undefined, undefined);
|
|
1346
1347
|
}
|
|
1347
1348
|
function Match(props) {
|
|
1348
1349
|
return props;
|
|
@@ -1355,7 +1356,7 @@ function ErrorBoundary(props) {
|
|
|
1355
1356
|
let err;
|
|
1356
1357
|
let v;
|
|
1357
1358
|
if (sharedConfig.context && sharedConfig.load && (v = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count))) err = v[0];
|
|
1358
|
-
const [errored, setErrored] = createSignal(err);
|
|
1359
|
+
const [errored, setErrored] = createSignal(err, undefined);
|
|
1359
1360
|
Errors || (Errors = new Set());
|
|
1360
1361
|
Errors.add(setErrored);
|
|
1361
1362
|
onCleanup(() => Errors.delete(setErrored));
|
|
@@ -1369,7 +1370,7 @@ function ErrorBoundary(props) {
|
|
|
1369
1370
|
}
|
|
1370
1371
|
onError(setErrored);
|
|
1371
1372
|
return props.children;
|
|
1372
|
-
});
|
|
1373
|
+
}, undefined, undefined);
|
|
1373
1374
|
}
|
|
1374
1375
|
|
|
1375
1376
|
const suspenseListEquals = (a, b) => a.showContent === b.showContent && a.showFallback === b.showFallback;
|
package/h/dist/h.cjs
CHANGED
|
@@ -8,6 +8,8 @@ function createHyperScript(r) {
|
|
|
8
8
|
let args = [].slice.call(arguments),
|
|
9
9
|
e,
|
|
10
10
|
multiExpression = false;
|
|
11
|
+
while (Array.isArray(args[0])) args = args[0];
|
|
12
|
+
if (args[0][$ELEMENT]) args.unshift(h.Fragment);
|
|
11
13
|
typeof args[0] === "string" && detectMultiExpression(args);
|
|
12
14
|
const ret = () => {
|
|
13
15
|
while (args.length) item(args.shift());
|
|
@@ -86,6 +88,7 @@ function createHyperScript(r) {
|
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
}
|
|
91
|
+
h.Fragment = props => props.children;
|
|
89
92
|
return h;
|
|
90
93
|
}
|
|
91
94
|
|
package/h/dist/h.js
CHANGED
|
@@ -6,6 +6,8 @@ function createHyperScript(r) {
|
|
|
6
6
|
let args = [].slice.call(arguments),
|
|
7
7
|
e,
|
|
8
8
|
multiExpression = false;
|
|
9
|
+
while (Array.isArray(args[0])) args = args[0];
|
|
10
|
+
if (args[0][$ELEMENT]) args.unshift(h.Fragment);
|
|
9
11
|
typeof args[0] === "string" && detectMultiExpression(args);
|
|
10
12
|
const ret = () => {
|
|
11
13
|
while (args.length) item(args.shift());
|
|
@@ -84,6 +86,7 @@ function createHyperScript(r) {
|
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
}
|
|
89
|
+
h.Fragment = props => props.children;
|
|
87
90
|
return h;
|
|
88
91
|
}
|
|
89
92
|
|
package/h/types/hyperscript.d.ts
CHANGED
|
@@ -12,6 +12,9 @@ declare type ExpandableNode = Node & {
|
|
|
12
12
|
};
|
|
13
13
|
export declare type HyperScript = {
|
|
14
14
|
(...args: any[]): () => ExpandableNode | ExpandableNode[];
|
|
15
|
+
Fragment: (props: {
|
|
16
|
+
children: (() => ExpandableNode) | (() => ExpandableNode)[];
|
|
17
|
+
}) => ExpandableNode[];
|
|
15
18
|
};
|
|
16
19
|
export declare function createHyperScript(r: Runtime): HyperScript;
|
|
17
20
|
export {};
|
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.6.
|
|
4
|
+
"version": "1.6.3",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"h/jsx-runtime/dist",
|
|
34
34
|
"h/jsx-runtime/types",
|
|
35
35
|
"h/jsx-runtime/package.json",
|
|
36
|
+
"h/jsx-dev-runtime/package.json",
|
|
36
37
|
"html/dist",
|
|
37
38
|
"html/types",
|
|
38
39
|
"html/package.json",
|
|
@@ -97,6 +98,10 @@
|
|
|
97
98
|
"types": "./types/jsx.d.ts",
|
|
98
99
|
"default": "./dist/solid.js"
|
|
99
100
|
},
|
|
101
|
+
"./jsx-dev-runtime": {
|
|
102
|
+
"types": "./types/jsx.d.ts",
|
|
103
|
+
"default": "./dist/solid.js"
|
|
104
|
+
},
|
|
100
105
|
"./store": {
|
|
101
106
|
"worker": {
|
|
102
107
|
"import": {
|
|
@@ -226,6 +231,13 @@
|
|
|
226
231
|
},
|
|
227
232
|
"require": "./h/jsx-runtime/dist/jsx.cjs"
|
|
228
233
|
},
|
|
234
|
+
"./h/jsx-dev-runtime": {
|
|
235
|
+
"import": {
|
|
236
|
+
"types": "./h/jsx-runtime/types/index.d.ts",
|
|
237
|
+
"default": "./h/jsx-runtime/dist/jsx.js"
|
|
238
|
+
},
|
|
239
|
+
"require": "./h/jsx-runtime/dist/jsx.cjs"
|
|
240
|
+
},
|
|
229
241
|
"./h/dist/*": "./h/dist/*",
|
|
230
242
|
"./html": {
|
|
231
243
|
"import": {
|
package/types/jsx.d.ts
CHANGED
|
@@ -727,6 +727,8 @@ export namespace JSX {
|
|
|
727
727
|
}
|
|
728
728
|
interface DialogHtmlAttributes<T> extends HTMLAttributes<T> {
|
|
729
729
|
open?: boolean;
|
|
730
|
+
onClose?: EventHandlerUnion<T, Event>;
|
|
731
|
+
onCancel?: EventHandlerUnion<T, Event>;
|
|
730
732
|
}
|
|
731
733
|
interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
732
734
|
height?: number | string;
|
|
@@ -2,7 +2,7 @@ import type { JSX } from "../jsx.js";
|
|
|
2
2
|
export declare function enableHydration(): void;
|
|
3
3
|
/**
|
|
4
4
|
* A general `Component` has no implicit `children` prop. If desired, you can
|
|
5
|
-
* specify one as in `Component<{name: String, children: JSX.Element
|
|
5
|
+
* specify one as in `Component<{name: String, children: JSX.Element}>`.
|
|
6
6
|
*/
|
|
7
7
|
export declare type Component<P = {}> = (props: P) => JSX.Element;
|
|
8
8
|
/**
|
package/web/dist/dev.cjs
CHANGED
|
@@ -358,14 +358,14 @@ function eventHandler(e) {
|
|
|
358
358
|
solidJs.sharedConfig.done = true;
|
|
359
359
|
document.querySelectorAll("[id^=pl-]").forEach(elem => elem.remove());
|
|
360
360
|
}
|
|
361
|
-
while (node
|
|
361
|
+
while (node) {
|
|
362
362
|
const handler = node[key];
|
|
363
363
|
if (handler && !node.disabled) {
|
|
364
364
|
const data = node[`${key}Data`];
|
|
365
365
|
data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
|
|
366
366
|
if (e.cancelBubble) return;
|
|
367
367
|
}
|
|
368
|
-
node = node.host
|
|
368
|
+
node = node._$host || node.parentNode || node.host;
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
371
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
@@ -557,7 +557,7 @@ function Portal(props) {
|
|
|
557
557
|
renderRoot = useShadow && container.attachShadow ? container.attachShadow({
|
|
558
558
|
mode: "open"
|
|
559
559
|
}) : container;
|
|
560
|
-
Object.defineProperty(container, "host", {
|
|
560
|
+
Object.defineProperty(container, "_$host", {
|
|
561
561
|
get() {
|
|
562
562
|
return marker.parentNode;
|
|
563
563
|
},
|
package/web/dist/dev.js
CHANGED
|
@@ -355,14 +355,14 @@ function eventHandler(e) {
|
|
|
355
355
|
sharedConfig.done = true;
|
|
356
356
|
document.querySelectorAll("[id^=pl-]").forEach(elem => elem.remove());
|
|
357
357
|
}
|
|
358
|
-
while (node
|
|
358
|
+
while (node) {
|
|
359
359
|
const handler = node[key];
|
|
360
360
|
if (handler && !node.disabled) {
|
|
361
361
|
const data = node[`${key}Data`];
|
|
362
362
|
data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
|
|
363
363
|
if (e.cancelBubble) return;
|
|
364
364
|
}
|
|
365
|
-
node = node.host
|
|
365
|
+
node = node._$host || node.parentNode || node.host;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
@@ -554,7 +554,7 @@ function Portal(props) {
|
|
|
554
554
|
renderRoot = useShadow && container.attachShadow ? container.attachShadow({
|
|
555
555
|
mode: "open"
|
|
556
556
|
}) : container;
|
|
557
|
-
Object.defineProperty(container, "host", {
|
|
557
|
+
Object.defineProperty(container, "_$host", {
|
|
558
558
|
get() {
|
|
559
559
|
return marker.parentNode;
|
|
560
560
|
},
|
package/web/dist/web.cjs
CHANGED
|
@@ -355,14 +355,14 @@ function eventHandler(e) {
|
|
|
355
355
|
solidJs.sharedConfig.done = true;
|
|
356
356
|
document.querySelectorAll("[id^=pl-]").forEach(elem => elem.remove());
|
|
357
357
|
}
|
|
358
|
-
while (node
|
|
358
|
+
while (node) {
|
|
359
359
|
const handler = node[key];
|
|
360
360
|
if (handler && !node.disabled) {
|
|
361
361
|
const data = node[`${key}Data`];
|
|
362
362
|
data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
|
|
363
363
|
if (e.cancelBubble) return;
|
|
364
364
|
}
|
|
365
|
-
node = node.host
|
|
365
|
+
node = node._$host || node.parentNode || node.host;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
@@ -554,7 +554,7 @@ function Portal(props) {
|
|
|
554
554
|
renderRoot = useShadow && container.attachShadow ? container.attachShadow({
|
|
555
555
|
mode: "open"
|
|
556
556
|
}) : container;
|
|
557
|
-
Object.defineProperty(container, "host", {
|
|
557
|
+
Object.defineProperty(container, "_$host", {
|
|
558
558
|
get() {
|
|
559
559
|
return marker.parentNode;
|
|
560
560
|
},
|
package/web/dist/web.js
CHANGED
|
@@ -352,14 +352,14 @@ function eventHandler(e) {
|
|
|
352
352
|
sharedConfig.done = true;
|
|
353
353
|
document.querySelectorAll("[id^=pl-]").forEach(elem => elem.remove());
|
|
354
354
|
}
|
|
355
|
-
while (node
|
|
355
|
+
while (node) {
|
|
356
356
|
const handler = node[key];
|
|
357
357
|
if (handler && !node.disabled) {
|
|
358
358
|
const data = node[`${key}Data`];
|
|
359
359
|
data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
|
|
360
360
|
if (e.cancelBubble) return;
|
|
361
361
|
}
|
|
362
|
-
node = node.host
|
|
362
|
+
node = node._$host || node.parentNode || node.host;
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
@@ -551,7 +551,7 @@ function Portal(props) {
|
|
|
551
551
|
renderRoot = useShadow && container.attachShadow ? container.attachShadow({
|
|
552
552
|
mode: "open"
|
|
553
553
|
}) : container;
|
|
554
|
-
Object.defineProperty(container, "host", {
|
|
554
|
+
Object.defineProperty(container, "_$host", {
|
|
555
555
|
get() {
|
|
556
556
|
return marker.parentNode;
|
|
557
557
|
},
|