solid-js 1.8.5 → 1.8.7

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 (49) hide show
  1. package/dist/dev.cjs +13 -10
  2. package/dist/dev.js +545 -307
  3. package/dist/server.js +170 -75
  4. package/dist/solid.cjs +8 -7
  5. package/dist/solid.js +467 -262
  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 +12 -5
  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 +7 -2
  14. package/store/dist/dev.js +114 -42
  15. package/store/dist/server.js +19 -8
  16. package/store/dist/store.js +105 -39
  17. package/store/types/index.d.ts +21 -7
  18. package/store/types/modifiers.d.ts +6 -3
  19. package/store/types/mutable.d.ts +5 -2
  20. package/store/types/server.d.ts +12 -4
  21. package/store/types/store.d.ts +218 -61
  22. package/types/index.d.ts +75 -9
  23. package/types/jsx.d.ts +11 -5
  24. package/types/reactive/array.d.ts +12 -4
  25. package/types/reactive/observable.d.ts +25 -17
  26. package/types/reactive/scheduler.d.ts +9 -6
  27. package/types/reactive/signal.d.ts +229 -140
  28. package/types/render/Suspense.d.ts +5 -5
  29. package/types/render/component.d.ts +62 -31
  30. package/types/render/flow.d.ts +43 -31
  31. package/types/render/hydration.d.ts +13 -13
  32. package/types/server/index.d.ts +57 -2
  33. package/types/server/reactive.d.ts +73 -42
  34. package/types/server/rendering.d.ts +167 -95
  35. package/universal/dist/dev.js +28 -12
  36. package/universal/dist/universal.js +28 -12
  37. package/universal/types/index.d.ts +3 -1
  38. package/universal/types/universal.d.ts +0 -1
  39. package/web/dist/dev.cjs +1 -1
  40. package/web/dist/dev.js +620 -81
  41. package/web/dist/server.cjs +28 -13
  42. package/web/dist/server.js +201 -104
  43. package/web/dist/storage.js +3 -3
  44. package/web/dist/web.cjs +1 -1
  45. package/web/dist/web.js +614 -80
  46. package/web/types/client.d.ts +2 -2
  47. package/web/types/core.d.ts +10 -1
  48. package/web/types/index.d.ts +27 -10
  49. 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 };
@@ -51,6 +51,13 @@ export namespace JSX {
51
51
  1: any;
52
52
  }
53
53
  type EventHandlerUnion<T, E extends Event> = EventHandler<T, E> | BoundEventHandler<T, E>;
54
+
55
+ const SERIALIZABLE: unique symbol;
56
+ interface SerializableAttributeValue {
57
+ toString(): string;
58
+ [SERIALIZABLE]: never;
59
+ }
60
+
54
61
  interface IntrinsicAttributes {
55
62
  ref?: unknown | ((e: unknown) => void);
56
63
  }
@@ -718,7 +725,7 @@ export namespace JSX {
718
725
  autofocus?: FunctionMaybe<boolean>;
719
726
  disabled?: FunctionMaybe<boolean>;
720
727
  form?: FunctionMaybe<string>;
721
- formaction?: FunctionMaybe<string>;
728
+ formaction?: FunctionMaybe<string | SerializableAttributeValue>;
722
729
  formenctype?: FunctionMaybe<HTMLFormEncType>;
723
730
  formmethod?: FunctionMaybe<HTMLFormMethod>;
724
731
  formnovalidate?: FunctionMaybe<boolean>;
@@ -726,7 +733,7 @@ export namespace JSX {
726
733
  name?: FunctionMaybe<string>;
727
734
  type?: FunctionMaybe<"submit" | "reset" | "button">;
728
735
  value?: FunctionMaybe<string>;
729
- formAction?: FunctionMaybe<string>;
736
+ formAction?: FunctionMaybe<string | SerializableAttributeValue>;
730
737
  formEnctype?: FunctionMaybe<HTMLFormEncType>;
731
738
  formMethod?: FunctionMaybe<HTMLFormMethod>;
732
739
  formNoValidate?: FunctionMaybe<boolean>;
@@ -767,7 +774,7 @@ export namespace JSX {
767
774
  }
768
775
  interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
769
776
  "accept-charset"?: FunctionMaybe<string>;
770
- action?: FunctionMaybe<string>;
777
+ action?: FunctionMaybe<string | SerializableAttributeValue>;
771
778
  autocomplete?: FunctionMaybe<string>;
772
779
  encoding?: FunctionMaybe<HTMLFormEncType>;
773
780
  enctype?: FunctionMaybe<HTMLFormEncType>;
@@ -819,7 +826,7 @@ export namespace JSX {
819
826
  crossorigin?: FunctionMaybe<HTMLCrossorigin>;
820
827
  disabled?: FunctionMaybe<boolean>;
821
828
  form?: FunctionMaybe<string>;
822
- formaction?: FunctionMaybe<string>;
829
+ formaction?: FunctionMaybe<string | SerializableAttributeValue>;
823
830
  formenctype?: FunctionMaybe<HTMLFormEncType>;
824
831
  formmethod?: FunctionMaybe<HTMLFormMethod>;
825
832
  formnovalidate?: FunctionMaybe<boolean>;
@@ -843,7 +850,7 @@ export namespace JSX {
843
850
  value?: FunctionMaybe<string | string[] | number>;
844
851
  width?: FunctionMaybe<number | string>;
845
852
  crossOrigin?: FunctionMaybe<HTMLCrossorigin>;
846
- formAction?: FunctionMaybe<string>;
853
+ formAction?: FunctionMaybe<string | SerializableAttributeValue>;
847
854
  formEnctype?: FunctionMaybe<HTMLFormEncType>;
848
855
  formMethod?: FunctionMaybe<HTMLFormMethod>;
849
856
  formNoValidate?: FunctionMaybe<boolean>;
@@ -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 {};