solid-js 1.9.6 → 1.9.8

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 (51) hide show
  1. package/dist/dev.cjs +26 -15
  2. package/dist/dev.js +334 -564
  3. package/dist/server.cjs +3 -1
  4. package/dist/server.js +83 -178
  5. package/dist/solid.cjs +26 -15
  6. package/dist/solid.js +290 -493
  7. package/h/dist/h.js +9 -40
  8. package/h/jsx-runtime/dist/jsx.js +1 -1
  9. package/h/jsx-runtime/types/index.d.ts +8 -11
  10. package/h/jsx-runtime/types/jsx.d.ts +246 -234
  11. package/h/types/hyperscript.d.ts +11 -11
  12. package/html/dist/html.js +94 -219
  13. package/html/types/lit.d.ts +33 -52
  14. package/package.json +3 -3
  15. package/store/dist/dev.cjs +9 -5
  16. package/store/dist/dev.js +50 -126
  17. package/store/dist/server.js +8 -20
  18. package/store/dist/store.cjs +9 -5
  19. package/store/dist/store.js +47 -117
  20. package/store/types/index.d.ts +7 -21
  21. package/store/types/modifiers.d.ts +3 -6
  22. package/store/types/mutable.d.ts +2 -5
  23. package/store/types/server.d.ts +5 -25
  24. package/store/types/store.d.ts +61 -218
  25. package/types/index.d.ts +11 -78
  26. package/types/jsx.d.ts +245 -229
  27. package/types/reactive/array.d.ts +4 -12
  28. package/types/reactive/observable.d.ts +16 -22
  29. package/types/reactive/scheduler.d.ts +6 -9
  30. package/types/reactive/signal.d.ts +145 -236
  31. package/types/render/Suspense.d.ts +5 -5
  32. package/types/render/component.d.ts +37 -73
  33. package/types/render/flow.d.ts +31 -43
  34. package/types/render/hydration.d.ts +15 -15
  35. package/types/server/index.d.ts +2 -57
  36. package/types/server/reactive.d.ts +45 -76
  37. package/types/server/rendering.d.ts +98 -169
  38. package/universal/dist/dev.js +12 -28
  39. package/universal/dist/universal.js +12 -28
  40. package/universal/types/index.d.ts +2 -3
  41. package/universal/types/universal.d.ts +3 -2
  42. package/web/dist/dev.cjs +89 -6
  43. package/web/dist/dev.js +174 -646
  44. package/web/dist/server.cjs +90 -5
  45. package/web/dist/server.js +194 -647
  46. package/web/dist/web.cjs +89 -6
  47. package/web/dist/web.js +172 -634
  48. package/web/storage/dist/storage.js +3 -3
  49. package/web/types/core.d.ts +1 -9
  50. package/web/types/index.d.ts +11 -31
  51. package/web/types/server-mock.d.ts +32 -47
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,18 +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
- 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
- ) {
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) {
41
25
  e.appendChild(document.createTextNode(l.toString()));
42
26
  } else if (Array.isArray(l)) {
43
27
  for (let i = 0; i < l.length; i++) item(l[i]);
@@ -49,10 +33,7 @@ function createHyperScript(r) {
49
33
  for (const k in d) {
50
34
  if (k === "class" && classes.length !== 0) {
51
35
  const fixedClasses = classes.join(" "),
52
- value =
53
- typeof d["class"].value === "function"
54
- ? () => fixedClasses + " " + d["class"].value()
55
- : fixedClasses + " " + l["class"];
36
+ value = typeof d["class"].value === "function" ? () => fixedClasses + " " + d["class"].value() : fixedClasses + " " + l["class"];
56
37
  Object.defineProperty(l, "class", {
57
38
  ...d[k],
58
39
  value
@@ -64,18 +45,12 @@ function createHyperScript(r) {
64
45
  dynamic = true;
65
46
  } else if (d[k].get) dynamic = true;
66
47
  }
67
- dynamic
68
- ? r.spread(e, l, e instanceof SVGElement, !!args.length)
69
- : 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);
70
49
  } else if ("function" === type) {
71
50
  if (!e) {
72
51
  let props,
73
52
  next = args[0];
74
- if (
75
- next == null ||
76
- (typeof next === "object" && !Array.isArray(next) && !(next instanceof Element))
77
- )
78
- props = args.shift();
53
+ if (next == null || typeof next === "object" && !Array.isArray(next) && !(next instanceof Element)) props = args.shift();
79
54
  props || (props = {});
80
55
  if (args.length) {
81
56
  props.children = args.length > 1 ? args : args[0];
@@ -91,8 +66,7 @@ function createHyperScript(r) {
91
66
  return list;
92
67
  };
93
68
  r.dynamicProperty(props, k);
94
- } else if (typeof d[k].value === "function" && !d[k].value.length)
95
- r.dynamicProperty(props, k);
69
+ } else if (typeof d[k].value === "function" && !d[k].value.length) r.dynamicProperty(props, k);
96
70
  }
97
71
  e = r.createComponent(l, props);
98
72
  args = [];
@@ -109,12 +83,7 @@ function createHyperScript(r) {
109
83
  const v = m[i],
110
84
  s = v.substring(1, v.length);
111
85
  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);
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);
118
87
  }
119
88
  }
120
89
  function detectMultiExpression(list) {
@@ -1,4 +1,4 @@
1
- import h from "solid-js/h";
1
+ import h from 'solid-js/h';
2
2
 
3
3
  function Fragment(props) {
4
4
  return props.children;
@@ -1,14 +1,11 @@
1
1
  export type { JSX } from "./jsx.d.ts";
2
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
- })[];
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 };