solid-js 1.8.8 → 1.8.9

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 +17 -21
  2. package/dist/dev.js +554 -321
  3. package/dist/server.js +170 -75
  4. package/dist/solid.cjs +17 -21
  5. package/dist/solid.js +481 -279
  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/jsx-runtime/types/jsx.d.ts +2 -1
  10. package/h/types/hyperscript.d.ts +11 -11
  11. package/html/dist/html.js +216 -94
  12. package/html/types/lit.d.ts +47 -33
  13. package/package.json +3 -2
  14. package/store/dist/dev.cjs +1 -1
  15. package/store/dist/dev.js +117 -42
  16. package/store/dist/server.js +19 -8
  17. package/store/dist/store.cjs +1 -1
  18. package/store/dist/store.js +108 -39
  19. package/store/types/index.d.ts +21 -7
  20. package/store/types/modifiers.d.ts +6 -3
  21. package/store/types/mutable.d.ts +5 -2
  22. package/store/types/server.d.ts +12 -4
  23. package/store/types/store.d.ts +218 -61
  24. package/types/index.d.ts +75 -10
  25. package/types/jsx.d.ts +2 -1
  26. package/types/reactive/array.d.ts +12 -4
  27. package/types/reactive/observable.d.ts +25 -17
  28. package/types/reactive/scheduler.d.ts +9 -6
  29. package/types/reactive/signal.d.ts +233 -142
  30. package/types/render/Suspense.d.ts +5 -5
  31. package/types/render/component.d.ts +64 -33
  32. package/types/render/flow.d.ts +43 -31
  33. package/types/render/hydration.d.ts +13 -13
  34. package/types/server/index.d.ts +57 -2
  35. package/types/server/reactive.d.ts +73 -42
  36. package/types/server/rendering.d.ts +167 -96
  37. package/universal/dist/dev.js +28 -12
  38. package/universal/dist/universal.js +28 -12
  39. package/universal/types/index.d.ts +3 -1
  40. package/universal/types/universal.d.ts +0 -1
  41. package/web/dist/dev.cjs +1 -1
  42. package/web/dist/dev.js +621 -82
  43. package/web/dist/server.cjs +30 -27
  44. package/web/dist/server.js +232 -121
  45. package/web/dist/storage.js +3 -3
  46. package/web/dist/web.cjs +1 -1
  47. package/web/dist/web.js +615 -81
  48. package/web/types/client.d.ts +2 -2
  49. package/web/types/core.d.ts +10 -1
  50. package/web/types/index.d.ts +27 -10
  51. 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 };
@@ -1995,7 +1995,8 @@ export namespace JSX {
1995
1995
  ruby: HTMLAttributes<HTMLElement>;
1996
1996
  s: HTMLAttributes<HTMLElement>;
1997
1997
  samp: HTMLAttributes<HTMLElement>;
1998
- script: ScriptHTMLAttributes<HTMLElement>;
1998
+ script: ScriptHTMLAttributes<HTMLScriptElement>;
1999
+ search: HTMLAttributes<HTMLElement>;
1999
2000
  section: HTMLAttributes<HTMLElement>;
2000
2001
  select: SelectHTMLAttributes<HTMLSelectElement>;
2001
2002
  slot: HTMLSlotElementAttributes;
@@ -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 {};