solid-js 1.8.2 → 1.8.3

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 (43) hide show
  1. package/dist/dev.cjs +1 -1
  2. package/dist/dev.js +534 -299
  3. package/dist/server.js +170 -75
  4. package/dist/solid.cjs +1 -1
  5. package/dist/solid.js +461 -257
  6. package/h/dist/h.js +34 -8
  7. package/h/jsx-runtime/dist/jsx.js +1 -1
  8. package/h/jsx-runtime/types/index.d.ts +11 -8
  9. package/h/types/hyperscript.d.ts +11 -11
  10. package/html/dist/html.js +216 -94
  11. package/html/types/lit.d.ts +45 -31
  12. package/package.json +1 -1
  13. package/store/dist/dev.js +114 -42
  14. package/store/dist/server.js +19 -8
  15. package/store/dist/store.js +105 -39
  16. package/store/types/index.d.ts +21 -7
  17. package/store/types/modifiers.d.ts +6 -3
  18. package/store/types/mutable.d.ts +5 -2
  19. package/store/types/server.d.ts +12 -4
  20. package/store/types/store.d.ts +218 -61
  21. package/types/index.d.ts +72 -9
  22. package/types/reactive/array.d.ts +12 -4
  23. package/types/reactive/observable.d.ts +25 -17
  24. package/types/reactive/scheduler.d.ts +9 -6
  25. package/types/reactive/signal.d.ts +228 -140
  26. package/types/render/Suspense.d.ts +5 -5
  27. package/types/render/component.d.ts +62 -31
  28. package/types/render/flow.d.ts +43 -31
  29. package/types/render/hydration.d.ts +13 -13
  30. package/types/server/index.d.ts +57 -2
  31. package/types/server/reactive.d.ts +73 -42
  32. package/types/server/rendering.d.ts +166 -95
  33. package/universal/dist/dev.js +28 -12
  34. package/universal/dist/universal.js +28 -12
  35. package/universal/types/index.d.ts +3 -1
  36. package/universal/types/universal.d.ts +0 -1
  37. package/web/dist/dev.js +617 -81
  38. package/web/dist/server.js +175 -92
  39. package/web/dist/web.js +611 -80
  40. package/web/types/client.d.ts +2 -2
  41. package/web/types/core.d.ts +10 -1
  42. package/web/types/index.d.ts +27 -10
  43. package/web/types/server-mock.d.ts +47 -32
package/h/dist/h.js CHANGED
@@ -1,4 +1,11 @@
1
- import { spread, assign, insert, createComponent, dynamicProperty, SVGElements } from 'solid-js/web';
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) ;else if ("string" === type) {
21
- if (!e) parseClass(l);else e.appendChild(document.createTextNode(l));
22
- } else if ("number" === type || "boolean" === type || l instanceof Date || l instanceof RegExp) {
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 ? r.spread(e, l, e instanceof SVGElement, !!args.length) : r.assign(e, l, e instanceof SVGElement, !!args.length);
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 (next == null || typeof next === "object" && !Array.isArray(next) && !(next instanceof Element)) props = args.shift();
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) r.dynamicProperty(props, k);
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) e = r.SVGElements.has(v) ? document.createElementNS("http://www.w3.org/2000/svg", v) : document.createElement(v);else if (v[0] === ".") e.classList.add(s);else if (v[0] === "#") e.setAttribute("id", s);
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,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,11 +1,14 @@
1
1
  export type { JSX } from "./jsx";
2
2
  import type { JSX } from "./jsx";
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
- })[];
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 };
@@ -1,20 +1,20 @@
1
1
  type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
2
2
  interface Runtime {
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>;
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
- [key: string]: any;
11
+ [key: string]: any;
12
12
  };
13
13
  export type HyperScript = {
14
- (...args: any[]): () => ExpandableNode | ExpandableNode[];
15
- Fragment: (props: {
16
- children: (() => ExpandableNode) | (() => ExpandableNode)[];
17
- }) => ExpandableNode[];
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 {};