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.
Files changed (76) hide show
  1. package/dist/dev.cjs +213 -1603
  2. package/dist/dev.js +159 -1749
  3. package/dist/server.cjs +88 -11
  4. package/dist/server.js +91 -11
  5. package/dist/solid.cjs +196 -1558
  6. package/dist/solid.js +139 -1682
  7. package/package.json +8 -154
  8. package/types/{render → client}/component.d.ts +0 -61
  9. package/types/client/core.d.ts +75 -0
  10. package/types/client/flow.d.ts +114 -0
  11. package/types/{render → client}/hydration.d.ts +0 -2
  12. package/types/{reactive → client}/observable.d.ts +1 -1
  13. package/types/index.d.ts +44 -55
  14. package/types/jsx.d.ts +1944 -174
  15. package/types/server/index.d.ts +1 -1
  16. package/types/server/reactive.d.ts +6 -1
  17. package/types/server/store.d.ts +6 -0
  18. package/h/dist/h.cjs +0 -115
  19. package/h/dist/h.js +0 -144
  20. package/h/jsx-dev-runtime/package.json +0 -8
  21. package/h/jsx-runtime/dist/jsx.cjs +0 -15
  22. package/h/jsx-runtime/dist/jsx.js +0 -10
  23. package/h/jsx-runtime/package.json +0 -8
  24. package/h/jsx-runtime/types/index.d.ts +0 -14
  25. package/h/jsx-runtime/types/jsx.d.ts +0 -2276
  26. package/h/package.json +0 -8
  27. package/h/types/hyperscript.d.ts +0 -20
  28. package/h/types/index.d.ts +0 -3
  29. package/html/dist/html.cjs +0 -583
  30. package/html/dist/html.js +0 -706
  31. package/html/package.json +0 -8
  32. package/html/types/index.d.ts +0 -3
  33. package/html/types/lit.d.ts +0 -60
  34. package/store/dist/dev.cjs +0 -454
  35. package/store/dist/dev.js +0 -525
  36. package/store/dist/server.cjs +0 -126
  37. package/store/dist/server.js +0 -126
  38. package/store/dist/store.cjs +0 -434
  39. package/store/dist/store.js +0 -499
  40. package/store/package.json +0 -46
  41. package/store/types/index.d.ts +0 -26
  42. package/store/types/modifiers.d.ts +0 -9
  43. package/store/types/mutable.d.ts +0 -8
  44. package/store/types/server.d.ts +0 -37
  45. package/store/types/store.d.ts +0 -263
  46. package/types/reactive/array.d.ts +0 -52
  47. package/types/reactive/scheduler.d.ts +0 -13
  48. package/types/reactive/signal.d.ts +0 -664
  49. package/types/render/Suspense.d.ts +0 -26
  50. package/types/render/flow.d.ts +0 -130
  51. package/types/render/index.d.ts +0 -4
  52. package/universal/dist/dev.cjs +0 -243
  53. package/universal/dist/dev.js +0 -257
  54. package/universal/dist/universal.cjs +0 -243
  55. package/universal/dist/universal.js +0 -257
  56. package/universal/package.json +0 -20
  57. package/universal/types/index.d.ts +0 -4
  58. package/universal/types/universal.d.ts +0 -29
  59. package/web/dist/dev.cjs +0 -804
  60. package/web/dist/dev.js +0 -1241
  61. package/web/dist/server.cjs +0 -793
  62. package/web/dist/server.js +0 -1214
  63. package/web/dist/web.cjs +0 -793
  64. package/web/dist/web.js +0 -1220
  65. package/web/package.json +0 -46
  66. package/web/storage/dist/storage.cjs +0 -12
  67. package/web/storage/dist/storage.js +0 -10
  68. package/web/storage/package.json +0 -15
  69. package/web/storage/types/index.d.ts +0 -2
  70. package/web/storage/types/index.js +0 -13
  71. package/web/types/client.d.ts +0 -79
  72. package/web/types/core.d.ts +0 -10
  73. package/web/types/index.d.ts +0 -54
  74. package/web/types/jsx.d.ts +0 -1
  75. package/web/types/server-mock.d.ts +0 -80
  76. package/web/types/server.d.ts +0 -177
@@ -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](): any;
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,8 +0,0 @@
1
- {
2
- "name": "solid-js/h/jsx-dev-runtime",
3
- "main": "../jsx-runtime/dist/jsx.cjs",
4
- "module": "../jsx-runtime/dist/jsx.js",
5
- "types": "../jsx-runtime/types/index.d.ts",
6
- "type": "module",
7
- "sideEffects": false
8
- }
@@ -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,10 +0,0 @@
1
- import h from "solid-js/h";
2
-
3
- function Fragment(props) {
4
- return props.children;
5
- }
6
- function jsx(type, props) {
7
- return h(type, props);
8
- }
9
-
10
- export { Fragment, jsx, jsx as jsxDEV, jsx as jsxs };
@@ -1,8 +0,0 @@
1
- {
2
- "name": "solid-js/h/jsx-runtime",
3
- "main": "./dist/jsx.cjs",
4
- "module": "./dist/jsx.js",
5
- "types": "./types/index.d.ts",
6
- "type": "module",
7
- "sideEffects": false
8
- }
@@ -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 };