solid-js 1.8.2 → 1.8.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 +1 -1
- package/dist/dev.js +534 -299
- package/dist/server.js +170 -75
- package/dist/solid.cjs +1 -1
- package/dist/solid.js +461 -257
- package/h/dist/h.js +34 -8
- package/h/jsx-runtime/dist/jsx.js +1 -1
- package/h/jsx-runtime/types/index.d.ts +11 -8
- package/h/types/hyperscript.d.ts +11 -11
- package/html/dist/html.js +216 -94
- package/html/types/lit.d.ts +47 -31
- package/package.json +7 -3
- package/store/dist/dev.js +114 -42
- package/store/dist/server.js +19 -8
- package/store/dist/store.js +105 -39
- package/store/types/index.d.ts +21 -7
- package/store/types/modifiers.d.ts +6 -3
- package/store/types/mutable.d.ts +5 -2
- package/store/types/server.d.ts +12 -4
- package/store/types/store.d.ts +218 -61
- package/types/index.d.ts +72 -9
- package/types/reactive/array.d.ts +12 -4
- package/types/reactive/observable.d.ts +25 -17
- package/types/reactive/scheduler.d.ts +9 -6
- package/types/reactive/signal.d.ts +228 -140
- package/types/render/Suspense.d.ts +5 -5
- package/types/render/component.d.ts +62 -31
- package/types/render/flow.d.ts +43 -31
- package/types/render/hydration.d.ts +13 -13
- package/types/server/index.d.ts +57 -2
- package/types/server/reactive.d.ts +73 -42
- package/types/server/rendering.d.ts +166 -95
- package/universal/dist/dev.js +28 -12
- package/universal/dist/universal.js +28 -12
- package/universal/types/index.d.ts +3 -1
- package/universal/types/universal.d.ts +0 -1
- package/web/dist/dev.cjs +3 -0
- package/web/dist/dev.js +620 -81
- package/web/dist/server.cjs +17 -5
- package/web/dist/server.js +188 -95
- package/web/dist/storage.cjs +12 -0
- package/web/dist/storage.js +10 -0
- package/web/dist/web.cjs +3 -0
- package/web/dist/web.js +614 -80
- package/web/types/client.d.ts +8 -3
- package/web/types/core.d.ts +10 -1
- package/web/types/index.d.ts +27 -10
- package/web/types/server-mock.d.ts +47 -32
- package/web/types/server.d.ts +10 -1
- package/web/types/storage.d.ts +2 -0
package/h/dist/h.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
spread,
|
|
3
|
+
assign,
|
|
4
|
+
insert,
|
|
5
|
+
createComponent,
|
|
6
|
+
dynamicProperty,
|
|
7
|
+
SVGElements
|
|
8
|
+
} from "solid-js/web";
|
|
2
9
|
|
|
3
10
|
const $ELEMENT = Symbol("hyper-element");
|
|
4
11
|
function createHyperScript(r) {
|
|
@@ -17,9 +24,16 @@ function createHyperScript(r) {
|
|
|
17
24
|
return ret;
|
|
18
25
|
function item(l) {
|
|
19
26
|
const type = typeof l;
|
|
20
|
-
if (l == null)
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
if (l == null);
|
|
28
|
+
else if ("string" === type) {
|
|
29
|
+
if (!e) parseClass(l);
|
|
30
|
+
else e.appendChild(document.createTextNode(l));
|
|
31
|
+
} else if (
|
|
32
|
+
"number" === type ||
|
|
33
|
+
"boolean" === type ||
|
|
34
|
+
l instanceof Date ||
|
|
35
|
+
l instanceof RegExp
|
|
36
|
+
) {
|
|
23
37
|
e.appendChild(document.createTextNode(l.toString()));
|
|
24
38
|
} else if (Array.isArray(l)) {
|
|
25
39
|
for (let i = 0; i < l.length; i++) item(l[i]);
|
|
@@ -34,12 +48,18 @@ function createHyperScript(r) {
|
|
|
34
48
|
dynamic = true;
|
|
35
49
|
} else if (d[k].get) dynamic = true;
|
|
36
50
|
}
|
|
37
|
-
dynamic
|
|
51
|
+
dynamic
|
|
52
|
+
? r.spread(e, l, e instanceof SVGElement, !!args.length)
|
|
53
|
+
: r.assign(e, l, e instanceof SVGElement, !!args.length);
|
|
38
54
|
} else if ("function" === type) {
|
|
39
55
|
if (!e) {
|
|
40
56
|
let props,
|
|
41
57
|
next = args[0];
|
|
42
|
-
if (
|
|
58
|
+
if (
|
|
59
|
+
next == null ||
|
|
60
|
+
(typeof next === "object" && !Array.isArray(next) && !(next instanceof Element))
|
|
61
|
+
)
|
|
62
|
+
props = args.shift();
|
|
43
63
|
props || (props = {});
|
|
44
64
|
if (args.length) {
|
|
45
65
|
props.children = args.length > 1 ? args : args[0];
|
|
@@ -55,7 +75,8 @@ function createHyperScript(r) {
|
|
|
55
75
|
return list;
|
|
56
76
|
};
|
|
57
77
|
r.dynamicProperty(props, k);
|
|
58
|
-
} else if (typeof d[k].value === "function" && !d[k].value.length)
|
|
78
|
+
} else if (typeof d[k].value === "function" && !d[k].value.length)
|
|
79
|
+
r.dynamicProperty(props, k);
|
|
59
80
|
}
|
|
60
81
|
e = r.createComponent(l, props);
|
|
61
82
|
args = [];
|
|
@@ -72,7 +93,12 @@ function createHyperScript(r) {
|
|
|
72
93
|
const v = m[i],
|
|
73
94
|
s = v.substring(1, v.length);
|
|
74
95
|
if (!v) continue;
|
|
75
|
-
if (!e)
|
|
96
|
+
if (!e)
|
|
97
|
+
e = r.SVGElements.has(v)
|
|
98
|
+
? document.createElementNS("http://www.w3.org/2000/svg", v)
|
|
99
|
+
: document.createElement(v);
|
|
100
|
+
else if (v[0] === ".") e.classList.add(s);
|
|
101
|
+
else if (v[0] === "#") e.setAttribute("id", s);
|
|
76
102
|
}
|
|
77
103
|
}
|
|
78
104
|
function detectMultiExpression(list) {
|
|
@@ -1,11 +1,14 @@
|
|
|
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
|
-
})
|
|
3
|
+
declare function Fragment(props: { children: JSX.Element }): JSX.Element;
|
|
4
|
+
declare function jsx(
|
|
5
|
+
type: any,
|
|
6
|
+
props: any
|
|
7
|
+
): () =>
|
|
8
|
+
| (Node & {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
})
|
|
11
|
+
| (Node & {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
})[];
|
|
11
14
|
export { jsx, jsx as jsxs, jsx as jsxDEV, Fragment };
|
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 {};
|