solid-js 1.9.3 → 2.0.0-experimental.0
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 +213 -1603
- package/dist/dev.js +159 -1749
- package/dist/server.cjs +88 -11
- package/dist/server.js +91 -11
- package/dist/solid.cjs +196 -1558
- package/dist/solid.js +139 -1682
- package/package.json +8 -154
- package/types/{render → client}/component.d.ts +0 -61
- package/types/client/core.d.ts +75 -0
- package/types/client/flow.d.ts +114 -0
- package/types/{render → client}/hydration.d.ts +0 -2
- package/types/{reactive → client}/observable.d.ts +1 -1
- package/types/index.d.ts +44 -55
- package/types/jsx.d.ts +1944 -174
- package/types/server/index.d.ts +1 -1
- package/types/server/reactive.d.ts +6 -1
- package/types/server/store.d.ts +6 -0
- package/h/dist/h.cjs +0 -115
- package/h/dist/h.js +0 -144
- package/h/jsx-dev-runtime/package.json +0 -8
- package/h/jsx-runtime/dist/jsx.cjs +0 -15
- package/h/jsx-runtime/dist/jsx.js +0 -10
- package/h/jsx-runtime/package.json +0 -8
- package/h/jsx-runtime/types/index.d.ts +0 -14
- package/h/jsx-runtime/types/jsx.d.ts +0 -2276
- package/h/package.json +0 -8
- package/h/types/hyperscript.d.ts +0 -20
- package/h/types/index.d.ts +0 -3
- package/html/dist/html.cjs +0 -583
- package/html/dist/html.js +0 -706
- package/html/package.json +0 -8
- package/html/types/index.d.ts +0 -3
- package/html/types/lit.d.ts +0 -60
- package/store/dist/dev.cjs +0 -454
- package/store/dist/dev.js +0 -525
- package/store/dist/server.cjs +0 -126
- package/store/dist/server.js +0 -126
- package/store/dist/store.cjs +0 -434
- package/store/dist/store.js +0 -499
- package/store/package.json +0 -46
- package/store/types/index.d.ts +0 -26
- package/store/types/modifiers.d.ts +0 -9
- package/store/types/mutable.d.ts +0 -8
- package/store/types/server.d.ts +0 -37
- package/store/types/store.d.ts +0 -263
- package/types/reactive/array.d.ts +0 -52
- package/types/reactive/scheduler.d.ts +0 -13
- package/types/reactive/signal.d.ts +0 -664
- package/types/render/Suspense.d.ts +0 -26
- package/types/render/flow.d.ts +0 -130
- package/types/render/index.d.ts +0 -4
- package/universal/dist/dev.cjs +0 -243
- package/universal/dist/dev.js +0 -257
- package/universal/dist/universal.cjs +0 -243
- package/universal/dist/universal.js +0 -257
- package/universal/package.json +0 -20
- package/universal/types/index.d.ts +0 -4
- package/universal/types/universal.d.ts +0 -29
- package/web/dist/dev.cjs +0 -804
- package/web/dist/dev.js +0 -1241
- package/web/dist/server.cjs +0 -793
- package/web/dist/server.js +0 -1214
- package/web/dist/web.cjs +0 -793
- package/web/dist/web.js +0 -1220
- package/web/package.json +0 -46
- package/web/storage/dist/storage.cjs +0 -12
- package/web/storage/dist/storage.js +0 -10
- package/web/storage/package.json +0 -15
- package/web/storage/types/index.d.ts +0 -2
- package/web/storage/types/index.js +0 -13
- package/web/types/client.d.ts +0 -79
- package/web/types/core.d.ts +0 -10
- package/web/types/index.d.ts +0 -54
- package/web/types/jsx.d.ts +0 -1
- package/web/types/server-mock.d.ts +0 -80
- package/web/types/server.d.ts +0 -177
package/types/server/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export {
|
|
|
2
2
|
catchError,
|
|
3
3
|
createRoot,
|
|
4
4
|
createSignal,
|
|
5
|
-
createComputed,
|
|
6
5
|
createRenderEffect,
|
|
7
6
|
createEffect,
|
|
8
7
|
createReaction,
|
|
@@ -56,3 +55,4 @@ export {
|
|
|
56
55
|
sharedConfig
|
|
57
56
|
} from "./rendering.js";
|
|
58
57
|
export type { Component, Resource } from "./rendering.js";
|
|
58
|
+
export * from "./store.js";
|
|
@@ -103,7 +103,12 @@ export declare function observable<T>(input: Accessor<T>): {
|
|
|
103
103
|
subscribe(observer: ObservableObserver<T>): {
|
|
104
104
|
unsubscribe(): void;
|
|
105
105
|
};
|
|
106
|
-
[Symbol.observable]():
|
|
106
|
+
[Symbol.observable](): {
|
|
107
|
+
subscribe(observer: ObservableObserver<T>): {
|
|
108
|
+
unsubscribe(): void;
|
|
109
|
+
};
|
|
110
|
+
[Symbol.observable](): /*elided*/ any;
|
|
111
|
+
};
|
|
107
112
|
};
|
|
108
113
|
export declare function from<T>(
|
|
109
114
|
producer:
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Store, StoreSetter } from "@solidjs/signals";
|
|
2
|
+
export type { NotWrappable, SolidStore, Store, StoreNode, StoreSetter } from "@solidjs/signals";
|
|
3
|
+
export declare function isWrappable(obj: any): boolean;
|
|
4
|
+
export declare function unwrap<T>(item: T): T;
|
|
5
|
+
export declare function createStore<T>(state: T | Store<T>): [get: Store<T>, set: StoreSetter<T>];
|
|
6
|
+
export declare function reconcile<T extends U, U extends object>(value: T): (state: U) => T;
|
package/h/dist/h.cjs
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var web = require('solid-js/web');
|
|
4
|
-
|
|
5
|
-
const $ELEMENT = Symbol("hyper-element");
|
|
6
|
-
function createHyperScript(r) {
|
|
7
|
-
function h() {
|
|
8
|
-
let args = [].slice.call(arguments),
|
|
9
|
-
e,
|
|
10
|
-
classes = [],
|
|
11
|
-
multiExpression = false;
|
|
12
|
-
while (Array.isArray(args[0])) args = args[0];
|
|
13
|
-
if (args[0][$ELEMENT]) args.unshift(h.Fragment);
|
|
14
|
-
typeof args[0] === "string" && detectMultiExpression(args);
|
|
15
|
-
const ret = () => {
|
|
16
|
-
while (args.length) item(args.shift());
|
|
17
|
-
if (e instanceof Element && classes.length) e.classList.add(...classes);
|
|
18
|
-
return e;
|
|
19
|
-
};
|
|
20
|
-
ret[$ELEMENT] = true;
|
|
21
|
-
return ret;
|
|
22
|
-
function item(l) {
|
|
23
|
-
const type = typeof l;
|
|
24
|
-
if (l == null) ;else if ("string" === type) {
|
|
25
|
-
if (!e) parseClass(l);else e.appendChild(document.createTextNode(l));
|
|
26
|
-
} else if ("number" === type || "boolean" === type || "bigint" === type || "symbol" === type || l instanceof Date || l instanceof RegExp) {
|
|
27
|
-
e.appendChild(document.createTextNode(l.toString()));
|
|
28
|
-
} else if (Array.isArray(l)) {
|
|
29
|
-
for (let i = 0; i < l.length; i++) item(l[i]);
|
|
30
|
-
} else if (l instanceof Element) {
|
|
31
|
-
r.insert(e, l, multiExpression ? null : undefined);
|
|
32
|
-
} else if ("object" === type) {
|
|
33
|
-
let dynamic = false;
|
|
34
|
-
const d = Object.getOwnPropertyDescriptors(l);
|
|
35
|
-
for (const k in d) {
|
|
36
|
-
if (k === "class" && classes.length !== 0) {
|
|
37
|
-
const fixedClasses = classes.join(" "),
|
|
38
|
-
value = typeof d["class"].value === "function" ? () => fixedClasses + " " + d["class"].value() : fixedClasses + " " + l["class"];
|
|
39
|
-
Object.defineProperty(l, "class", {
|
|
40
|
-
...d[k],
|
|
41
|
-
value
|
|
42
|
-
});
|
|
43
|
-
classes = [];
|
|
44
|
-
}
|
|
45
|
-
if (k !== "ref" && k.slice(0, 2) !== "on" && typeof d[k].value === "function") {
|
|
46
|
-
r.dynamicProperty(l, k);
|
|
47
|
-
dynamic = true;
|
|
48
|
-
} else if (d[k].get) dynamic = true;
|
|
49
|
-
}
|
|
50
|
-
dynamic ? r.spread(e, l, e instanceof SVGElement, !!args.length) : r.assign(e, l, e instanceof SVGElement, !!args.length);
|
|
51
|
-
} else if ("function" === type) {
|
|
52
|
-
if (!e) {
|
|
53
|
-
let props,
|
|
54
|
-
next = args[0];
|
|
55
|
-
if (next == null || typeof next === "object" && !Array.isArray(next) && !(next instanceof Element)) props = args.shift();
|
|
56
|
-
props || (props = {});
|
|
57
|
-
if (args.length) {
|
|
58
|
-
props.children = args.length > 1 ? args : args[0];
|
|
59
|
-
}
|
|
60
|
-
const d = Object.getOwnPropertyDescriptors(props);
|
|
61
|
-
for (const k in d) {
|
|
62
|
-
if (Array.isArray(d[k].value)) {
|
|
63
|
-
const list = d[k].value;
|
|
64
|
-
props[k] = () => {
|
|
65
|
-
for (let i = 0; i < list.length; i++) {
|
|
66
|
-
while (list[i][$ELEMENT]) list[i] = list[i]();
|
|
67
|
-
}
|
|
68
|
-
return list;
|
|
69
|
-
};
|
|
70
|
-
r.dynamicProperty(props, k);
|
|
71
|
-
} else if (typeof d[k].value === "function" && !d[k].value.length) r.dynamicProperty(props, k);
|
|
72
|
-
}
|
|
73
|
-
e = r.createComponent(l, props);
|
|
74
|
-
args = [];
|
|
75
|
-
} else {
|
|
76
|
-
while (l[$ELEMENT]) l = l();
|
|
77
|
-
r.insert(e, l, multiExpression ? null : undefined);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function parseClass(string) {
|
|
82
|
-
const m = string.split(/([\.#]?[^\s#.]+)/);
|
|
83
|
-
if (/^\.|#/.test(m[1])) e = document.createElement("div");
|
|
84
|
-
for (let i = 0; i < m.length; i++) {
|
|
85
|
-
const v = m[i],
|
|
86
|
-
s = v.substring(1, v.length);
|
|
87
|
-
if (!v) continue;
|
|
88
|
-
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);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function detectMultiExpression(list) {
|
|
92
|
-
for (let i = 1; i < list.length; i++) {
|
|
93
|
-
if (typeof list[i] === "function") {
|
|
94
|
-
multiExpression = true;
|
|
95
|
-
return;
|
|
96
|
-
} else if (Array.isArray(list[i])) {
|
|
97
|
-
detectMultiExpression(list[i]);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
h.Fragment = props => props.children;
|
|
103
|
-
return h;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const h = createHyperScript({
|
|
107
|
-
spread: web.spread,
|
|
108
|
-
assign: web.assign,
|
|
109
|
-
insert: web.insert,
|
|
110
|
-
createComponent: web.createComponent,
|
|
111
|
-
dynamicProperty: web.dynamicProperty,
|
|
112
|
-
SVGElements: web.SVGElements
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
module.exports = h;
|
package/h/dist/h.js
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
spread,
|
|
3
|
-
assign,
|
|
4
|
-
insert,
|
|
5
|
-
createComponent,
|
|
6
|
-
dynamicProperty,
|
|
7
|
-
SVGElements
|
|
8
|
-
} from "solid-js/web";
|
|
9
|
-
|
|
10
|
-
const $ELEMENT = Symbol("hyper-element");
|
|
11
|
-
function createHyperScript(r) {
|
|
12
|
-
function h() {
|
|
13
|
-
let args = [].slice.call(arguments),
|
|
14
|
-
e,
|
|
15
|
-
classes = [],
|
|
16
|
-
multiExpression = false;
|
|
17
|
-
while (Array.isArray(args[0])) args = args[0];
|
|
18
|
-
if (args[0][$ELEMENT]) args.unshift(h.Fragment);
|
|
19
|
-
typeof args[0] === "string" && detectMultiExpression(args);
|
|
20
|
-
const ret = () => {
|
|
21
|
-
while (args.length) item(args.shift());
|
|
22
|
-
if (e instanceof Element && classes.length) e.classList.add(...classes);
|
|
23
|
-
return e;
|
|
24
|
-
};
|
|
25
|
-
ret[$ELEMENT] = true;
|
|
26
|
-
return ret;
|
|
27
|
-
function item(l) {
|
|
28
|
-
const type = typeof l;
|
|
29
|
-
if (l == null);
|
|
30
|
-
else if ("string" === type) {
|
|
31
|
-
if (!e) parseClass(l);
|
|
32
|
-
else e.appendChild(document.createTextNode(l));
|
|
33
|
-
} else if (
|
|
34
|
-
"number" === type ||
|
|
35
|
-
"boolean" === type ||
|
|
36
|
-
"bigint" === type ||
|
|
37
|
-
"symbol" === type ||
|
|
38
|
-
l instanceof Date ||
|
|
39
|
-
l instanceof RegExp
|
|
40
|
-
) {
|
|
41
|
-
e.appendChild(document.createTextNode(l.toString()));
|
|
42
|
-
} else if (Array.isArray(l)) {
|
|
43
|
-
for (let i = 0; i < l.length; i++) item(l[i]);
|
|
44
|
-
} else if (l instanceof Element) {
|
|
45
|
-
r.insert(e, l, multiExpression ? null : undefined);
|
|
46
|
-
} else if ("object" === type) {
|
|
47
|
-
let dynamic = false;
|
|
48
|
-
const d = Object.getOwnPropertyDescriptors(l);
|
|
49
|
-
for (const k in d) {
|
|
50
|
-
if (k === "class" && classes.length !== 0) {
|
|
51
|
-
const fixedClasses = classes.join(" "),
|
|
52
|
-
value =
|
|
53
|
-
typeof d["class"].value === "function"
|
|
54
|
-
? () => fixedClasses + " " + d["class"].value()
|
|
55
|
-
: fixedClasses + " " + l["class"];
|
|
56
|
-
Object.defineProperty(l, "class", {
|
|
57
|
-
...d[k],
|
|
58
|
-
value
|
|
59
|
-
});
|
|
60
|
-
classes = [];
|
|
61
|
-
}
|
|
62
|
-
if (k !== "ref" && k.slice(0, 2) !== "on" && typeof d[k].value === "function") {
|
|
63
|
-
r.dynamicProperty(l, k);
|
|
64
|
-
dynamic = true;
|
|
65
|
-
} else if (d[k].get) dynamic = true;
|
|
66
|
-
}
|
|
67
|
-
dynamic
|
|
68
|
-
? r.spread(e, l, e instanceof SVGElement, !!args.length)
|
|
69
|
-
: r.assign(e, l, e instanceof SVGElement, !!args.length);
|
|
70
|
-
} else if ("function" === type) {
|
|
71
|
-
if (!e) {
|
|
72
|
-
let props,
|
|
73
|
-
next = args[0];
|
|
74
|
-
if (
|
|
75
|
-
next == null ||
|
|
76
|
-
(typeof next === "object" && !Array.isArray(next) && !(next instanceof Element))
|
|
77
|
-
)
|
|
78
|
-
props = args.shift();
|
|
79
|
-
props || (props = {});
|
|
80
|
-
if (args.length) {
|
|
81
|
-
props.children = args.length > 1 ? args : args[0];
|
|
82
|
-
}
|
|
83
|
-
const d = Object.getOwnPropertyDescriptors(props);
|
|
84
|
-
for (const k in d) {
|
|
85
|
-
if (Array.isArray(d[k].value)) {
|
|
86
|
-
const list = d[k].value;
|
|
87
|
-
props[k] = () => {
|
|
88
|
-
for (let i = 0; i < list.length; i++) {
|
|
89
|
-
while (list[i][$ELEMENT]) list[i] = list[i]();
|
|
90
|
-
}
|
|
91
|
-
return list;
|
|
92
|
-
};
|
|
93
|
-
r.dynamicProperty(props, k);
|
|
94
|
-
} else if (typeof d[k].value === "function" && !d[k].value.length)
|
|
95
|
-
r.dynamicProperty(props, k);
|
|
96
|
-
}
|
|
97
|
-
e = r.createComponent(l, props);
|
|
98
|
-
args = [];
|
|
99
|
-
} else {
|
|
100
|
-
while (l[$ELEMENT]) l = l();
|
|
101
|
-
r.insert(e, l, multiExpression ? null : undefined);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
function parseClass(string) {
|
|
106
|
-
const m = string.split(/([\.#]?[^\s#.]+)/);
|
|
107
|
-
if (/^\.|#/.test(m[1])) e = document.createElement("div");
|
|
108
|
-
for (let i = 0; i < m.length; i++) {
|
|
109
|
-
const v = m[i],
|
|
110
|
-
s = v.substring(1, v.length);
|
|
111
|
-
if (!v) continue;
|
|
112
|
-
if (!e)
|
|
113
|
-
e = r.SVGElements.has(v)
|
|
114
|
-
? document.createElementNS("http://www.w3.org/2000/svg", v)
|
|
115
|
-
: document.createElement(v);
|
|
116
|
-
else if (v[0] === ".") classes.push(s);
|
|
117
|
-
else if (v[0] === "#") e.setAttribute("id", s);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function detectMultiExpression(list) {
|
|
121
|
-
for (let i = 1; i < list.length; i++) {
|
|
122
|
-
if (typeof list[i] === "function") {
|
|
123
|
-
multiExpression = true;
|
|
124
|
-
return;
|
|
125
|
-
} else if (Array.isArray(list[i])) {
|
|
126
|
-
detectMultiExpression(list[i]);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
h.Fragment = props => props.children;
|
|
132
|
-
return h;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const h = createHyperScript({
|
|
136
|
-
spread,
|
|
137
|
-
assign,
|
|
138
|
-
insert,
|
|
139
|
-
createComponent,
|
|
140
|
-
dynamicProperty,
|
|
141
|
-
SVGElements
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
export { h as default };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var h = require('solid-js/h');
|
|
4
|
-
|
|
5
|
-
function Fragment(props) {
|
|
6
|
-
return props.children;
|
|
7
|
-
}
|
|
8
|
-
function jsx(type, props) {
|
|
9
|
-
return h(type, props);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
exports.Fragment = Fragment;
|
|
13
|
-
exports.jsx = jsx;
|
|
14
|
-
exports.jsxDEV = jsx;
|
|
15
|
-
exports.jsxs = jsx;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type { JSX } from "./jsx.d.ts";
|
|
2
|
-
import type { JSX } from "./jsx.d.ts";
|
|
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
|
-
})[];
|
|
14
|
-
export { jsx, jsx as jsxs, jsx as jsxDEV, Fragment };
|