solid-js 1.6.15 → 1.6.16
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/server.cjs +9 -7
- package/dist/server.js +9 -7
- package/package.json +3 -3
- package/types/jsx.d.ts +4 -0
- package/universal/types/universal.d.ts +1 -0
- package/web/dist/dev.cjs +11 -4
- package/web/dist/dev.js +11 -4
- package/web/dist/server.cjs +8 -7
- package/web/dist/server.js +8 -7
- package/web/dist/web.cjs +11 -4
- package/web/dist/web.js +11 -4
package/dist/server.cjs
CHANGED
|
@@ -586,7 +586,7 @@ function Suspense(props) {
|
|
|
586
586
|
...ctx,
|
|
587
587
|
count: 0
|
|
588
588
|
});
|
|
589
|
-
|
|
589
|
+
cleanNode(o);
|
|
590
590
|
return runWithOwner(o, () => {
|
|
591
591
|
return createComponent(SuspenseContext.Provider, {
|
|
592
592
|
value,
|
|
@@ -598,12 +598,14 @@ function Suspense(props) {
|
|
|
598
598
|
}
|
|
599
599
|
const res = runSuspense();
|
|
600
600
|
if (suspenseComplete(value)) return res;
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
if (
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
601
|
+
runWithOwner(o, () => {
|
|
602
|
+
onError(err => {
|
|
603
|
+
if (!done || !done(undefined, err)) {
|
|
604
|
+
runWithOwner(o.owner, () => {
|
|
605
|
+
throw err;
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
});
|
|
607
609
|
});
|
|
608
610
|
done = ctx.async ? ctx.registerFragment(id) : undefined;
|
|
609
611
|
if (ctx.async) {
|
package/dist/server.js
CHANGED
|
@@ -584,7 +584,7 @@ function Suspense(props) {
|
|
|
584
584
|
...ctx,
|
|
585
585
|
count: 0
|
|
586
586
|
});
|
|
587
|
-
|
|
587
|
+
cleanNode(o);
|
|
588
588
|
return runWithOwner(o, () => {
|
|
589
589
|
return createComponent(SuspenseContext.Provider, {
|
|
590
590
|
value,
|
|
@@ -596,12 +596,14 @@ function Suspense(props) {
|
|
|
596
596
|
}
|
|
597
597
|
const res = runSuspense();
|
|
598
598
|
if (suspenseComplete(value)) return res;
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
if (
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
599
|
+
runWithOwner(o, () => {
|
|
600
|
+
onError(err => {
|
|
601
|
+
if (!done || !done(undefined, err)) {
|
|
602
|
+
runWithOwner(o.owner, () => {
|
|
603
|
+
throw err;
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
});
|
|
605
607
|
});
|
|
606
608
|
done = ctx.async ? ctx.registerFragment(id) : undefined;
|
|
607
609
|
if (ctx.async) {
|
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.16",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -278,8 +278,8 @@
|
|
|
278
278
|
"types:universal": "tsc --project ./universal/tsconfig.json && ncp ../../node_modules/dom-expressions/src/universal.d.ts ./universal/types/universal.d.ts",
|
|
279
279
|
"bench": "node --allow-natives-syntax bench/bench.cjs",
|
|
280
280
|
"link": "symlink-dir . node_modules/solid-js",
|
|
281
|
-
"test": "
|
|
282
|
-
"coverage": "
|
|
281
|
+
"test": "vitest run",
|
|
282
|
+
"coverage": "vitest run --coverage",
|
|
283
283
|
"test-types": "tsc --project tsconfig.test.json"
|
|
284
284
|
}
|
|
285
285
|
}
|
package/types/jsx.d.ts
CHANGED
|
@@ -798,11 +798,13 @@ export namespace JSX {
|
|
|
798
798
|
accept?: string;
|
|
799
799
|
alt?: string;
|
|
800
800
|
autocomplete?: string;
|
|
801
|
+
autocorrect?: "on" | "off";
|
|
801
802
|
autofocus?: boolean;
|
|
802
803
|
capture?: boolean | string;
|
|
803
804
|
checked?: boolean;
|
|
804
805
|
crossorigin?: HTMLCrossorigin;
|
|
805
806
|
disabled?: boolean;
|
|
807
|
+
enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
806
808
|
form?: string;
|
|
807
809
|
formaction?: string;
|
|
808
810
|
formenctype?: HTMLFormEncType;
|
|
@@ -810,6 +812,7 @@ export namespace JSX {
|
|
|
810
812
|
formnovalidate?: boolean;
|
|
811
813
|
formtarget?: string;
|
|
812
814
|
height?: number | string;
|
|
815
|
+
incremental?: boolean;
|
|
813
816
|
list?: string;
|
|
814
817
|
max?: number | string;
|
|
815
818
|
maxlength?: number | string;
|
|
@@ -820,6 +823,7 @@ export namespace JSX {
|
|
|
820
823
|
pattern?: string;
|
|
821
824
|
placeholder?: string;
|
|
822
825
|
readonly?: boolean;
|
|
826
|
+
results?: number;
|
|
823
827
|
required?: boolean;
|
|
824
828
|
size?: number | string;
|
|
825
829
|
src?: string;
|
|
@@ -23,6 +23,7 @@ export interface Renderer<NodeType> {
|
|
|
23
23
|
spread<T>(node: any, accessor: (() => T) | T, skipChildren?: Boolean): void;
|
|
24
24
|
setProp<T>(node: NodeType, name: string, value: T, prev?: T): T;
|
|
25
25
|
mergeProps(...sources: unknown[]): unknown;
|
|
26
|
+
use<A, T>(fn: (element: NodeType, arg: A) => T, element: NodeType, arg: A): T;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export function createRenderer<NodeType>(options: RendererOptions<NodeType>): Renderer<NodeType>;
|
package/web/dist/dev.cjs
CHANGED
|
@@ -364,7 +364,15 @@ function eventHandler(e) {
|
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
367
|
-
if (solidJs.sharedConfig.context
|
|
367
|
+
if (solidJs.sharedConfig.context) {
|
|
368
|
+
!current && (current = [...parent.childNodes]);
|
|
369
|
+
let cleaned = [];
|
|
370
|
+
for (let i = 0; i < current.length; i++) {
|
|
371
|
+
const node = current[i];
|
|
372
|
+
if (node.nodeType === 8 && node.data === "!") node.remove();else cleaned.push(node);
|
|
373
|
+
}
|
|
374
|
+
current = cleaned;
|
|
375
|
+
}
|
|
368
376
|
while (typeof current === "function") current = current();
|
|
369
377
|
if (value === current) return current;
|
|
370
378
|
const t = typeof value,
|
|
@@ -450,9 +458,8 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
450
458
|
}
|
|
451
459
|
} else {
|
|
452
460
|
const value = String(item);
|
|
453
|
-
if (
|
|
454
|
-
|
|
455
|
-
} else if (prev && prev.nodeType === 3 && prev.data === value) {
|
|
461
|
+
if (prev && prev.nodeType === 3) {
|
|
462
|
+
prev.data = value;
|
|
456
463
|
normalized.push(prev);
|
|
457
464
|
} else normalized.push(document.createTextNode(value));
|
|
458
465
|
}
|
package/web/dist/dev.js
CHANGED
|
@@ -363,7 +363,15 @@ function eventHandler(e) {
|
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
366
|
-
if (sharedConfig.context
|
|
366
|
+
if (sharedConfig.context) {
|
|
367
|
+
!current && (current = [...parent.childNodes]);
|
|
368
|
+
let cleaned = [];
|
|
369
|
+
for (let i = 0; i < current.length; i++) {
|
|
370
|
+
const node = current[i];
|
|
371
|
+
if (node.nodeType === 8 && node.data === "!") node.remove();else cleaned.push(node);
|
|
372
|
+
}
|
|
373
|
+
current = cleaned;
|
|
374
|
+
}
|
|
367
375
|
while (typeof current === "function") current = current();
|
|
368
376
|
if (value === current) return current;
|
|
369
377
|
const t = typeof value,
|
|
@@ -449,9 +457,8 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
449
457
|
}
|
|
450
458
|
} else {
|
|
451
459
|
const value = String(item);
|
|
452
|
-
if (
|
|
453
|
-
|
|
454
|
-
} else if (prev && prev.nodeType === 3 && prev.data === value) {
|
|
460
|
+
if (prev && prev.nodeType === 3) {
|
|
461
|
+
prev.data = value;
|
|
455
462
|
normalized.push(prev);
|
|
456
463
|
} else normalized.push(document.createTextNode(value));
|
|
457
464
|
}
|
package/web/dist/server.cjs
CHANGED
|
@@ -577,13 +577,10 @@ function ssrHydrationKey() {
|
|
|
577
577
|
function escape(s, attr) {
|
|
578
578
|
const t = typeof s;
|
|
579
579
|
if (t !== "string") {
|
|
580
|
-
if (!attr && t === "function") return escape(s()
|
|
580
|
+
if (!attr && t === "function") return escape(s());
|
|
581
581
|
if (!attr && Array.isArray(s)) {
|
|
582
|
-
let
|
|
583
|
-
|
|
584
|
-
return {
|
|
585
|
-
t: r
|
|
586
|
-
};
|
|
582
|
+
for (let i = 0; i < s.length; i++) s[i] = escape(s[i]);
|
|
583
|
+
return s;
|
|
587
584
|
}
|
|
588
585
|
if (attr && t === "boolean") return String(s);
|
|
589
586
|
return s;
|
|
@@ -628,8 +625,12 @@ function resolveSSRNode(node) {
|
|
|
628
625
|
if (t === "string") return node;
|
|
629
626
|
if (node == null || t === "boolean") return "";
|
|
630
627
|
if (Array.isArray(node)) {
|
|
628
|
+
let prev = {};
|
|
631
629
|
let mapped = "";
|
|
632
|
-
for (let i = 0, len = node.length; i < len; i++)
|
|
630
|
+
for (let i = 0, len = node.length; i < len; i++) {
|
|
631
|
+
if (typeof prev !== "object" && typeof node[i] !== "object") mapped += `<!--!-->`;
|
|
632
|
+
mapped += resolveSSRNode(prev = node[i]);
|
|
633
|
+
}
|
|
633
634
|
return mapped;
|
|
634
635
|
}
|
|
635
636
|
if (t === "object") return node.t;
|
package/web/dist/server.js
CHANGED
|
@@ -576,13 +576,10 @@ function ssrHydrationKey() {
|
|
|
576
576
|
function escape(s, attr) {
|
|
577
577
|
const t = typeof s;
|
|
578
578
|
if (t !== "string") {
|
|
579
|
-
if (!attr && t === "function") return escape(s()
|
|
579
|
+
if (!attr && t === "function") return escape(s());
|
|
580
580
|
if (!attr && Array.isArray(s)) {
|
|
581
|
-
let
|
|
582
|
-
|
|
583
|
-
return {
|
|
584
|
-
t: r
|
|
585
|
-
};
|
|
581
|
+
for (let i = 0; i < s.length; i++) s[i] = escape(s[i]);
|
|
582
|
+
return s;
|
|
586
583
|
}
|
|
587
584
|
if (attr && t === "boolean") return String(s);
|
|
588
585
|
return s;
|
|
@@ -627,8 +624,12 @@ function resolveSSRNode(node) {
|
|
|
627
624
|
if (t === "string") return node;
|
|
628
625
|
if (node == null || t === "boolean") return "";
|
|
629
626
|
if (Array.isArray(node)) {
|
|
627
|
+
let prev = {};
|
|
630
628
|
let mapped = "";
|
|
631
|
-
for (let i = 0, len = node.length; i < len; i++)
|
|
629
|
+
for (let i = 0, len = node.length; i < len; i++) {
|
|
630
|
+
if (typeof prev !== "object" && typeof node[i] !== "object") mapped += `<!--!-->`;
|
|
631
|
+
mapped += resolveSSRNode(prev = node[i]);
|
|
632
|
+
}
|
|
632
633
|
return mapped;
|
|
633
634
|
}
|
|
634
635
|
if (t === "object") return node.t;
|
package/web/dist/web.cjs
CHANGED
|
@@ -364,7 +364,15 @@ function eventHandler(e) {
|
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
367
|
-
if (solidJs.sharedConfig.context
|
|
367
|
+
if (solidJs.sharedConfig.context) {
|
|
368
|
+
!current && (current = [...parent.childNodes]);
|
|
369
|
+
let cleaned = [];
|
|
370
|
+
for (let i = 0; i < current.length; i++) {
|
|
371
|
+
const node = current[i];
|
|
372
|
+
if (node.nodeType === 8 && node.data === "!") node.remove();else cleaned.push(node);
|
|
373
|
+
}
|
|
374
|
+
current = cleaned;
|
|
375
|
+
}
|
|
368
376
|
while (typeof current === "function") current = current();
|
|
369
377
|
if (value === current) return current;
|
|
370
378
|
const t = typeof value,
|
|
@@ -450,9 +458,8 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
450
458
|
}
|
|
451
459
|
} else {
|
|
452
460
|
const value = String(item);
|
|
453
|
-
if (
|
|
454
|
-
|
|
455
|
-
} else if (prev && prev.nodeType === 3 && prev.data === value) {
|
|
461
|
+
if (prev && prev.nodeType === 3) {
|
|
462
|
+
prev.data = value;
|
|
456
463
|
normalized.push(prev);
|
|
457
464
|
} else normalized.push(document.createTextNode(value));
|
|
458
465
|
}
|
package/web/dist/web.js
CHANGED
|
@@ -363,7 +363,15 @@ function eventHandler(e) {
|
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
366
|
-
if (sharedConfig.context
|
|
366
|
+
if (sharedConfig.context) {
|
|
367
|
+
!current && (current = [...parent.childNodes]);
|
|
368
|
+
let cleaned = [];
|
|
369
|
+
for (let i = 0; i < current.length; i++) {
|
|
370
|
+
const node = current[i];
|
|
371
|
+
if (node.nodeType === 8 && node.data === "!") node.remove();else cleaned.push(node);
|
|
372
|
+
}
|
|
373
|
+
current = cleaned;
|
|
374
|
+
}
|
|
367
375
|
while (typeof current === "function") current = current();
|
|
368
376
|
if (value === current) return current;
|
|
369
377
|
const t = typeof value,
|
|
@@ -449,9 +457,8 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
449
457
|
}
|
|
450
458
|
} else {
|
|
451
459
|
const value = String(item);
|
|
452
|
-
if (
|
|
453
|
-
|
|
454
|
-
} else if (prev && prev.nodeType === 3 && prev.data === value) {
|
|
460
|
+
if (prev && prev.nodeType === 3) {
|
|
461
|
+
prev.data = value;
|
|
455
462
|
normalized.push(prev);
|
|
456
463
|
} else normalized.push(document.createTextNode(value));
|
|
457
464
|
}
|