solid-js 1.8.21 → 1.8.22
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/README.md +3 -3
- package/dist/dev.cjs +6 -4
- package/dist/dev.js +325 -564
- package/dist/server.js +74 -168
- package/dist/solid.cjs +6 -4
- package/dist/solid.js +283 -491
- package/h/dist/h.cjs +1 -1
- package/h/dist/h.js +9 -38
- package/h/jsx-runtime/dist/jsx.js +1 -1
- package/h/jsx-runtime/types/index.d.ts +8 -11
- package/h/jsx-runtime/types/jsx.d.ts +2 -0
- package/h/types/hyperscript.d.ts +11 -11
- package/html/dist/html.js +94 -216
- package/html/types/lit.d.ts +33 -47
- package/package.json +1 -1
- package/store/dist/dev.js +43 -122
- package/store/dist/server.js +8 -19
- package/store/dist/store.js +40 -113
- package/store/types/index.d.ts +7 -21
- package/store/types/modifiers.d.ts +3 -6
- package/store/types/mutable.d.ts +2 -5
- package/store/types/server.d.ts +4 -12
- package/store/types/store.d.ts +61 -218
- package/types/index.d.ts +10 -75
- package/types/jsx.d.ts +8 -18
- package/types/reactive/array.d.ts +4 -12
- package/types/reactive/observable.d.ts +17 -25
- package/types/reactive/scheduler.d.ts +6 -9
- package/types/reactive/signal.d.ts +142 -233
- package/types/render/Suspense.d.ts +5 -5
- package/types/render/component.d.ts +33 -64
- package/types/render/flow.d.ts +31 -43
- package/types/render/hydration.d.ts +15 -15
- package/types/server/index.d.ts +2 -57
- package/types/server/reactive.d.ts +42 -73
- package/types/server/rendering.d.ts +98 -169
- package/universal/dist/dev.js +12 -28
- package/universal/dist/universal.js +12 -28
- package/universal/types/index.d.ts +1 -3
- package/universal/types/universal.d.ts +1 -0
- package/web/dist/dev.js +83 -625
- package/web/dist/server.js +96 -210
- package/web/dist/web.js +81 -616
- package/web/storage/dist/storage.js +3 -3
- package/web/types/client.d.ts +2 -2
- package/web/types/core.d.ts +1 -10
- package/web/types/index.d.ts +10 -27
- package/web/types/server-mock.d.ts +32 -47
package/h/dist/h.cjs
CHANGED
|
@@ -23,7 +23,7 @@ function createHyperScript(r) {
|
|
|
23
23
|
const type = typeof l;
|
|
24
24
|
if (l == null) ;else if ("string" === type) {
|
|
25
25
|
if (!e) parseClass(l);else e.appendChild(document.createTextNode(l));
|
|
26
|
-
} else if ("number" === type || "boolean" === type || l instanceof Date || l instanceof RegExp) {
|
|
26
|
+
} else if ("number" === type || "boolean" === type || "bigint" === type || "symbol" === type || l instanceof Date || l instanceof RegExp) {
|
|
27
27
|
e.appendChild(document.createTextNode(l.toString()));
|
|
28
28
|
} else if (Array.isArray(l)) {
|
|
29
29
|
for (let i = 0; i < l.length; i++) item(l[i]);
|
package/h/dist/h.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
spread,
|
|
3
|
-
assign,
|
|
4
|
-
insert,
|
|
5
|
-
createComponent,
|
|
6
|
-
dynamicProperty,
|
|
7
|
-
SVGElements
|
|
8
|
-
} from "solid-js/web";
|
|
1
|
+
import { spread, assign, insert, createComponent, dynamicProperty, SVGElements } from 'solid-js/web';
|
|
9
2
|
|
|
10
3
|
const $ELEMENT = Symbol("hyper-element");
|
|
11
4
|
function createHyperScript(r) {
|
|
@@ -26,16 +19,9 @@ function createHyperScript(r) {
|
|
|
26
19
|
return ret;
|
|
27
20
|
function item(l) {
|
|
28
21
|
const type = typeof l;
|
|
29
|
-
if (l == null);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
else e.appendChild(document.createTextNode(l));
|
|
33
|
-
} else if (
|
|
34
|
-
"number" === type ||
|
|
35
|
-
"boolean" === type ||
|
|
36
|
-
l instanceof Date ||
|
|
37
|
-
l instanceof RegExp
|
|
38
|
-
) {
|
|
22
|
+
if (l == null) ;else if ("string" === type) {
|
|
23
|
+
if (!e) parseClass(l);else e.appendChild(document.createTextNode(l));
|
|
24
|
+
} else if ("number" === type || "boolean" === type || "bigint" === type || "symbol" === type || l instanceof Date || l instanceof RegExp) {
|
|
39
25
|
e.appendChild(document.createTextNode(l.toString()));
|
|
40
26
|
} else if (Array.isArray(l)) {
|
|
41
27
|
for (let i = 0; i < l.length; i++) item(l[i]);
|
|
@@ -47,10 +33,7 @@ function createHyperScript(r) {
|
|
|
47
33
|
for (const k in d) {
|
|
48
34
|
if (k === "class" && classes.length !== 0) {
|
|
49
35
|
const fixedClasses = classes.join(" "),
|
|
50
|
-
value =
|
|
51
|
-
typeof d["class"].value === "function"
|
|
52
|
-
? () => fixedClasses + " " + d["class"].value()
|
|
53
|
-
: fixedClasses + " " + l["class"];
|
|
36
|
+
value = typeof d["class"].value === "function" ? () => fixedClasses + " " + d["class"].value() : fixedClasses + " " + l["class"];
|
|
54
37
|
Object.defineProperty(l, "class", {
|
|
55
38
|
...d[k],
|
|
56
39
|
value
|
|
@@ -62,18 +45,12 @@ function createHyperScript(r) {
|
|
|
62
45
|
dynamic = true;
|
|
63
46
|
} else if (d[k].get) dynamic = true;
|
|
64
47
|
}
|
|
65
|
-
dynamic
|
|
66
|
-
? r.spread(e, l, e instanceof SVGElement, !!args.length)
|
|
67
|
-
: r.assign(e, l, e instanceof SVGElement, !!args.length);
|
|
48
|
+
dynamic ? r.spread(e, l, e instanceof SVGElement, !!args.length) : r.assign(e, l, e instanceof SVGElement, !!args.length);
|
|
68
49
|
} else if ("function" === type) {
|
|
69
50
|
if (!e) {
|
|
70
51
|
let props,
|
|
71
52
|
next = args[0];
|
|
72
|
-
if (
|
|
73
|
-
next == null ||
|
|
74
|
-
(typeof next === "object" && !Array.isArray(next) && !(next instanceof Element))
|
|
75
|
-
)
|
|
76
|
-
props = args.shift();
|
|
53
|
+
if (next == null || typeof next === "object" && !Array.isArray(next) && !(next instanceof Element)) props = args.shift();
|
|
77
54
|
props || (props = {});
|
|
78
55
|
if (args.length) {
|
|
79
56
|
props.children = args.length > 1 ? args : args[0];
|
|
@@ -89,8 +66,7 @@ function createHyperScript(r) {
|
|
|
89
66
|
return list;
|
|
90
67
|
};
|
|
91
68
|
r.dynamicProperty(props, k);
|
|
92
|
-
} else if (typeof d[k].value === "function" && !d[k].value.length)
|
|
93
|
-
r.dynamicProperty(props, k);
|
|
69
|
+
} else if (typeof d[k].value === "function" && !d[k].value.length) r.dynamicProperty(props, k);
|
|
94
70
|
}
|
|
95
71
|
e = r.createComponent(l, props);
|
|
96
72
|
args = [];
|
|
@@ -107,12 +83,7 @@ function createHyperScript(r) {
|
|
|
107
83
|
const v = m[i],
|
|
108
84
|
s = v.substring(1, v.length);
|
|
109
85
|
if (!v) continue;
|
|
110
|
-
if (!e)
|
|
111
|
-
e = r.SVGElements.has(v)
|
|
112
|
-
? document.createElementNS("http://www.w3.org/2000/svg", v)
|
|
113
|
-
: document.createElement(v);
|
|
114
|
-
else if (v[0] === ".") classes.push(s);
|
|
115
|
-
else if (v[0] === "#") e.setAttribute("id", s);
|
|
86
|
+
if (!e) e = r.SVGElements.has(v) ? document.createElementNS("http://www.w3.org/2000/svg", v) : document.createElement(v);else if (v[0] === ".") classes.push(s);else if (v[0] === "#") e.setAttribute("id", s);
|
|
116
87
|
}
|
|
117
88
|
}
|
|
118
89
|
function detectMultiExpression(list) {
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
export type { JSX } from "./jsx";
|
|
2
2
|
import type { JSX } from "./jsx";
|
|
3
|
-
declare function Fragment(props: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
| (Node & {
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
})[];
|
|
3
|
+
declare function Fragment(props: {
|
|
4
|
+
children: JSX.Element;
|
|
5
|
+
}): JSX.Element;
|
|
6
|
+
declare function jsx(type: any, props: any): () => (Node & {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}) | (Node & {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
})[];
|
|
14
11
|
export { jsx, jsx as jsxs, jsx as jsxDEV, Fragment };
|
|
@@ -1017,6 +1017,8 @@ export namespace JSX {
|
|
|
1017
1017
|
src?: FunctionMaybe<string>;
|
|
1018
1018
|
srcset?: FunctionMaybe<string>;
|
|
1019
1019
|
type?: FunctionMaybe<string>;
|
|
1020
|
+
width?: FunctionMaybe<number | string>;
|
|
1021
|
+
height?: FunctionMaybe<number | string>;
|
|
1020
1022
|
}
|
|
1021
1023
|
interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1022
1024
|
media?: FunctionMaybe<string>;
|
package/h/types/hyperscript.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
2
2
|
interface Runtime {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
insert(parent: MountableElement, accessor: any, marker?: Node | null, init?: any): any;
|
|
4
|
+
spread(node: Element, accessor: any, isSVG?: Boolean, skipChildren?: Boolean): void;
|
|
5
|
+
assign(node: Element, props: any, isSVG?: Boolean, skipChildren?: Boolean): void;
|
|
6
|
+
createComponent(Comp: (props: any) => any, props: any): any;
|
|
7
|
+
dynamicProperty(props: any, key: string): any;
|
|
8
|
+
SVGElements: Set<string>;
|
|
9
9
|
}
|
|
10
10
|
type ExpandableNode = Node & {
|
|
11
|
-
|
|
11
|
+
[key: string]: any;
|
|
12
12
|
};
|
|
13
13
|
export type HyperScript = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
(...args: any[]): () => ExpandableNode | ExpandableNode[];
|
|
15
|
+
Fragment: (props: {
|
|
16
|
+
children: (() => ExpandableNode) | (() => ExpandableNode)[];
|
|
17
|
+
}) => ExpandableNode[];
|
|
18
18
|
};
|
|
19
19
|
export declare function createHyperScript(r: Runtime): HyperScript;
|
|
20
20
|
export {};
|