@solidjs/web 2.0.0-rc.2 → 2.0.0-rc.21

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 (124) hide show
  1. package/README.md +1 -1
  2. package/dist/server.dev.js +5165 -0
  3. package/dist/server.js +1876 -374
  4. package/dist/{server.cjs → server.observe.js} +2070 -577
  5. package/dist/{dev.cjs → web.dev.js} +955 -567
  6. package/dist/web.js +646 -350
  7. package/dist/{dev.js → web.observe.js} +699 -421
  8. package/frames/dist/assets.js +92 -0
  9. package/frames/dist/client.dev.js +1296 -1198
  10. package/frames/dist/client.js +1128 -1191
  11. package/frames/dist/client.observe.js +2041 -0
  12. package/frames/dist/regions.js +171 -0
  13. package/frames/dist/server.dev.js +2545 -0
  14. package/frames/dist/server.js +1683 -3004
  15. package/frames/dist/server.observe.js +2544 -0
  16. package/frames/dist/trace.js +45 -0
  17. package/frames/dist/wire.js +594 -0
  18. package/frames/package.json +2 -25
  19. package/package.json +244 -256
  20. package/performance-tracks/dist/performance-tracks.dev.js +679 -0
  21. package/performance-tracks/dist/performance-tracks.js +6 -0
  22. package/performance-tracks/dist/performance-tracks.observe.js +667 -0
  23. package/performance-tracks/package.json +7 -0
  24. package/performance-tracks/types/index.d.ts +69 -0
  25. package/serialization/decode/package.json +2 -15
  26. package/serialization/dist/decode.js +121 -25
  27. package/serialization/dist/serialization.js +282 -88
  28. package/serialization/package.json +2 -15
  29. package/serialization/types/index.d.ts +115 -153
  30. package/serialization/types/serializer-decode.d.ts +173 -114
  31. package/serialization/types/serializer.d.ts +144 -0
  32. package/server-functions/dist/client.dev.js +1462 -0
  33. package/server-functions/dist/client.js +667 -165
  34. package/server-functions/dist/client.observe.js +1441 -0
  35. package/server-functions/dist/rich-args.js +102 -1
  36. package/server-functions/dist/server.dev.js +2802 -299
  37. package/server-functions/dist/server.js +2724 -314
  38. package/server-functions/dist/server.observe.js +3680 -0
  39. package/server-functions/package.json +2 -35
  40. package/server-functions/rich-args/package.json +2 -15
  41. package/skills/server-components/SKILL.md +117 -0
  42. package/storage/package.json +2 -15
  43. package/types/client.d.ts +342 -288
  44. package/types/constants.d.ts +22 -0
  45. package/types/cookies.d.ts +32 -84
  46. package/types/diagnostics.d.ts +80 -0
  47. package/types/frames/assets-tier.d.ts +78 -0
  48. package/types/frames/client.d.ts +40 -1
  49. package/types/frames/frame-client.d.ts +443 -280
  50. package/types/frames/frame-container-plugin.d.ts +64 -0
  51. package/types/frames/frame-morph.d.ts +29 -0
  52. package/types/frames/frame-sink.d.ts +141 -161
  53. package/types/frames/frame-transport.d.ts +263 -184
  54. package/types/frames/regions-tier.d.ts +60 -0
  55. package/types/frames/serializer-decode.d.ts +241 -0
  56. package/types/frames/serializer.d.ts +115 -153
  57. package/types/frames/server.d.ts +2 -2
  58. package/types/frames/trace-tier.d.ts +2 -0
  59. package/types/frames/tree-rewrite.d.ts +39 -0
  60. package/types/frames/wire-tier.d.ts +169 -0
  61. package/types/head.d.ts +20 -0
  62. package/types/index.d.ts +98 -81
  63. package/types/index.server.d.ts +159 -0
  64. package/types/jsx.d.ts +49 -44
  65. package/types/observe.d.ts +535 -0
  66. package/types/reconcile.d.ts +1 -0
  67. package/types/render.d.ts +11 -0
  68. package/types/request-error-hook.d.ts +5 -0
  69. package/types/response.d.ts +95 -147
  70. package/types/serializer-decode.d.ts +173 -114
  71. package/types/serializer.d.ts +115 -153
  72. package/types/server-functions/argument-codec.d.ts +30 -0
  73. package/types/server-functions/client.d.ts +237 -223
  74. package/types/server-functions/flash.d.ts +28 -30
  75. package/types/server-functions/registry.d.ts +105 -0
  76. package/types/server-functions/rich-args.d.ts +1 -10
  77. package/types/server-functions/server.d.ts +538 -531
  78. package/types/server-functions/shared.d.ts +398 -425
  79. package/types/server-functions/uploads.d.ts +53 -0
  80. package/types/server-mock.d.ts +154 -20
  81. package/types/server-observe.d.ts +86 -0
  82. package/types/server.d.ts +601 -422
  83. package/types/trace.d.ts +127 -0
  84. package/LICENSE +0 -21
  85. package/dist/web.cjs +0 -2033
  86. package/frames/dist/client.cjs +0 -2002
  87. package/frames/dist/client.dev.cjs +0 -2022
  88. package/frames/dist/server.cjs +0 -3877
  89. package/serialization/dist/decode.cjs +0 -139
  90. package/serialization/dist/serialization.cjs +0 -261
  91. package/serialization/types-cjs/index.d.cts +0 -182
  92. package/serialization/types-cjs/package.json +0 -3
  93. package/serialization/types-cjs/serializer-decode.d.cts +0 -182
  94. package/server-functions/dist/client.cjs +0 -834
  95. package/server-functions/dist/rich-args.cjs +0 -11
  96. package/server-functions/dist/server.cjs +0 -1242
  97. package/server-functions/dist/server.dev.cjs +0 -1242
  98. package/storage/dist/storage.cjs +0 -12
  99. package/storage/types-cjs/index.d.cts +0 -28
  100. package/storage/types-cjs/package.json +0 -3
  101. package/types/core.d.ts +0 -9
  102. package/types-cjs/client.d.cts +0 -337
  103. package/types-cjs/cookies.d.cts +0 -93
  104. package/types-cjs/core.d.cts +0 -9
  105. package/types-cjs/frames/client.d.cts +0 -36
  106. package/types-cjs/frames/frame-client.d.cts +0 -356
  107. package/types-cjs/frames/frame-sink.d.cts +0 -194
  108. package/types-cjs/frames/frame-transport.d.cts +0 -222
  109. package/types-cjs/frames/serializer.d.cts +0 -182
  110. package/types-cjs/frames/server.d.cts +0 -52
  111. package/types-cjs/index.d.cts +0 -244
  112. package/types-cjs/jsx-properties.d.cts +0 -93
  113. package/types-cjs/jsx.d.cts +0 -4159
  114. package/types-cjs/package.json +0 -3
  115. package/types-cjs/response.d.cts +0 -174
  116. package/types-cjs/serializer-decode.d.cts +0 -182
  117. package/types-cjs/serializer.d.cts +0 -182
  118. package/types-cjs/server-functions/client.d.cts +0 -262
  119. package/types-cjs/server-functions/flash.d.cts +0 -38
  120. package/types-cjs/server-functions/rich-args.d.cts +0 -10
  121. package/types-cjs/server-functions/server.d.cts +0 -681
  122. package/types-cjs/server-functions/shared.d.cts +0 -523
  123. package/types-cjs/server-mock.d.cts +0 -286
  124. package/types-cjs/server.d.cts +0 -544
