solid-js 1.6.2 → 1.6.4
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 +43 -19
- package/dist/dev.js +43 -19
- package/dist/server.cjs +17 -1
- package/dist/server.js +17 -1
- package/dist/solid.cjs +17 -13
- package/dist/solid.js +17 -13
- 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
|
}
|
|
@@ -1260,7 +1266,13 @@ function resolveSource(s) {
|
|
|
1260
1266
|
return !(s = typeof s === "function" ? s() : s) ? {} : s;
|
|
1261
1267
|
}
|
|
1262
1268
|
function mergeProps(...sources) {
|
|
1263
|
-
|
|
1269
|
+
let proxy = false;
|
|
1270
|
+
for (let i = 0; i < sources.length; i++) {
|
|
1271
|
+
const s = sources[i];
|
|
1272
|
+
proxy ||= !!s && $PROXY in s;
|
|
1273
|
+
sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
|
|
1274
|
+
}
|
|
1275
|
+
if (proxy) {
|
|
1264
1276
|
return new Proxy({
|
|
1265
1277
|
get(property) {
|
|
1266
1278
|
for (let i = sources.length - 1; i >= 0; i--) {
|
|
@@ -1354,9 +1366,6 @@ function lazy(fn) {
|
|
|
1354
1366
|
} else if (!comp) {
|
|
1355
1367
|
const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));
|
|
1356
1368
|
comp = s;
|
|
1357
|
-
} else {
|
|
1358
|
-
const c = comp();
|
|
1359
|
-
if (c) return c(props);
|
|
1360
1369
|
}
|
|
1361
1370
|
let Comp;
|
|
1362
1371
|
return createMemo(() => (Comp = comp()) && untrack(() => {
|
|
@@ -1384,20 +1393,25 @@ function For(props) {
|
|
|
1384
1393
|
const fallback = "fallback" in props && {
|
|
1385
1394
|
fallback: () => props.fallback
|
|
1386
1395
|
};
|
|
1387
|
-
return createMemo(mapArray(() => props.each, props.children, fallback
|
|
1396
|
+
return createMemo(mapArray(() => props.each, props.children, fallback || undefined), undefined, {
|
|
1397
|
+
name: "value"
|
|
1398
|
+
}) ;
|
|
1388
1399
|
}
|
|
1389
1400
|
function Index(props) {
|
|
1390
1401
|
const fallback = "fallback" in props && {
|
|
1391
1402
|
fallback: () => props.fallback
|
|
1392
1403
|
};
|
|
1393
|
-
return createMemo(indexArray(() => props.each, props.children, fallback
|
|
1404
|
+
return createMemo(indexArray(() => props.each, props.children, fallback || undefined), undefined, {
|
|
1405
|
+
name: "value"
|
|
1406
|
+
}) ;
|
|
1394
1407
|
}
|
|
1395
1408
|
function Show(props) {
|
|
1396
1409
|
let strictEqual = false;
|
|
1397
1410
|
const keyed = props.keyed;
|
|
1398
1411
|
const condition = createMemo(() => props.when, undefined, {
|
|
1399
|
-
equals: (a, b) => strictEqual ? a === b : !a === !b
|
|
1400
|
-
|
|
1412
|
+
equals: (a, b) => strictEqual ? a === b : !a === !b,
|
|
1413
|
+
name: "condition"
|
|
1414
|
+
} );
|
|
1401
1415
|
return createMemo(() => {
|
|
1402
1416
|
const c = condition();
|
|
1403
1417
|
if (c) {
|
|
@@ -1407,11 +1421,14 @@ function Show(props) {
|
|
|
1407
1421
|
return fn ? untrack(() => child(c)) : child;
|
|
1408
1422
|
}
|
|
1409
1423
|
return props.fallback;
|
|
1410
|
-
}
|
|
1424
|
+
}, undefined, {
|
|
1425
|
+
name: "value"
|
|
1426
|
+
} );
|
|
1411
1427
|
}
|
|
1412
1428
|
function Switch(props) {
|
|
1413
1429
|
let strictEqual = false;
|
|
1414
1430
|
let keyed = false;
|
|
1431
|
+
const equals = (a, b) => a[0] === b[0] && (strictEqual ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
|
|
1415
1432
|
const conditions = children(() => props.children),
|
|
1416
1433
|
evalConditions = createMemo(() => {
|
|
1417
1434
|
let conds = conditions();
|
|
@@ -1425,8 +1442,9 @@ function Switch(props) {
|
|
|
1425
1442
|
}
|
|
1426
1443
|
return [-1];
|
|
1427
1444
|
}, undefined, {
|
|
1428
|
-
equals
|
|
1429
|
-
|
|
1445
|
+
equals,
|
|
1446
|
+
name: "eval conditions"
|
|
1447
|
+
} );
|
|
1430
1448
|
return createMemo(() => {
|
|
1431
1449
|
const [index, when, cond] = evalConditions();
|
|
1432
1450
|
if (index < 0) return props.fallback;
|
|
@@ -1434,7 +1452,9 @@ function Switch(props) {
|
|
|
1434
1452
|
const fn = typeof c === "function" && c.length > 0;
|
|
1435
1453
|
strictEqual = keyed || fn;
|
|
1436
1454
|
return fn ? untrack(() => c(when)) : c;
|
|
1437
|
-
}
|
|
1455
|
+
}, undefined, {
|
|
1456
|
+
name: "value"
|
|
1457
|
+
} );
|
|
1438
1458
|
}
|
|
1439
1459
|
function Match(props) {
|
|
1440
1460
|
return props;
|
|
@@ -1447,7 +1467,9 @@ function ErrorBoundary(props) {
|
|
|
1447
1467
|
let err;
|
|
1448
1468
|
let v;
|
|
1449
1469
|
if (sharedConfig.context && sharedConfig.load && (v = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count))) err = v[0];
|
|
1450
|
-
const [errored, setErrored] = createSignal(err
|
|
1470
|
+
const [errored, setErrored] = createSignal(err, {
|
|
1471
|
+
name: "errored"
|
|
1472
|
+
} );
|
|
1451
1473
|
Errors || (Errors = new Set());
|
|
1452
1474
|
Errors.add(setErrored);
|
|
1453
1475
|
onCleanup(() => Errors.delete(setErrored));
|
|
@@ -1462,7 +1484,9 @@ function ErrorBoundary(props) {
|
|
|
1462
1484
|
}
|
|
1463
1485
|
onError(setErrored);
|
|
1464
1486
|
return props.children;
|
|
1465
|
-
}
|
|
1487
|
+
}, undefined, {
|
|
1488
|
+
name: "value"
|
|
1489
|
+
} );
|
|
1466
1490
|
}
|
|
1467
1491
|
|
|
1468
1492
|
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
|
}
|
|
@@ -1256,7 +1262,13 @@ function resolveSource(s) {
|
|
|
1256
1262
|
return !(s = typeof s === "function" ? s() : s) ? {} : s;
|
|
1257
1263
|
}
|
|
1258
1264
|
function mergeProps(...sources) {
|
|
1259
|
-
|
|
1265
|
+
let proxy = false;
|
|
1266
|
+
for (let i = 0; i < sources.length; i++) {
|
|
1267
|
+
const s = sources[i];
|
|
1268
|
+
proxy ||= !!s && $PROXY in s;
|
|
1269
|
+
sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
|
|
1270
|
+
}
|
|
1271
|
+
if (proxy) {
|
|
1260
1272
|
return new Proxy({
|
|
1261
1273
|
get(property) {
|
|
1262
1274
|
for (let i = sources.length - 1; i >= 0; i--) {
|
|
@@ -1350,9 +1362,6 @@ function lazy(fn) {
|
|
|
1350
1362
|
} else if (!comp) {
|
|
1351
1363
|
const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));
|
|
1352
1364
|
comp = s;
|
|
1353
|
-
} else {
|
|
1354
|
-
const c = comp();
|
|
1355
|
-
if (c) return c(props);
|
|
1356
1365
|
}
|
|
1357
1366
|
let Comp;
|
|
1358
1367
|
return createMemo(() => (Comp = comp()) && untrack(() => {
|
|
@@ -1380,20 +1389,25 @@ function For(props) {
|
|
|
1380
1389
|
const fallback = "fallback" in props && {
|
|
1381
1390
|
fallback: () => props.fallback
|
|
1382
1391
|
};
|
|
1383
|
-
return createMemo(mapArray(() => props.each, props.children, fallback
|
|
1392
|
+
return createMemo(mapArray(() => props.each, props.children, fallback || undefined), undefined, {
|
|
1393
|
+
name: "value"
|
|
1394
|
+
}) ;
|
|
1384
1395
|
}
|
|
1385
1396
|
function Index(props) {
|
|
1386
1397
|
const fallback = "fallback" in props && {
|
|
1387
1398
|
fallback: () => props.fallback
|
|
1388
1399
|
};
|
|
1389
|
-
return createMemo(indexArray(() => props.each, props.children, fallback
|
|
1400
|
+
return createMemo(indexArray(() => props.each, props.children, fallback || undefined), undefined, {
|
|
1401
|
+
name: "value"
|
|
1402
|
+
}) ;
|
|
1390
1403
|
}
|
|
1391
1404
|
function Show(props) {
|
|
1392
1405
|
let strictEqual = false;
|
|
1393
1406
|
const keyed = props.keyed;
|
|
1394
1407
|
const condition = createMemo(() => props.when, undefined, {
|
|
1395
|
-
equals: (a, b) => strictEqual ? a === b : !a === !b
|
|
1396
|
-
|
|
1408
|
+
equals: (a, b) => strictEqual ? a === b : !a === !b,
|
|
1409
|
+
name: "condition"
|
|
1410
|
+
} );
|
|
1397
1411
|
return createMemo(() => {
|
|
1398
1412
|
const c = condition();
|
|
1399
1413
|
if (c) {
|
|
@@ -1403,11 +1417,14 @@ function Show(props) {
|
|
|
1403
1417
|
return fn ? untrack(() => child(c)) : child;
|
|
1404
1418
|
}
|
|
1405
1419
|
return props.fallback;
|
|
1406
|
-
}
|
|
1420
|
+
}, undefined, {
|
|
1421
|
+
name: "value"
|
|
1422
|
+
} );
|
|
1407
1423
|
}
|
|
1408
1424
|
function Switch(props) {
|
|
1409
1425
|
let strictEqual = false;
|
|
1410
1426
|
let keyed = false;
|
|
1427
|
+
const equals = (a, b) => a[0] === b[0] && (strictEqual ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
|
|
1411
1428
|
const conditions = children(() => props.children),
|
|
1412
1429
|
evalConditions = createMemo(() => {
|
|
1413
1430
|
let conds = conditions();
|
|
@@ -1421,8 +1438,9 @@ function Switch(props) {
|
|
|
1421
1438
|
}
|
|
1422
1439
|
return [-1];
|
|
1423
1440
|
}, undefined, {
|
|
1424
|
-
equals
|
|
1425
|
-
|
|
1441
|
+
equals,
|
|
1442
|
+
name: "eval conditions"
|
|
1443
|
+
} );
|
|
1426
1444
|
return createMemo(() => {
|
|
1427
1445
|
const [index, when, cond] = evalConditions();
|
|
1428
1446
|
if (index < 0) return props.fallback;
|
|
@@ -1430,7 +1448,9 @@ function Switch(props) {
|
|
|
1430
1448
|
const fn = typeof c === "function" && c.length > 0;
|
|
1431
1449
|
strictEqual = keyed || fn;
|
|
1432
1450
|
return fn ? untrack(() => c(when)) : c;
|
|
1433
|
-
}
|
|
1451
|
+
}, undefined, {
|
|
1452
|
+
name: "value"
|
|
1453
|
+
} );
|
|
1434
1454
|
}
|
|
1435
1455
|
function Match(props) {
|
|
1436
1456
|
return props;
|
|
@@ -1443,7 +1463,9 @@ function ErrorBoundary(props) {
|
|
|
1443
1463
|
let err;
|
|
1444
1464
|
let v;
|
|
1445
1465
|
if (sharedConfig.context && sharedConfig.load && (v = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count))) err = v[0];
|
|
1446
|
-
const [errored, setErrored] = createSignal(err
|
|
1466
|
+
const [errored, setErrored] = createSignal(err, {
|
|
1467
|
+
name: "errored"
|
|
1468
|
+
} );
|
|
1447
1469
|
Errors || (Errors = new Set());
|
|
1448
1470
|
Errors.add(setErrored);
|
|
1449
1471
|
onCleanup(() => Errors.delete(setErrored));
|
|
@@ -1458,7 +1480,9 @@ function ErrorBoundary(props) {
|
|
|
1458
1480
|
}
|
|
1459
1481
|
onError(setErrored);
|
|
1460
1482
|
return props.children;
|
|
1461
|
-
}
|
|
1483
|
+
}, undefined, {
|
|
1484
|
+
name: "value"
|
|
1485
|
+
} );
|
|
1462
1486
|
}
|
|
1463
1487
|
|
|
1464
1488
|
const suspenseListEquals = (a, b) => a.showContent === b.showContent && a.showFallback === b.showFallback;
|
package/dist/server.cjs
CHANGED
|
@@ -291,7 +291,23 @@ 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
|
+
let s = sources[i] || {};
|
|
303
|
+
if (typeof s === "function") s = s();
|
|
304
|
+
const v = s[key];
|
|
305
|
+
if (v !== undefined) return v;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
295
311
|
}
|
|
296
312
|
return target;
|
|
297
313
|
}
|
package/dist/server.js
CHANGED
|
@@ -287,7 +287,23 @@ 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
|
+
let s = sources[i] || {};
|
|
299
|
+
if (typeof s === "function") s = s();
|
|
300
|
+
const v = s[key];
|
|
301
|
+
if (v !== undefined) return v;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}
|
|
291
307
|
}
|
|
292
308
|
return target;
|
|
293
309
|
}
|
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: {
|
|
@@ -1174,7 +1174,13 @@ function resolveSource(s) {
|
|
|
1174
1174
|
return !(s = typeof s === "function" ? s() : s) ? {} : s;
|
|
1175
1175
|
}
|
|
1176
1176
|
function mergeProps(...sources) {
|
|
1177
|
-
|
|
1177
|
+
let proxy = false;
|
|
1178
|
+
for (let i = 0; i < sources.length; i++) {
|
|
1179
|
+
const s = sources[i];
|
|
1180
|
+
proxy ||= !!s && $PROXY in s;
|
|
1181
|
+
sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
|
|
1182
|
+
}
|
|
1183
|
+
if (proxy) {
|
|
1178
1184
|
return new Proxy({
|
|
1179
1185
|
get(property) {
|
|
1180
1186
|
for (let i = sources.length - 1; i >= 0; i--) {
|
|
@@ -1268,9 +1274,6 @@ function lazy(fn) {
|
|
|
1268
1274
|
} else if (!comp) {
|
|
1269
1275
|
const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));
|
|
1270
1276
|
comp = s;
|
|
1271
|
-
} else {
|
|
1272
|
-
const c = comp();
|
|
1273
|
-
if (c) return c(props);
|
|
1274
1277
|
}
|
|
1275
1278
|
let Comp;
|
|
1276
1279
|
return createMemo(() => (Comp = comp()) && untrack(() => {
|
|
@@ -1296,13 +1299,13 @@ function For(props) {
|
|
|
1296
1299
|
const fallback = "fallback" in props && {
|
|
1297
1300
|
fallback: () => props.fallback
|
|
1298
1301
|
};
|
|
1299
|
-
return createMemo(mapArray(() => props.each, props.children, fallback
|
|
1302
|
+
return createMemo(mapArray(() => props.each, props.children, fallback || undefined));
|
|
1300
1303
|
}
|
|
1301
1304
|
function Index(props) {
|
|
1302
1305
|
const fallback = "fallback" in props && {
|
|
1303
1306
|
fallback: () => props.fallback
|
|
1304
1307
|
};
|
|
1305
|
-
return createMemo(indexArray(() => props.each, props.children, fallback
|
|
1308
|
+
return createMemo(indexArray(() => props.each, props.children, fallback || undefined));
|
|
1306
1309
|
}
|
|
1307
1310
|
function Show(props) {
|
|
1308
1311
|
let strictEqual = false;
|
|
@@ -1319,11 +1322,12 @@ function Show(props) {
|
|
|
1319
1322
|
return fn ? untrack(() => child(c)) : child;
|
|
1320
1323
|
}
|
|
1321
1324
|
return props.fallback;
|
|
1322
|
-
});
|
|
1325
|
+
}, undefined, undefined);
|
|
1323
1326
|
}
|
|
1324
1327
|
function Switch(props) {
|
|
1325
1328
|
let strictEqual = false;
|
|
1326
1329
|
let keyed = false;
|
|
1330
|
+
const equals = (a, b) => a[0] === b[0] && (strictEqual ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
|
|
1327
1331
|
const conditions = children(() => props.children),
|
|
1328
1332
|
evalConditions = createMemo(() => {
|
|
1329
1333
|
let conds = conditions();
|
|
@@ -1337,7 +1341,7 @@ function Switch(props) {
|
|
|
1337
1341
|
}
|
|
1338
1342
|
return [-1];
|
|
1339
1343
|
}, undefined, {
|
|
1340
|
-
equals
|
|
1344
|
+
equals
|
|
1341
1345
|
});
|
|
1342
1346
|
return createMemo(() => {
|
|
1343
1347
|
const [index, when, cond] = evalConditions();
|
|
@@ -1346,7 +1350,7 @@ function Switch(props) {
|
|
|
1346
1350
|
const fn = typeof c === "function" && c.length > 0;
|
|
1347
1351
|
strictEqual = keyed || fn;
|
|
1348
1352
|
return fn ? untrack(() => c(when)) : c;
|
|
1349
|
-
});
|
|
1353
|
+
}, undefined, undefined);
|
|
1350
1354
|
}
|
|
1351
1355
|
function Match(props) {
|
|
1352
1356
|
return props;
|
|
@@ -1359,7 +1363,7 @@ function ErrorBoundary(props) {
|
|
|
1359
1363
|
let err;
|
|
1360
1364
|
let v;
|
|
1361
1365
|
if (sharedConfig.context && sharedConfig.load && (v = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count))) err = v[0];
|
|
1362
|
-
const [errored, setErrored] = createSignal(err);
|
|
1366
|
+
const [errored, setErrored] = createSignal(err, undefined);
|
|
1363
1367
|
Errors || (Errors = new Set());
|
|
1364
1368
|
Errors.add(setErrored);
|
|
1365
1369
|
onCleanup(() => Errors.delete(setErrored));
|
|
@@ -1373,7 +1377,7 @@ function ErrorBoundary(props) {
|
|
|
1373
1377
|
}
|
|
1374
1378
|
onError(setErrored);
|
|
1375
1379
|
return props.children;
|
|
1376
|
-
});
|
|
1380
|
+
}, undefined, undefined);
|
|
1377
1381
|
}
|
|
1378
1382
|
|
|
1379
1383
|
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: {
|
|
@@ -1170,7 +1170,13 @@ function resolveSource(s) {
|
|
|
1170
1170
|
return !(s = typeof s === "function" ? s() : s) ? {} : s;
|
|
1171
1171
|
}
|
|
1172
1172
|
function mergeProps(...sources) {
|
|
1173
|
-
|
|
1173
|
+
let proxy = false;
|
|
1174
|
+
for (let i = 0; i < sources.length; i++) {
|
|
1175
|
+
const s = sources[i];
|
|
1176
|
+
proxy ||= !!s && $PROXY in s;
|
|
1177
|
+
sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
|
|
1178
|
+
}
|
|
1179
|
+
if (proxy) {
|
|
1174
1180
|
return new Proxy({
|
|
1175
1181
|
get(property) {
|
|
1176
1182
|
for (let i = sources.length - 1; i >= 0; i--) {
|
|
@@ -1264,9 +1270,6 @@ function lazy(fn) {
|
|
|
1264
1270
|
} else if (!comp) {
|
|
1265
1271
|
const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));
|
|
1266
1272
|
comp = s;
|
|
1267
|
-
} else {
|
|
1268
|
-
const c = comp();
|
|
1269
|
-
if (c) return c(props);
|
|
1270
1273
|
}
|
|
1271
1274
|
let Comp;
|
|
1272
1275
|
return createMemo(() => (Comp = comp()) && untrack(() => {
|
|
@@ -1292,13 +1295,13 @@ function For(props) {
|
|
|
1292
1295
|
const fallback = "fallback" in props && {
|
|
1293
1296
|
fallback: () => props.fallback
|
|
1294
1297
|
};
|
|
1295
|
-
return createMemo(mapArray(() => props.each, props.children, fallback
|
|
1298
|
+
return createMemo(mapArray(() => props.each, props.children, fallback || undefined));
|
|
1296
1299
|
}
|
|
1297
1300
|
function Index(props) {
|
|
1298
1301
|
const fallback = "fallback" in props && {
|
|
1299
1302
|
fallback: () => props.fallback
|
|
1300
1303
|
};
|
|
1301
|
-
return createMemo(indexArray(() => props.each, props.children, fallback
|
|
1304
|
+
return createMemo(indexArray(() => props.each, props.children, fallback || undefined));
|
|
1302
1305
|
}
|
|
1303
1306
|
function Show(props) {
|
|
1304
1307
|
let strictEqual = false;
|
|
@@ -1315,11 +1318,12 @@ function Show(props) {
|
|
|
1315
1318
|
return fn ? untrack(() => child(c)) : child;
|
|
1316
1319
|
}
|
|
1317
1320
|
return props.fallback;
|
|
1318
|
-
});
|
|
1321
|
+
}, undefined, undefined);
|
|
1319
1322
|
}
|
|
1320
1323
|
function Switch(props) {
|
|
1321
1324
|
let strictEqual = false;
|
|
1322
1325
|
let keyed = false;
|
|
1326
|
+
const equals = (a, b) => a[0] === b[0] && (strictEqual ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
|
|
1323
1327
|
const conditions = children(() => props.children),
|
|
1324
1328
|
evalConditions = createMemo(() => {
|
|
1325
1329
|
let conds = conditions();
|
|
@@ -1333,7 +1337,7 @@ function Switch(props) {
|
|
|
1333
1337
|
}
|
|
1334
1338
|
return [-1];
|
|
1335
1339
|
}, undefined, {
|
|
1336
|
-
equals
|
|
1340
|
+
equals
|
|
1337
1341
|
});
|
|
1338
1342
|
return createMemo(() => {
|
|
1339
1343
|
const [index, when, cond] = evalConditions();
|
|
@@ -1342,7 +1346,7 @@ function Switch(props) {
|
|
|
1342
1346
|
const fn = typeof c === "function" && c.length > 0;
|
|
1343
1347
|
strictEqual = keyed || fn;
|
|
1344
1348
|
return fn ? untrack(() => c(when)) : c;
|
|
1345
|
-
});
|
|
1349
|
+
}, undefined, undefined);
|
|
1346
1350
|
}
|
|
1347
1351
|
function Match(props) {
|
|
1348
1352
|
return props;
|
|
@@ -1355,7 +1359,7 @@ function ErrorBoundary(props) {
|
|
|
1355
1359
|
let err;
|
|
1356
1360
|
let v;
|
|
1357
1361
|
if (sharedConfig.context && sharedConfig.load && (v = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count))) err = v[0];
|
|
1358
|
-
const [errored, setErrored] = createSignal(err);
|
|
1362
|
+
const [errored, setErrored] = createSignal(err, undefined);
|
|
1359
1363
|
Errors || (Errors = new Set());
|
|
1360
1364
|
Errors.add(setErrored);
|
|
1361
1365
|
onCleanup(() => Errors.delete(setErrored));
|
|
@@ -1369,7 +1373,7 @@ function ErrorBoundary(props) {
|
|
|
1369
1373
|
}
|
|
1370
1374
|
onError(setErrored);
|
|
1371
1375
|
return props.children;
|
|
1372
|
-
});
|
|
1376
|
+
}, undefined, undefined);
|
|
1373
1377
|
}
|
|
1374
1378
|
|
|
1375
1379
|
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.4",
|
|
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
|
},
|