@solidjs/web 2.0.0-rc.1 → 2.0.0-rc.11

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 (107) hide show
  1. package/dist/server.dev.js +4472 -0
  2. package/dist/server.js +1301 -251
  3. package/dist/{server.cjs → server.observe.js} +1501 -452
  4. package/dist/{dev.cjs → web.dev.js} +699 -360
  5. package/dist/web.js +454 -139
  6. package/dist/{dev.js → web.observe.js} +505 -211
  7. package/frames/dist/client.dev.js +463 -71
  8. package/frames/dist/client.js +363 -70
  9. package/frames/dist/{client.dev.cjs → client.observe.js} +486 -133
  10. package/frames/dist/server.dev.js +1713 -0
  11. package/frames/dist/server.js +552 -2583
  12. package/frames/dist/server.observe.js +1713 -0
  13. package/frames/package.json +2 -25
  14. package/package.json +214 -255
  15. package/performance-tracks/dist/performance-tracks.dev.js +678 -0
  16. package/performance-tracks/dist/performance-tracks.js +6 -0
  17. package/performance-tracks/dist/performance-tracks.observe.js +666 -0
  18. package/performance-tracks/package.json +7 -0
  19. package/performance-tracks/types/index.d.ts +67 -0
  20. package/serialization/decode/package.json +2 -15
  21. package/serialization/dist/decode.js +92 -15
  22. package/serialization/dist/serialization.js +103 -23
  23. package/serialization/package.json +2 -15
  24. package/serialization/types/index.d.ts +76 -157
  25. package/serialization/types/serializer-decode.d.ts +149 -112
  26. package/serialization/types/serializer.d.ts +101 -0
  27. package/server-functions/dist/client.dev.js +1364 -0
  28. package/server-functions/dist/client.js +611 -97
  29. package/server-functions/dist/client.observe.js +1343 -0
  30. package/server-functions/dist/server.dev.js +2138 -202
  31. package/server-functions/dist/server.js +2042 -199
  32. package/server-functions/dist/server.observe.js +3043 -0
  33. package/server-functions/package.json +2 -35
  34. package/server-functions/rich-args/package.json +2 -15
  35. package/storage/package.json +2 -15
  36. package/types/client.d.ts +193 -288
  37. package/types/constants.d.ts +20 -0
  38. package/types/cookies.d.ts +32 -84
  39. package/types/diagnostics.d.ts +56 -0
  40. package/types/frames/client.d.ts +1 -1
  41. package/types/frames/frame-client.d.ts +323 -259
  42. package/types/frames/frame-container-plugin.d.ts +72 -0
  43. package/types/frames/frame-sink.d.ts +101 -158
  44. package/types/frames/frame-transport.d.ts +192 -190
  45. package/types/frames/serializer-decode.d.ts +219 -0
  46. package/types/frames/serializer.d.ts +76 -157
  47. package/types/frames/server.d.ts +1 -1
  48. package/types/head.d.ts +19 -0
  49. package/types/index.d.ts +52 -80
  50. package/types/index.server.d.ts +174 -0
  51. package/types/jsx.d.ts +33 -35
  52. package/types/observe.d.ts +358 -0
  53. package/types/reconcile.d.ts +1 -0
  54. package/types/render.d.ts +9 -0
  55. package/types/response.d.ts +75 -150
  56. package/types/serializer-decode.d.ts +149 -112
  57. package/types/serializer.d.ts +76 -157
  58. package/types/server-functions/client.d.ts +192 -194
  59. package/types/server-functions/flash.d.ts +28 -30
  60. package/types/server-functions/registry.d.ts +102 -0
  61. package/types/server-functions/rich-args.d.ts +1 -10
  62. package/types/server-functions/server.d.ts +511 -475
  63. package/types/server-functions/shared.d.ts +366 -425
  64. package/types/server-mock.d.ts +110 -13
  65. package/types/server-observe.d.ts +77 -0
  66. package/types/server.d.ts +425 -425
  67. package/types/trace.d.ts +127 -0
  68. package/LICENSE +0 -21
  69. package/dist/web.cjs +0 -2008
  70. package/frames/dist/client.cjs +0 -1916
  71. package/frames/dist/server.cjs +0 -3756
  72. package/serialization/dist/decode.cjs +0 -122
  73. package/serialization/dist/serialization.cjs +0 -244
  74. package/serialization/types-cjs/index.d.cts +0 -182
  75. package/serialization/types-cjs/package.json +0 -3
  76. package/serialization/types-cjs/serializer-decode.d.cts +0 -182
  77. package/server-functions/dist/client.cjs +0 -793
  78. package/server-functions/dist/rich-args.cjs +0 -11
  79. package/server-functions/dist/server.cjs +0 -1171
  80. package/server-functions/dist/server.dev.cjs +0 -1171
  81. package/storage/dist/storage.cjs +0 -12
  82. package/storage/types-cjs/index.d.cts +0 -28
  83. package/storage/types-cjs/package.json +0 -3
  84. package/types/core.d.ts +0 -6
  85. package/types-cjs/client.d.cts +0 -337
  86. package/types-cjs/cookies.d.cts +0 -93
  87. package/types-cjs/core.d.cts +0 -6
  88. package/types-cjs/frames/client.d.cts +0 -36
  89. package/types-cjs/frames/frame-client.d.cts +0 -338
  90. package/types-cjs/frames/frame-sink.d.cts +0 -194
  91. package/types-cjs/frames/frame-transport.d.cts +0 -222
  92. package/types-cjs/frames/serializer.d.cts +0 -182
  93. package/types-cjs/frames/server.d.cts +0 -52
  94. package/types-cjs/index.d.cts +0 -244
  95. package/types-cjs/jsx-properties.d.cts +0 -93
  96. package/types-cjs/jsx.d.cts +0 -4159
  97. package/types-cjs/package.json +0 -3
  98. package/types-cjs/response.d.cts +0 -174
  99. package/types-cjs/serializer-decode.d.cts +0 -182
  100. package/types-cjs/serializer.d.cts +0 -182
  101. package/types-cjs/server-functions/client.d.cts +0 -231
  102. package/types-cjs/server-functions/flash.d.cts +0 -38
  103. package/types-cjs/server-functions/rich-args.d.cts +0 -10
  104. package/types-cjs/server-functions/server.d.cts +0 -616
  105. package/types-cjs/server-functions/shared.d.cts +0 -523
  106. package/types-cjs/server-mock.d.cts +0 -277
  107. package/types-cjs/server.d.cts +0 -523
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
@@ -249,15 +250,6 @@ export namespace JSX {
249
250
  ref?: Ref<T>;
250
251
  children?: Element | undefined;
251
252
  $ServerOnly?: boolean | undefined;
252
- /**
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.
259
- */
260
- $key?: string | number | undefined;
261
253
  }