package/types/jsx.d.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  /**
2
- THIS FILE IS GENERATED BY `./jsx-update.mjs`.
3
- PLEASE UPDATE `jsx-h.d.ts` INSTEAD AND RUN `pnpm jsx-sync-types`.
4
- */
2
+ * THIS FILE IS GENERATED by `scripts/jsx-sync.mjs`.
3
+ * Edit `jsx-h.d.ts` and run `pnpm --filter @solidjs/web jsx-sync`
4
+ * (also runs as part of `pnpm types`).
5
+ */
5
6
 
6
7
  import * as csstype from "csstype";
7
8
  import type { PropKey, WidenPropValue } from "./jsx-properties.js";
8
9
  import type { Element as SolidElement } from "solid-js";
9
10
 
10
11
  /**
11
- * Originally based on JSX types for Surplus and Inferno and adapted for `dom-expressions`.
12
+ * Originally based on JSX types for Surplus and Inferno and adapted for Solid.
12
13
  *
13
14
  * - https://github.com/adamhaile/surplus/blob/master/index.d.ts
14
15
  * - https://github.com/infernojs/inferno/blob/master/packages/inferno/src/core/types.ts
@@ -230,7 +231,7 @@ export namespace JSX {
230
231
  | boolean
231
232
  | null
232
233
  | undefined
233
- | Record<string, boolean>
234
+ | Record<string, boolean | undefined>
234
235
  | ClassValue[];
235
236
 
236
237
  const SERIALIZABLE: unique symbol;
@@ -250,12 +251,12 @@ export namespace JSX {
250
251
  children?: Element | undefined;
251
252
  $ServerOnly?: boolean | undefined;
252
253
  /**
253
- * Entity identity for server markup (SSR-only): compiles to the `_key`
254
- * attribute the frame morph matches keyed elements by, so live element
255
- * state (form values, `open`, focus) follows the entity across
256
- * reordering morphs. Sibling-scoped, like client keyed rendering.
257
- * Stripped from DOM compiles; on components, `$key` is slot occurrence
258
- * identity instead.
254
+ * Entity identity for server markup: the frame morph matches keyed
255
+ * elements across responses by it, so client state attached to the
256
+ * element (focus, selection) follows the entity through reorders and
257
+ * refetches. SSR compiles it to the `_key` attribute; a DOM compile strips
258
+ * it. On a component, `$key` is slot occurrence identity across
259
+ * responses (optional; without it identity is positional).
259
260
  */
