solid-js 1.7.0-beta.4 → 1.7.0-beta.5
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 +9 -2
- package/dist/dev.js +9 -2
- package/dist/server.cjs +3 -3
- package/dist/server.js +3 -3
- package/dist/solid.cjs +9 -2
- package/dist/solid.js +9 -2
- package/package.json +3 -3
- package/types/jsx.d.ts +3 -0
package/dist/dev.cjs
CHANGED
|
@@ -1400,6 +1400,7 @@ function createUniqueId() {
|
|
|
1400
1400
|
return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
|
|
1401
1401
|
}
|
|
1402
1402
|
|
|
1403
|
+
const narrowedError = name => `Attempting to access a stale value from <${name}> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.` ;
|
|
1403
1404
|
function For(props) {
|
|
1404
1405
|
const fallback = "fallback" in props && {
|
|
1405
1406
|
fallback: () => props.fallback
|
|
@@ -1427,7 +1428,10 @@ function Show(props) {
|
|
|
1427
1428
|
if (c) {
|
|
1428
1429
|
const child = props.children;
|
|
1429
1430
|
const fn = typeof child === "function" && child.length > 0;
|
|
1430
|
-
return fn ? untrack(() => child(keyed ? c :
|
|
1431
|
+
return fn ? untrack(() => child(keyed ? c : () => {
|
|
1432
|
+
if (!untrack(condition)) throw narrowedError("Show");
|
|
1433
|
+
return props.when;
|
|
1434
|
+
})) : child;
|
|
1431
1435
|
}
|
|
1432
1436
|
return props.fallback;
|
|
1433
1437
|
}, undefined, {
|
|
@@ -1458,7 +1462,10 @@ function Switch(props) {
|
|
|
1458
1462
|
if (index < 0) return props.fallback;
|
|
1459
1463
|
const c = cond.children;
|
|
1460
1464
|
const fn = typeof c === "function" && c.length > 0;
|
|
1461
|
-
return fn ? untrack(() => c(keyed ? when :
|
|
1465
|
+
return fn ? untrack(() => c(keyed ? when : () => {
|
|
1466
|
+
if (untrack(evalConditions)[0] !== index) throw narrowedError("Match");
|
|
1467
|
+
return cond.when;
|
|
1468
|
+
})) : c;
|
|
1462
1469
|
}, undefined, {
|
|
1463
1470
|
name: "value"
|
|
1464
1471
|
} );
|
package/dist/dev.js
CHANGED
|
@@ -1398,6 +1398,7 @@ function createUniqueId() {
|
|
|
1398
1398
|
return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
|
|
1399
1399
|
}
|
|
1400
1400
|
|
|
1401
|
+
const narrowedError = name => `Attempting to access a stale value from <${name}> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.` ;
|
|
1401
1402
|
function For(props) {
|
|
1402
1403
|
const fallback = "fallback" in props && {
|
|
1403
1404
|
fallback: () => props.fallback
|
|
@@ -1425,7 +1426,10 @@ function Show(props) {
|
|
|
1425
1426
|
if (c) {
|
|
1426
1427
|
const child = props.children;
|
|
1427
1428
|
const fn = typeof child === "function" && child.length > 0;
|
|
1428
|
-
return fn ? untrack(() => child(keyed ? c :
|
|
1429
|
+
return fn ? untrack(() => child(keyed ? c : () => {
|
|
1430
|
+
if (!untrack(condition)) throw narrowedError("Show");
|
|
1431
|
+
return props.when;
|
|
1432
|
+
})) : child;
|
|
1429
1433
|
}
|
|
1430
1434
|
return props.fallback;
|
|
1431
1435
|
}, undefined, {
|
|
@@ -1456,7 +1460,10 @@ function Switch(props) {
|
|
|
1456
1460
|
if (index < 0) return props.fallback;
|
|
1457
1461
|
const c = cond.children;
|
|
1458
1462
|
const fn = typeof c === "function" && c.length > 0;
|
|
1459
|
-
return fn ? untrack(() => c(keyed ? when :
|
|
1463
|
+
return fn ? untrack(() => c(keyed ? when : () => {
|
|
1464
|
+
if (untrack(evalConditions)[0] !== index) throw narrowedError("Match");
|
|
1465
|
+
return cond.when;
|
|
1466
|
+
})) : c;
|
|
1460
1467
|
}, undefined, {
|
|
1461
1468
|
name: "value"
|
|
1462
1469
|
} );
|
package/dist/server.cjs
CHANGED
|
@@ -601,9 +601,9 @@ function Suspense(props) {
|
|
|
601
601
|
});
|
|
602
602
|
function suspenseError(err) {
|
|
603
603
|
if (!done || !done(undefined, err)) {
|
|
604
|
-
|
|
604
|
+
runWithOwner(o.owner, () => {
|
|
605
605
|
throw err;
|
|
606
|
-
});
|
|
606
|
+
});
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
609
|
function runSuspense() {
|
|
@@ -611,7 +611,7 @@ function Suspense(props) {
|
|
|
611
611
|
...ctx,
|
|
612
612
|
count: 0
|
|
613
613
|
});
|
|
614
|
-
|
|
614
|
+
cleanNode(o);
|
|
615
615
|
return runWithOwner(o, () => createComponent(SuspenseContext.Provider, {
|
|
616
616
|
value,
|
|
617
617
|
get children() {
|
package/dist/server.js
CHANGED
|
@@ -599,9 +599,9 @@ function Suspense(props) {
|
|
|
599
599
|
});
|
|
600
600
|
function suspenseError(err) {
|
|
601
601
|
if (!done || !done(undefined, err)) {
|
|
602
|
-
|
|
602
|
+
runWithOwner(o.owner, () => {
|
|
603
603
|
throw err;
|
|
604
|
-
});
|
|
604
|
+
});
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
607
|
function runSuspense() {
|
|
@@ -609,7 +609,7 @@ function Suspense(props) {
|
|
|
609
609
|
...ctx,
|
|
610
610
|
count: 0
|
|
611
611
|
});
|
|
612
|
-
|
|
612
|
+
cleanNode(o);
|
|
613
613
|
return runWithOwner(o, () => createComponent(SuspenseContext.Provider, {
|
|
614
614
|
value,
|
|
615
615
|
get children() {
|
package/dist/solid.cjs
CHANGED
|
@@ -1353,6 +1353,7 @@ function createUniqueId() {
|
|
|
1353
1353
|
return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
|
|
1354
1354
|
}
|
|
1355
1355
|
|
|
1356
|
+
const narrowedError = name => `Stale read from <${name}>.`;
|
|
1356
1357
|
function For(props) {
|
|
1357
1358
|
const fallback = "fallback" in props && {
|
|
1358
1359
|
fallback: () => props.fallback
|
|
@@ -1375,7 +1376,10 @@ function Show(props) {
|
|
|
1375
1376
|
if (c) {
|
|
1376
1377
|
const child = props.children;
|
|
1377
1378
|
const fn = typeof child === "function" && child.length > 0;
|
|
1378
|
-
return fn ? untrack(() => child(keyed ? c :
|
|
1379
|
+
return fn ? untrack(() => child(keyed ? c : () => {
|
|
1380
|
+
if (!untrack(condition)) throw narrowedError("Show");
|
|
1381
|
+
return props.when;
|
|
1382
|
+
})) : child;
|
|
1379
1383
|
}
|
|
1380
1384
|
return props.fallback;
|
|
1381
1385
|
}, undefined, undefined);
|
|
@@ -1403,7 +1407,10 @@ function Switch(props) {
|
|
|
1403
1407
|
if (index < 0) return props.fallback;
|
|
1404
1408
|
const c = cond.children;
|
|
1405
1409
|
const fn = typeof c === "function" && c.length > 0;
|
|
1406
|
-
return fn ? untrack(() => c(keyed ? when :
|
|
1410
|
+
return fn ? untrack(() => c(keyed ? when : () => {
|
|
1411
|
+
if (untrack(evalConditions)[0] !== index) throw narrowedError("Match");
|
|
1412
|
+
return cond.when;
|
|
1413
|
+
})) : c;
|
|
1407
1414
|
}, undefined, undefined);
|
|
1408
1415
|
}
|
|
1409
1416
|
function Match(props) {
|
package/dist/solid.js
CHANGED
|
@@ -1351,6 +1351,7 @@ function createUniqueId() {
|
|
|
1351
1351
|
return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
|
|
1352
1352
|
}
|
|
1353
1353
|
|
|
1354
|
+
const narrowedError = name => `Stale read from <${name}>.`;
|
|
1354
1355
|
function For(props) {
|
|
1355
1356
|
const fallback = "fallback" in props && {
|
|
1356
1357
|
fallback: () => props.fallback
|
|
@@ -1373,7 +1374,10 @@ function Show(props) {
|
|
|
1373
1374
|
if (c) {
|
|
1374
1375
|
const child = props.children;
|
|
1375
1376
|
const fn = typeof child === "function" && child.length > 0;
|
|
1376
|
-
return fn ? untrack(() => child(keyed ? c :
|
|
1377
|
+
return fn ? untrack(() => child(keyed ? c : () => {
|
|
1378
|
+
if (!untrack(condition)) throw narrowedError("Show");
|
|
1379
|
+
return props.when;
|
|
1380
|
+
})) : child;
|
|
1377
1381
|
}
|
|
1378
1382
|
return props.fallback;
|
|
1379
1383
|
}, undefined, undefined);
|
|
@@ -1401,7 +1405,10 @@ function Switch(props) {
|
|
|
1401
1405
|
if (index < 0) return props.fallback;
|
|
1402
1406
|
const c = cond.children;
|
|
1403
1407
|
const fn = typeof c === "function" && c.length > 0;
|
|
1404
|
-
return fn ? untrack(() => c(keyed ? when :
|
|
1408
|
+
return fn ? untrack(() => c(keyed ? when : () => {
|
|
1409
|
+
if (untrack(evalConditions)[0] !== index) throw narrowedError("Match");
|
|
1410
|
+
return cond.when;
|
|
1411
|
+
})) : c;
|
|
1405
1412
|
}, undefined, undefined);
|
|
1406
1413
|
}
|
|
1407
1414
|
function Match(props) {
|
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.7.0-beta.
|
|
4
|
+
"version": "1.7.0-beta.5",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -279,8 +279,8 @@
|
|
|
279
279
|
"types:universal": "tsc --project ./universal/tsconfig.json && ncp ../../node_modules/dom-expressions/src/universal.d.ts ./universal/types/universal.d.ts",
|
|
280
280
|
"bench": "node --allow-natives-syntax bench/bench.cjs",
|
|
281
281
|
"link": "symlink-dir . node_modules/solid-js",
|
|
282
|
-
"test": "
|
|
283
|
-
"coverage": "
|
|
282
|
+
"test": "vitest run",
|
|
283
|
+
"coverage": "vitest run --coverage",
|
|
284
284
|
"test-types": "tsc --project tsconfig.test.json"
|
|
285
285
|
}
|
|
286
286
|
}
|
package/types/jsx.d.ts
CHANGED
|
@@ -879,6 +879,7 @@ export namespace JSX {
|
|
|
879
879
|
accept?: string;
|
|
880
880
|
alt?: string;
|
|
881
881
|
autocomplete?: string;
|
|
882
|
+
autocorrect?: "on" | "off";
|
|
882
883
|
autofocus?: boolean;
|
|
883
884
|
capture?: boolean | string;
|
|
884
885
|
checked?: boolean;
|
|
@@ -892,6 +893,7 @@ export namespace JSX {
|
|
|
892
893
|
formnovalidate?: boolean;
|
|
893
894
|
formtarget?: string;
|
|
894
895
|
height?: number | string;
|
|
896
|
+
incremental?: boolean;
|
|
895
897
|
list?: string;
|
|
896
898
|
max?: number | string;
|
|
897
899
|
maxlength?: number | string;
|
|
@@ -902,6 +904,7 @@ export namespace JSX {
|
|
|
902
904
|
pattern?: string;
|
|
903
905
|
placeholder?: string;
|
|
904
906
|
readonly?: boolean;
|
|
907
|
+
results?: number;
|
|
905
908
|
required?: boolean;
|
|
906
909
|
size?: number | string;
|
|
907
910
|
src?: string;
|