262
254
  interface ExplicitProperties {}
263
255
  type PropAttributes = {
@@ -1088,6 +1080,7 @@ export namespace JSX {
1088
1080
  type HTMLFormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain";
1089
1081
  type HTMLFormMethod = "post" | "get" | "dialog";
1090
1082
  type HTMLCrossorigin = "anonymous" | "use-credentials" | EnumeratedAcceptsEmpty;
1083
+ type HTMLFetchPriority = "high" | "low" | "auto";
1091
1084
  type HTMLReferrerPolicy =
1092
1085
  | "no-referrer"
1093
1086
  | "no-referrer-when-downgrade"
@@ -1113,21 +1106,20 @@ export namespace JSX {
1113
1106
  | "allow-top-navigation"
1114
1107
  | "allow-top-navigation-by-user-activation"
1115
1108
  | "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> {
1109
+ type HTMLPreloadAs = "fetch" | "font" | "image" | "script" | "style" | "track";
1110
+ type HTMLLinkAs = HTMLPreloadAs | "audio" | "document" | "embed" | "object" | "video" | "worker";
1111
+
1112
+ /**
1113
+ * `xmlns` on the tags that exist in both HTML and SVG (`a`, `script`, `style`,
1114
+ * `title`). The compiler reads it to pick the namespace when the tag is not
1115
+ * nested under `<svg>` at compile time (e.g. an XML partial), and `dynamic()`
1116
+ * honors it the same way when creating a tag-name element at runtime.
1117
+ */
1118
+ interface AmbiguousNamespaceAttributes {
1119
+ xmlns?: string | RemoveAttribute;
1120
+ }
1121
+
1122
+ interface AnchorHTMLAttributes<T> extends HTMLAttributes<T>, AmbiguousNamespaceAttributes {
1131
1123
  download?: string | EnumeratedAcceptsEmpty | RemoveAttribute;
1132
1124
  href?: string | SerializableAttributeValue | RemoveAttribute;
1133
1125
  hreflang?: string | RemoveAttribute;
@@ -1146,7 +1138,7 @@ export namespace JSX {
1146
1138
  /** Serialized (JSON) history state pushed alongside the navigation. */
1147
1139
  state?: string | RemoveAttribute;
1148
1140
  /** Suppress scroll restoration/reset after the navigation. */
1149
- noScroll?: BooleanAttribute | RemoveAttribute;
1141
+ noscroll?: BooleanAttribute | RemoveAttribute;
1150
1142
  /** Replace the current history entry instead of pushing a new one. */
1151
1143
  replace?: BooleanAttribute | RemoveAttribute;
1152
1144
  /** Route preload intent; `"false"` disables the integration's default eager preload. */
@@ -1375,7 +1367,7 @@ export namespace JSX {
1375
1367
  browsingtopics?: string | RemoveAttribute;
1376
1368
  crossorigin?: HTMLCrossorigin | RemoveAttribute;
1377
1369
  decoding?: "sync" | "async" | "auto" | RemoveAttribute;
1378
- fetchpriority?: "high" | "low" | "auto" | RemoveAttribute;
1370
+ fetchpriority?: HTMLFetchPriority | RemoveAttribute;
1379
1371
  height?: number | string | RemoveAttribute;
1380
1372
  ismap?: BooleanAttribute | RemoveAttribute;
1381
1373
  loading?: "eager" | "lazy" | RemoveAttribute;
@@ -1530,7 +1522,7 @@ export namespace JSX {
1530
1522
  color?: string | RemoveAttribute;
1531
1523
  crossorigin?: HTMLCrossorigin | RemoveAttribute;
1532
1524
  disabled?: BooleanAttribute | RemoveAttribute;
1533
- fetchpriority?: "high" | "low" | "auto" | RemoveAttribute;
1525
+ fetchpriority?: HTMLFetchPriority | RemoveAttribute;
1534
1526
  href?: string | RemoveAttribute;
1535
1527
  hreflang?: string | RemoveAttribute;
1536
1528
  imagesizes?: string | RemoveAttribute;
@@ -1716,12 +1708,12 @@ export namespace JSX {
1716
1708
  max?: number | string | RemoveAttribute;
1717
1709
  value?: string | string[] | number | RemoveAttribute;
1718
1710
  }
1719
- interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
1711
+ interface ScriptHTMLAttributes<T> extends HTMLAttributes<T>, AmbiguousNamespaceAttributes {
1720
1712
  async?: BooleanAttribute | RemoveAttribute;
1721
1713
  blocking?: "render" | RemoveAttribute;
1722
1714
  crossorigin?: HTMLCrossorigin | RemoveAttribute;
1723
1715
  defer?: BooleanAttribute | RemoveAttribute;
1724
- fetchpriority?: "high" | "low" | "auto" | RemoveAttribute;
1716
+ fetchpriority?: HTMLFetchPriority | RemoveAttribute;
1725
1717
  for?: string | RemoveAttribute;
1726
1718
  integrity?: string | RemoveAttribute;
1727
1719
  nomodule?: BooleanAttribute | RemoveAttribute;
@@ -1778,7 +1770,7 @@ export namespace JSX {
1778
1770
  type?: string | RemoveAttribute;
1779
1771
  width?: number | string | RemoveAttribute;
1780
1772
  }
1781
- interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
1773
+ interface StyleHTMLAttributes<T> extends HTMLAttributes<T>, AmbiguousNamespaceAttributes {
1782
1774
  blocking?: "render" | RemoveAttribute;
1783
1775
  media?: string | RemoveAttribute;
1784
1776
 
@@ -1879,6 +1871,7 @@ export namespace JSX {
1879
1871
  interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
1880
1872
  datetime?: string | RemoveAttribute;
1881
1873
  }
1874
+ interface TitleHTMLAttributes<T> extends HTMLAttributes<T>, AmbiguousNamespaceAttributes {}
1882
1875
  interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
1883
1876
  default?: BooleanAttribute | RemoveAttribute;
1884
1877
  kind?:
@@ -3508,6 +3501,11 @@ export namespace JSX {
3508
3501
  * @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement
3509
3502
  */
3510
3503
  select: SelectHTMLAttributes<HTMLSelectElement> & Properties<HTMLSelectElement>;
3504
+ /**
3505
+ * @url https://developer.mozilla.org/en-US/docs/Web/HTML/Element/selectedcontent
3506
+ * @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectedContentElement
3507
+ */
3508
+ selectedcontent: HTMLAttributes<HTMLElement> & Properties<HTMLElement>;
3511
3509
  /**
3512
3510
  * @url https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot
3513
3511
  * @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLSlotElement
@@ -3602,7 +3600,7 @@ export namespace JSX {
3602
3600
  * @url https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
3603
3601
  * @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLTitleElement
3604
3602
  */
3605
- title: HTMLAttributes<HTMLTitleElement> & Properties<HTMLTitleElement>;
3603
+ title: TitleHTMLAttributes<HTMLTitleElement> & Properties<HTMLTitleElement>;
3606
3604
  /**
3607
3605
  * @url https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr
3608
3606
  * @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement
@@ -0,0 +1,358 @@
1
+ import type { ChangeOrigin, Records } from "solid-js";
2
+ import type { RequestEvent } from "./server.js";
3
+ import type { TraceContext } from "./trace.js";
4
+ /**
5
+ * The records channel — `OBSERVE.records` — or `undefined` outside observe
6
+ * builds and where no observing core has loaded. An emitter's first check.
7
+ */
8
+ export declare function records(): Records | undefined;
9
+ /**
10
+ * One server function execution, delivered on
11
+ * `OBSERVE.records.subscribe("invocation", …)` once it settled.
12
+ * Serializable — the live handles (`event`, `args`, the thrown error)
13
+ * travel beside it in `InvocationLive`, not on it.
14
+ */
15
+ export interface InvocationEvent {
16
+ /** The function id — the name a span or a log line carries. */
17
+ id: string;
18
+ /** `true` for an in-process call during SSR, `false` for HTTP dispatch. */
19
+ direct: boolean;
20
+ /** `performance.now()` when the execution started. */
21
+ at: number;
22
+ /**
23
+ * Start → settle of the execution, in milliseconds. The execution is the
24
+ * `wrapInvocation`-wrapped run: what the request spent on the call,
25
+ * policy included (auth guards, per-function middleware). A generator or
26
+ * stream body settles at handoff — see `deferred`.
27
+ */
28
+ durationMs: number;
29
+ outcome: "ok" | "error";
30
+ /**
31
+ * The settled value is a body the caller drives — a generator, a
32
+ * `ReadableStream` — so `durationMs` covers the call that produced it,
33
+ * not its consumption.
34
+ */
35
+ deferred?: true;
36
+ /**
37
+ * Direct calls only: the hydration id of the `<Loading>` boundary whose
38
+ * render pass made the call — the `id` of that boundary's `"boundary"`
39
+ * record — so a boundary's wait can be read as the server-function calls
40
+ * it consisted of. Absent for a call outside any boundary's pass (the
41
+ * shell, or HTTP dispatch).
42
+ */
43
+ boundary?: string;
44
+ }
45
+ /**
46
+ * The live half of an invocation, for in-process consumers. Not part of the
47
+ * record: `args` and `result` are application data (name/PII policy belongs
48
+ * to the consumer), `error` is the value AS THROWN — before the HTTP
49
+ * handler's production sanitization replaces it on the wire — and `event`
50
+ * is the request event the call ran under (the per-call derived event for
51
+ * direct calls).
52
+ */
53
+ export interface InvocationLive {
54
+ event: RequestEvent;
55
+ /** HTTP dispatch only; absent for direct calls. */
56
+ request?: Request;
57
+ args: unknown[];
58
+ /** The settled value, when `outcome` is `"ok"`. */
59
+ result?: unknown;
60
+ /** The thrown value, when `outcome` is `"error"`. */
61
+ error?: unknown;
62
+ }
63
+ export type InvocationListener = (event: InvocationEvent, live: InvocationLive) => void;
64
+ /**
65
+ * One server render — a `renderToString` or a `renderToStream` (a document,
66
+ * or a frame stream over the same core) — delivered on
67
+ * `OBSERVE.records.subscribe("render", …)` once it ended: the document
68
+ * returned, the stream's last fragment written, or the render torn down.
69
+ * The server-side account of the head's timing: what the shell cost, and
70
+ * how many `<Loading>` boundaries it waited on (each also a `"boundary"`
71
+ * record) — the facts the response's `Server-Timing` `solid-shell` metric
72
+ * is projected from. Serializable; the request the render served and its
73
+ * trace ride beside it in `RenderLive`.
74
+ */
75
+ export interface RenderEvent {
76
+ /** `"string"` for `renderToString`, `"stream"` for `renderToStream`. */
77
+ mode: "string" | "stream";
78
+ /** `performance.now()` when the render began. */
79
+ at: number;
80
+ /**
81
+ * Render start → the shell complete, in milliseconds: for a stream, the
82
+ * head and shell handed to the sink (the head is frozen from here — a
83
+ * fragment can no longer add to it); for a string, the document assembled
84
+ * (the whole render). What `solid-shell` carries. Absent when the render
85
+ * ended before its shell — torn down or failed pre-shell.
86
+ */
87
+ shellMs?: number;
88
+ /**
89
+ * Render start → the render's end, in milliseconds: the document
90
+ * returned (`"string"`, equal to `shellMs`), the stream complete (every
91
+ * fragment written), or the teardown for the other outcomes.
92
+ */
93
+ durationMs: number;
94
+ /**
95
+ * `<Loading>` boundaries the shell waited on — discovered with pending
96
+ * async and settled before the shell completed, each a `"boundary"`
97
+ * record with `streamed: false` and a `solid-boundary` metric. A boundary
98
+ * that settled after the shell streamed as a fragment and is not counted
99
+ * here (its own record says `streamed: true`). Counted from the
100
+ * `"boundary"` records the render filed, under that record's gate: in an
101
+ * observe build with a `"render"` listener but no `"boundary"` listener
102
+ * the boundaries are not measured and this is `0`.
103
+ */
104
+ boundaries: number;
105
+ /**
106
+ * `"complete"` — the render ran to its end; `"abandoned"` — the consumer
107
+ * left mid-stream (the sink threw, the readable was cancelled — the
108
+ * `SSR_STREAM_ABANDONED` finding is that request's account) and the
109
+ * render was torn down; `"error"` — the render failed: a string render
110
+ * threw, a stream's uncontained failure wound it down through `onError`.
111
+ */
112
+ outcome: "complete" | "abandoned" | "error";
113
+ }
114
+ /** The live half of a render record. */
115
+ export interface RenderLive {
116
+ /** The request event the render ran under; absent for a render outside a request scope. */
117
+ event?: RequestEvent;
118
+ /** The trace the render belongs to — `getTraceContext()`'s answer for it. */
119
+ trace: TraceContext;
120
+ }
121
+ export type RenderListener = (event: RenderEvent, live: RenderLive) => void;
122
+ /**
123
+ * One server-function call made from the browser — the fetch and its
124
+ * decode, as the caller awaited it — delivered on
125
+ * `OBSERVE.records.subscribe("call", …)` once it settled. The client twin
126
+ * of the server's `"invocation"` record: the two join by `id` (this is the
127
+ * call; that is the execution it caused), and the difference between their
128
+ * durations is the wire. A call an integration answered locally (a
129
+ * handler's `intercept`, at t = 0) made no request and emits nothing.
130
+ */
131
+ export interface CallEvent {
132
+ /** The function id — the same `id` the server's `"invocation"` record carries. */
133
+ id: string;
134
+ /** `performance.now()` when the call was made. */
135
+ at: number;
136
+ /**
137
+ * Call → settle, in milliseconds: the request built and sent, the
138
+ * response received and decoded (or claimed by the configured
139
+ * `responseHandler`) — the whole await the caller saw. A streaming
140
+ * result settles at handoff — see `deferred`.
141
+ */
142
+ durationMs: number;
143
+ /** `GET` for a GET-encoded read (`GET(fn)`), `POST` otherwise. */
144
+ method: "GET" | "POST";
145
+ outcome: "ok" | "error";
146
+ /**
147
+ * The response's HTTP status, once one arrived. Absent when the call
148
+ * failed before a response (the fetch itself rejected).
149
+ */
150
+ status?: number;
151
+ /**
152
+ * What the call ran for, when the attribution engine
153
+ * (`solid-js/attribution`) is enabled and knows: the interaction whose
154
+ * handler made it (`kind: "interaction"`), the navigation whose data
155
+ * needed it (`kind: "navigation"`, its `interaction` the click), the
156
+ * effect or action step, the async landing whose recompute called again —
157
+ * the engine's own origin object, so it IS `InteractionEvent.origin` /
158
+ * `NavigationEvent.origin` / `HoldEvent.origin` by identity: an observer
159
+ * puts the call under the interaction's record without a time join. Read
160
+ * at dispatch, so a call made after an `await` in a handler stamps
161
+ * nothing (the same escape a write there has). Absent without an engine.
162
+ */
163
+ origin?: ChangeOrigin;
164
+ /**
165
+ * The settled value is a body the caller drives — an async iterable
166
+ * (a `live()` source, a generator result) — so `durationMs` covers the
167
+ * call that produced it, not its consumption.
168
+ */
169
+ deferred?: true;
170
+ }
171
+ /**
172
+ * The live half of a call, for in-process consumers. `response` is the
173
+ * transport's own object, not a clone: its status and headers are
174
+ * readable, its body is the decode's (already consumed, or being consumed
175
+ * by the caller for a streaming result). `error` is the value as thrown to
176
+ * the caller — a decoded server error, or the transport's own failure.
177
+ */
178
+ export interface CallLive {
179
+ args: unknown[];
180
+ response?: Response;
181
+ /** The settled value, when `outcome` is `"ok"`. */
182
+ result?: unknown;
183
+ /** The thrown value, when `outcome` is `"error"`. */
184
+ error?: unknown;
185
+ }
186
+ export type CallListener = (event: CallEvent, live: CallLive) => void;
187
+ interface FrameEventBase {
188
+ /**
189
+ * The frame id on the wire: the server function's id when the stream is a
190
+ * server-function response (the same `id` that call's `"invocation"` and
191
+ * `"call"` records carry), or what the producer named it; `""` for a bare
192
+ * `renderToFrameStream` with no `frame` option.
193
+ */
194
+ id: string;
195
+ /**
196
+ * The stream version: as the producer stamped it on the server; as the
197
+ * client restamped it on the client (the consumer owns versions — one
198
+ * per stream a boundary consumed — so this is the number the frame's
199
+ * stale-guard saw).
200
+ */
201
+ version: number;
202
+ /** `performance.now()` at the stream's `start` chunk — written, or read. */
203
+ at: number;
204
+ /**
205
+ * Start → `complete`, in milliseconds: the whole stream, fragments
206
+ * included. On the client this is the body's read and apply — the
207
+ * request that produced the response is the `"call"` record's time.
208
+ */
209
+ durationMs: number;
210
+ /**
211
+ * Start → the shell (`html`) chunk, in milliseconds: the time to first
212
+ * content. Absent when the stream carried no shell (the server's
213
+ * synchronous failure path).
214
+ */
215
+ shellMs?: number;
216
+ /** Chunks between `start` and `complete` (exclusive), all types. */
217
+ chunks: number;
218
+ /** `fragment` chunks: `<Loading>` content that settled after the shell. */
219
+ fragments: number;
220
+ /** `slot` chunks: render-prop invocations the client fills. */
221
+ slots: number;
222
+ /**
223
+ * Nested server-content regions (a server JSX slot argument): `html`
224
+ * chunks addressed to a child frame id rather than the stream's own.
225
+ */
226
+ regions: number;
227
+ /** `error` chunks: fragments that failed (their fallback still revealed), plus a sync failure. */
228
+ errors: number;
229
+ }
230
+ /**
231
+ * The server half of a `"frame"` record: one frame stream produced — a
232
+ * server component rendered to the frame transport
233
+ * (`renderServerComponent` / `renderToFrameStream`), from its `start`
234
+ * chunk to its `complete` — delivered once it completed.
235
+ */
236
+ export interface FrameProducedEvent extends FrameEventBase {
237
+ side: "server";
238
+ /**
239
+ * `complete` — the render ran to the end (fragment failures, if any, are
240
+ * in `errors`); `error` — the render threw synchronously, the stream
241
+ * carried the failure as its only content and completed.
242
+ */
243
+ outcome: "complete" | "error";
244
+ }
245
+ /**
246
+ * The client half of a `"frame"` record: one frame stream applied — a
247
+ * frame-stream response read chunk by chunk into the frame host
248
+ * (`applyFrameResponse`), from its `start` to its `complete` — delivered
249
+ * once the stream ended. A single-flight response carries one stream per
250
+ * frame it refreshed; each is its own record, as on the server.
251
+ */
252
+ export interface FrameAppliedEvent extends FrameEventBase {
253
+ side: "client";
254
+ /**
255
+ * The local id the chunks were applied under, when the consumer remapped
256
+ * the producer's root id onto its own boundary (`applyFrameResponse`'s
257
+ * `as` — the call's address, for the server-component transport).
258
+ * Absent when applied under the wire id.
259
+ */
260
+ address?: string;
261
+ /**
262
+ * `complete` — the `complete` chunk arrived; `truncated` — the body ended
263
+ * before it (the connection dropped, the producer abandoned the stream);
264
+ * `error` — the read failed (a malformed chunk, a body error), with the
265
+ * failure in `live.error`.
266
+ */
267
+ outcome: "complete" | "truncated" | "error";
268
+ }
269
+ /**
270
+ * One frame stream, from whichever end observed it — delivered on
271
+ * `OBSERVE.records.subscribe("frame", …)`; `side` says which. The two
272
+ * halves share their shape (the same census, the same timings measured
273
+ * where each stands), so a consumer joins them by `id` and `version` and
274
+ * the difference is the wire.
275
+ */
276
+ export type FrameEvent = FrameProducedEvent | FrameAppliedEvent;
277
+ /** The live half of a frame record. */
278
+ export interface FrameLive {
279
+ /** The value thrown: the server's sync failure, or the client's read failure. */
280
+ error?: unknown;
281
+ /** Client only: the response the stream was read from. */
282
+ response?: Response;
283
+ }
284
+ export type FrameListener = (event: FrameEvent, live: FrameLive) => void;
285
+ declare module "solid-js" {
286
+ interface HostRecordTypes {
287
+ /** Server-function executions, on the server — see `InvocationEvent`. */
288
+ invocation: {
289
+ event: InvocationEvent;
290
+ live: InvocationLive;
291
+ };
292
+ /** Server renders — a document or a frame stream — see `RenderEvent`. */
293
+ render: {
294
+ event: RenderEvent;
295
+ live: RenderLive;
296
+ };
297
+ /** Server-function calls, from the client — see `CallEvent`. */
298
+ call: {
299
+ event: CallEvent;
300
+ live: CallLive;
301
+ };
302
+ /** Frame streams, produced or applied — see `FrameEvent`. */
303
+ frame: {
304
+ event: FrameEvent;
305
+ live: FrameLive;
306
+ };
307
+ }
308
+ }
309
+ export declare function settledPromise(value: unknown): Promise<unknown> | undefined;
310
+ export declare function isDeferredBody(value: unknown): boolean;
311
+ /**
312
+ * The census one frame stream's chunks add up to, kept by either half: one
313
+ * chunk of `type`, addressed to the stream's own frame (`own`) or to a
314
+ * nested region's.
315
+ */
316
+ export declare function frameCensus(event: FrameEventBase, type: string, own: boolean): void;
317
+ /** What the client runtime hands a call observation as the call proceeds. */
318
+ export interface CallObservation {
319
+ /** The response arrived (before decode); its status goes on the record. */
320
+ response(response: Response): void;
321
+ /** The call settled as the caller sees it: the value returned, or the error thrown. */
322
+ settle(outcome: "ok" | "error", value: unknown): void;
323
+ }
324
+ /**
325
+ * Opens the observation of one server-function call from the client, as
326
+ * the request is about to be built; the runtime reports the response when
327
+ * it arrives and the settle when the caller gets its answer. `undefined`
328
+ * with no listener or outside observe builds — the runtime then does
329
+ * nothing extra, not even read the clock.
330
+ */
331
+ export declare function observeCall(id: string, method: "GET" | "POST", args: unknown[]): CallObservation | undefined;
332
+ /** What the client's stream reader hands a frame observation. */
333
+ export interface FrameApplyObservation {
334
+ /**
335
+ * Every chunk read, after the consumer's remapping (`as`, `version`) —
336
+ * `wireId` is the id the chunk carried before it.
337
+ */
338
+ chunk(chunk: {
339
+ type: string;
340
+ id: string;
341
+ version: number;
342
+ }, wireId: string): void;
343
+ /**
344
+ * The apply ended — cleanly, or with the failure it threw (a read that
345
+ * failed, a chunk that would not parse, a host that rejected a chunk).
346
+ */
347
+ end(error?: unknown): void;
348
+ }
349
+ /**
350
+ * Opens the observation of one frame-stream response on the client: every
351
+ * `start` chunk opens a stream record (a single-flight response carries
352
+ * several, in sequence), every chunk until its `complete` is counted to
353
+ * it, and the record is delivered at `complete` — or at the body's end as
354
+ * `truncated`, or at a read failure as `error`. `undefined` with no
355
+ * listener or outside observe builds.
356
+ */
357
+ export declare function observeFrameApply(response: Response): FrameApplyObservation | undefined;
358
+ export {};
@@ -0,0 +1 @@
1
+ export default function reconcileArrays(parentNode: Node, a: Node[], b: Node[], marker?: Node | null): void;
@@ -0,0 +1,9 @@
1
+ export declare let spreadName: string | undefined;
2
+ export declare function setSpreadName(name: string | undefined): void;
3
+ /** Dev: remember the element the running binding effect writes (first one wins). */
4
+ export declare function tagElement(node: Node): void;
5
+ export declare function effect<T>(fn: (prev?: T) => T, effectFn: (value: T, prev?: T) => void | (() => void), options?: {
6
+ scope?: boolean;
7
+ name?: string;
8
+ }): void;
9
+ export declare function memo<T>(fn: () => T): () => T;