260
261
  $key?: string | number | undefined;
261
262
  }
@@ -894,6 +895,13 @@ export namespace JSX {
894
895
  extends CustomAttributes<T>, PropAttributes, EventHandlersElement<T>, AriaAttributes {
895
896
  // [key: ClassKeys]: boolean;
896
897
 
898
+ /**
899
+ * `data-*` attributes. JSX already accepts hyphenated names; this types
900
+ * them in props objects too (`ComponentProps<"div">`, a spread's source).
901
+ * `true` writes `""`; `false` and `undefined` remove the attribute.
902
+ */
903
+ [key: `data-${string}`]: string | number | boolean | undefined;
904
+
897
905
  // properties
898
906
  innerHTML?: string;
899
907
  textContent?: string | number;
@@ -1088,6 +1096,7 @@ export namespace JSX {
1088
1096
  type HTMLFormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain";
1089
1097
  type HTMLFormMethod = "post" | "get" | "dialog";
1090
1098
  type HTMLCrossorigin = "anonymous" | "use-credentials" | EnumeratedAcceptsEmpty;
1099
+ type HTMLFetchPriority = "high" | "low" | "auto";
1091
1100
  type HTMLReferrerPolicy =
1092
1101
  | "no-referrer"
1093
1102
  | "no-referrer-when-downgrade"
@@ -1113,21 +1122,20 @@ export namespace JSX {
1113
1122
  | "allow-top-navigation"
1114
1123
  | "allow-top-navigation-by-user-activation"
1115
1124
  | "allow-top-navigation-to-custom-protocols";
1116
- type HTMLLinkAs =
1117
- | "audio"
1118
- | "document"
1119
- | "embed"
1120
- | "fetch"
1121
- | "font"
1122
- | "image"
1123
- | "object"
1124
- | "script"
1125
- | "style"
1126
- | "track"
1127
- | "video"
1128
- | "worker";
1129
-
1130
- interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
1125
+ type HTMLPreloadAs = "fetch" | "font" | "image" | "script" | "style" | "track";
1126
+ type HTMLLinkAs = HTMLPreloadAs | "audio" | "document" | "embed" | "object" | "video" | "worker";
1127
+
1128
+ /**
1129
+ * `xmlns` on the tags that exist in both HTML and SVG (`a`, `script`, `style`,
1130
+ * `title`). The compiler reads it to pick the namespace when the tag is not
1131
+ * nested under `<svg>` at compile time (e.g. an XML partial), and `dynamic()`
1132
+ * honors it the same way when creating a tag-name element at runtime.
1133
+ */
1134
+ interface AmbiguousNamespaceAttributes {
1135
+ xmlns?: string | RemoveAttribute;
1136
+ }
1137
+
1138
+ interface AnchorHTMLAttributes<T> extends HTMLAttributes<T>, AmbiguousNamespaceAttributes {
1131
1139
  download?: string | EnumeratedAcceptsEmpty | RemoveAttribute;
1132
1140
  href?: string | SerializableAttributeValue | RemoveAttribute;
1133
1141
  hreflang?: string | RemoveAttribute;
@@ -1137,20 +1145,11 @@ export namespace JSX {
1137
1145
  target?: "_self" | "_blank" | "_parent" | "_top" | (string & {}) | RemoveAttribute;
1138
1146
  type?: string | RemoveAttribute;
1139
1147
 
1140
- // Client-side navigation contract. These attributes are inert markup on
1141
- // their own — a routing integration that delegates anchor clicks (e.g.
1142
- // @solidjs/router) reads them off the element at event time. Typed here
1143
- // so plain `<a>` elements participate without per-router augmentation.
1148
+ // Client-side navigation contract. `link` is inert markup on its own —
1149
+ // a routing integration that delegates anchor clicks (e.g. @solidjs/router)
1150
+ // reads it off the element at event time.
1144
1151
  /** Marks the anchor as a client-navigation link when the integration requires explicit opt-in. */
1145
1152
  link?: BooleanAttribute | RemoveAttribute;
1146
- /** Serialized (JSON) history state pushed alongside the navigation. */
1147
- state?: string | RemoveAttribute;
1148
- /** Suppress scroll restoration/reset after the navigation. */
1149
- noScroll?: BooleanAttribute | RemoveAttribute;
1150
- /** Replace the current history entry instead of pushing a new one. */
1151
- replace?: BooleanAttribute | RemoveAttribute;
1152
- /** Route preload intent; `"false"` disables the integration's default eager preload. */
1153
- preload?: boolean | "false" | RemoveAttribute;
1154
1153
 
1155
1154
  /** @experimental */
1156
1155
  attributionsrc?: string | RemoveAttribute;
@@ -1375,7 +1374,7 @@ export namespace JSX {
1375
1374
  browsingtopics?: string | RemoveAttribute;
1376
1375
  crossorigin?: HTMLCrossorigin | RemoveAttribute;
1377
1376
  decoding?: "sync" | "async" | "auto" | RemoveAttribute;
1378
- fetchpriority?: "high" | "low" | "auto" | RemoveAttribute;
1377
+ fetchpriority?: HTMLFetchPriority | RemoveAttribute;
1379
1378
  height?: number | string | RemoveAttribute;
1380
1379
  ismap?: BooleanAttribute | RemoveAttribute;
1381
1380
  loading?: "eager" | "lazy" | RemoveAttribute;
@@ -1530,7 +1529,7 @@ export namespace JSX {
1530
1529
  color?: string | RemoveAttribute;
1531
1530
  crossorigin?: HTMLCrossorigin | RemoveAttribute;
1532
1531
  disabled?: BooleanAttribute | RemoveAttribute;
1533
- fetchpriority?: "high" | "low" | "auto" | RemoveAttribute;
1532
+ fetchpriority?: HTMLFetchPriority | RemoveAttribute;
1534
1533
  href?: string | RemoveAttribute;
1535
1534
  hreflang?: string | RemoveAttribute;
1536
1535
  imagesizes?: string | RemoveAttribute;
@@ -1716,12 +1715,12 @@ export namespace JSX {
1716
1715
  max?: number | string | RemoveAttribute;
1717
1716
  value?: string | string[] | number | RemoveAttribute;
1718
1717
  }
1719
- interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
1718
+ interface ScriptHTMLAttributes<T> extends HTMLAttributes<T>, AmbiguousNamespaceAttributes {
1720
1719
  async?: BooleanAttribute | RemoveAttribute;
1721
1720
  blocking?: "render" | RemoveAttribute;
1722
1721
  crossorigin?: HTMLCrossorigin | RemoveAttribute;
1723
1722
  defer?: BooleanAttribute | RemoveAttribute;
1724
- fetchpriority?: "high" | "low" | "auto" | RemoveAttribute;
1723
+ fetchpriority?: HTMLFetchPriority | RemoveAttribute;
1725
1724
  for?: string | RemoveAttribute;
1726
1725
  integrity?: string | RemoveAttribute;
1727
1726
  nomodule?: BooleanAttribute | RemoveAttribute;
@@ -1778,7 +1777,7 @@ export namespace JSX {
1778
1777
  type?: string | RemoveAttribute;
1779
1778
  width?: number | string | RemoveAttribute;
1780
1779
  }
1781
- interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
1780
+ interface StyleHTMLAttributes<T> extends HTMLAttributes<T>, AmbiguousNamespaceAttributes {
1782
1781
  blocking?: "render" | RemoveAttribute;
1783
1782
  media?: string | RemoveAttribute;
1784
1783
 
@@ -1879,6 +1878,7 @@ export namespace JSX {
1879
1878
  interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
1880
1879
  datetime?: string | RemoveAttribute;
1881
1880
  }
1881
+ interface TitleHTMLAttributes<T> extends HTMLAttributes<T>, AmbiguousNamespaceAttributes {}
1882
1882
  interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
1883
1883
  default?: BooleanAttribute | RemoveAttribute;
1884
1884
  kind?:
@@ -3508,6 +3508,11 @@ export namespace JSX {
3508
3508
  * @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement
3509
3509
  */
3510
3510
  select: SelectHTMLAttributes<HTMLSelectElement> & Properties<HTMLSelectElement>;
3511
+ /**
3512
+ * @url https://developer.mozilla.org/en-US/docs/Web/HTML/Element/selectedcontent
3513
+ * @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectedContentElement
3514
+ */
3515
+ selectedcontent: HTMLAttributes<HTMLElement> & Properties<HTMLElement>;
3511
3516
  /**
3512
3517
  * @url https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot
3513
3518
  * @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLSlotElement
@@ -3602,7 +3607,7 @@ export namespace JSX {
3602
3607
  * @url https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
3603
3608
  * @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLTitleElement
3604
3609
  */
3605
- title: HTMLAttributes<HTMLTitleElement> & Properties<HTMLTitleElement>;
3610
+ title: TitleHTMLAttributes<HTMLTitleElement> & Properties<HTMLTitleElement>;
3606
3611
  /**
3607
3612
  * @url https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr
3608
3613
  * @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement