@solidjs/web 2.0.0-rc.0 → 2.0.0-rc.10

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 (108) hide show
  1. package/README.md +1 -1
  2. package/dist/server.dev.js +4472 -0
  3. package/dist/server.js +1363 -224
  4. package/dist/{server.cjs → server.observe.js} +1563 -424
  5. package/dist/{dev.cjs → web.dev.js} +708 -365
  6. package/dist/web.js +460 -144
  7. package/dist/{dev.js → web.observe.js} +511 -213
  8. package/frames/dist/client.dev.js +464 -72
  9. package/frames/dist/client.js +364 -71
  10. package/frames/dist/{client.dev.cjs → client.observe.js} +487 -134
  11. package/frames/dist/server.dev.js +1713 -0
  12. package/frames/dist/server.js +553 -2495
  13. package/frames/dist/server.observe.js +1713 -0
  14. package/frames/package.json +2 -25
  15. package/package.json +214 -254
  16. package/performance-tracks/dist/performance-tracks.dev.js +678 -0
  17. package/performance-tracks/dist/performance-tracks.js +6 -0
  18. package/performance-tracks/dist/performance-tracks.observe.js +666 -0
  19. package/performance-tracks/package.json +7 -0
  20. package/performance-tracks/types/index.d.ts +67 -0
  21. package/serialization/decode/package.json +2 -15
  22. package/serialization/dist/decode.js +101 -12
  23. package/serialization/dist/serialization.js +112 -20
  24. package/serialization/package.json +2 -15
  25. package/serialization/types/index.d.ts +76 -157
  26. package/serialization/types/serializer-decode.d.ts +149 -112
  27. package/serialization/types/serializer.d.ts +101 -0
  28. package/server-functions/dist/client.dev.js +1364 -0
  29. package/server-functions/dist/client.js +745 -85
  30. package/server-functions/dist/client.observe.js +1343 -0
  31. package/server-functions/dist/server.dev.js +2203 -175
  32. package/server-functions/dist/server.js +2111 -176
  33. package/server-functions/dist/server.observe.js +3043 -0
  34. package/server-functions/package.json +2 -35
  35. package/server-functions/rich-args/package.json +2 -15
  36. package/storage/package.json +2 -15
  37. package/types/client.d.ts +193 -288
  38. package/types/constants.d.ts +20 -0
  39. package/types/cookies.d.ts +32 -84
  40. package/types/diagnostics.d.ts +56 -0
  41. package/types/frames/client.d.ts +1 -1
  42. package/types/frames/frame-client.d.ts +323 -259
  43. package/types/frames/frame-container-plugin.d.ts +72 -0
  44. package/types/frames/frame-sink.d.ts +101 -158
  45. package/types/frames/frame-transport.d.ts +192 -190
  46. package/types/frames/serializer-decode.d.ts +219 -0
  47. package/types/frames/serializer.d.ts +76 -157
  48. package/types/frames/server.d.ts +1 -1
  49. package/types/head.d.ts +19 -0
  50. package/types/index.d.ts +62 -76
  51. package/types/index.server.d.ts +174 -0
  52. package/types/jsx.d.ts +33 -26
  53. package/types/observe.d.ts +358 -0
  54. package/types/reconcile.d.ts +1 -0
  55. package/types/render.d.ts +9 -0
  56. package/types/response.d.ts +75 -150
  57. package/types/serializer-decode.d.ts +149 -112
  58. package/types/serializer.d.ts +76 -157
  59. package/types/server-functions/client.d.ts +202 -174
  60. package/types/server-functions/flash.d.ts +28 -30
  61. package/types/server-functions/registry.d.ts +102 -0
  62. package/types/server-functions/rich-args.d.ts +1 -10
  63. package/types/server-functions/server.d.ts +518 -454
  64. package/types/server-functions/shared.d.ts +366 -425
  65. package/types/server-mock.d.ts +110 -13
  66. package/types/server-observe.d.ts +77 -0
  67. package/types/server.d.ts +425 -425
  68. package/types/trace.d.ts +127 -0
  69. package/LICENSE +0 -21
  70. package/dist/web.cjs +0 -2007
  71. package/frames/dist/client.cjs +0 -1916
  72. package/frames/dist/server.cjs +0 -3667
  73. package/serialization/dist/decode.cjs +0 -110
  74. package/serialization/dist/serialization.cjs +0 -232
  75. package/serialization/types-cjs/index.d.cts +0 -182
  76. package/serialization/types-cjs/package.json +0 -3
  77. package/serialization/types-cjs/serializer-decode.d.cts +0 -182
  78. package/server-functions/dist/client.cjs +0 -646
  79. package/server-functions/dist/rich-args.cjs +0 -11
  80. package/server-functions/dist/server.cjs +0 -1077
  81. package/server-functions/dist/server.dev.cjs +0 -1077
  82. package/storage/dist/storage.cjs +0 -12
  83. package/storage/types-cjs/index.d.cts +0 -28
  84. package/storage/types-cjs/package.json +0 -3
  85. package/types/core.d.ts +0 -6
  86. package/types-cjs/client.d.cts +0 -337
  87. package/types-cjs/cookies.d.cts +0 -93
  88. package/types-cjs/core.d.cts +0 -6
  89. package/types-cjs/frames/client.d.cts +0 -36
  90. package/types-cjs/frames/frame-client.d.cts +0 -338
  91. package/types-cjs/frames/frame-sink.d.cts +0 -194
  92. package/types-cjs/frames/frame-transport.d.cts +0 -222
  93. package/types-cjs/frames/serializer.d.cts +0 -182
  94. package/types-cjs/frames/server.d.cts +0 -52
  95. package/types-cjs/index.d.cts +0 -230
  96. package/types-cjs/jsx-properties.d.cts +0 -93
  97. package/types-cjs/jsx.d.cts +0 -4150
  98. package/types-cjs/package.json +0 -3
  99. package/types-cjs/response.d.cts +0 -174
  100. package/types-cjs/serializer-decode.d.cts +0 -182
  101. package/types-cjs/serializer.d.cts +0 -182
  102. package/types-cjs/server-functions/client.d.cts +0 -201
  103. package/types-cjs/server-functions/flash.d.cts +0 -38
  104. package/types-cjs/server-functions/rich-args.d.cts +0 -10
  105. package/types-cjs/server-functions/server.d.cts +0 -588
  106. package/types-cjs/server-functions/shared.d.cts +0 -523
  107. package/types-cjs/server-mock.d.cts +0 -277
  108. package/types-cjs/server.d.cts +0 -523
@@ -12,54 +12,96 @@
12
12
  * shapes and the wire format may change between prereleases (RFC 11).
13
13
  * Every export in this module is `@experimental`.
14
14
  */
15
-
16
15
  /**
17
16
  * One transport chunk of a frame stream, addressed by frame `id`.
18
17
  * @experimental
19
18
  */
20
- export type FrameChunk =
21
- | { type: "start"; id: string; version: number }
22
- | { type: "html"; id: string; version: number; html: string }
23
- | { type: "fragment"; id: string; version: number; key: string; html: string }
24
- | {
25
- type: "reveal";
26
- id: string;
27
- version: number;
28
- keys: string[];
29
- waitForStyles?: boolean;
30
- fallback?: boolean;
31
- }
32
- | {
33
- type: "data";
34
- id: string;
35
- version: number;
36
- key?: string;
37
- node?: unknown;
38
- initial?: boolean;
39
- /** Eval-style hydration script — only when produced with the hydration serializer. */
40
- payload?: string;
41
- }
42
- | {
43
- type: "assets";
44
- id: string;
45
- version: number;
46
- key: string;
47
- modules?: string[];
48
- styles?: string[];
49
- inlineStyles?: { id: string; content?: string; attrs?: Record<string, string> }[];
50
- }
51
- | { type: "slot"; id: string; version: number; key: string; args: Record<string, unknown> }
52
- | { type: "complete"; id: string; version: number }
53
- | { type: "error"; id: string; version: number; key?: string; error: unknown };
54
-
55
- /**
56
- * Maps a wire chunk onto resident-store record writes. `data` chunks map to
57
- * no records — they are response-scoped and the host applies them through
58
- * its data hook.
59
- * @experimental
60
- */
61
- export function chunkToRecords(chunk: FrameChunk): Record<string, unknown>;
62
-
19
+ export type FrameChunk = {
20
+ type: "start";
21
+ id: string;
22
+ version: number;
23
+ } | {
24
+ type: "html";
25
+ id: string;
26
+ version: number;
27
+ html: string;
28
+ /** Server-minted digest of the root's skeleton (RFC 11 §9.5, Hole hashes). */
29
+ digest?: string;
30
+ /** Digests of the live holes inside the html, by ledger key (`lh:N`, `lha:N`). */
31
+ holes?: Record<string, string>;
32
+ } | {
33
+ type: "fragment";
34
+ id: string;
35
+ version: number;
36
+ key: string;
37
+ html: string;
38
+ digest?: string;
39
+ holes?: Record<string, string>;
40
+ } | {
41
+ type: "hole";
42
+ id: string;
43
+ version: number;
44
+ key: string;
45
+ html: string;
46
+ digest?: string;
47
+ holes?: Record<string, string>;
48
+ } | {
49
+ type: "attr";
50
+ id: string;
51
+ version: number;
52
+ key: string;
53
+ attrs: string;
54
+ removed?: string[];
55
+ digest?: string;
56
+ } | {
57
+ type: "reveal";
58
+ id: string;
59
+ version: number;
60
+ keys: string[];
61
+ waitForStyles?: boolean;
62
+ fallback?: boolean;
63
+ } | {
64
+ type: "data";
65
+ id: string;
66
+ version: number;
67
+ key?: string;
68
+ node?: unknown;
69
+ initial?: boolean;
70
+ /** Eval-style hydration script — only when produced with the hydration serializer. */
71
+ payload?: string;
72
+ } | {
73
+ type: "assets";
74
+ id: string;
75
+ version: number;
76
+ key: string;
77
+ modules?: string[];
78
+ styles?: string[];
79
+ inlineStyles?: {
80
+ id: string;
81
+ content?: string;
82
+ attrs?: Record<string, string>;
83
+ }[];
84
+ preloads?: {
85
+ href?: string;
86
+ attrs: Record<string, string>;
87
+ }[];
88
+ } | {
89
+ type: "slot";
90
+ id: string;
91
+ version: number;
92
+ key: string;
93
+ args: Record<string, unknown>;
94
+ } | {
95
+ type: "complete";
96
+ id: string;
97
+ version: number;
98
+ } | {
99
+ type: "error";
100
+ id: string;
101
+ version: number;
102
+ key?: string;
103
+ error: unknown;
104
+ };
63
105
  /**
64
106
  * One store write applied to a frame: `r` maps record keys to values
65
107
  * (`chunkToRecords` produces these from wire chunks) and `version` is the
@@ -67,63 +109,64 @@ export function chunkToRecords(chunk: FrameChunk): Record<string, unknown>;
67
109
  * @experimental
68
110
  */
69
111
  export interface FrameWrite {
70
- version: number;
71
- r: Record<string, unknown>;
112
+ version: number;
113
+ r: Record<string, unknown>;
72
114
  }
73
-
74
115
  /**
75
116
  * Context passed to a slot callback.
76
117
  * @experimental
77
118
  */
78
119
  export interface SlotContext {
79
- /**
80
- * True only for the hydration-attach invocation of an adopted
81
- * document-SSR range — the one call a consumer may answer with a claim
82
- * (`existing` IS the server-rendered output for these args). Unset on
83
- * stream-driven re-calls: those must render for real, or content the
84
- * re-call displaced (e.g. `{$frame}` region ranges) is dropped.
85
- */
86
- adopted?: boolean;
87
- /**
88
- * Whether this occurrence is a render-prop CALL (the producer placed it
89
- * with arguments — possibly empty — via a slot record) as opposed to a
90
- * direct-insert position. Consumers cannot tell from the resolved props
91
- * alone: an argless render prop and a direct insert both arrive as `{}`,
92
- * but one is a function to invoke and the other a value to place.
93
- */
94
- invoked?: boolean;
95
- /**
96
- * Register cleanup for when this occurrence's range is removed from the
97
- * server content, or the owning frame is disposed.
98
- */
99
- onCleanup(fn: () => void): void;
100
- /**
101
- * Live-props opt-in: a binding that registers here receives the
102
- * re-resolved props when a re-sent record's args CHANGE in value, instead
103
- * of the occurrence being re-called — the invocation's instance (and its
104
- * client state) survives the change. Register synchronously during the
105
- * invocation; one updater per occurrence (last registration wins). A
106
- * genuine re-call or unmount clears it before/with the binding it served.
107
- */
108
- onUpdate(fn: (props: Record<string, unknown>) => void): void;
109
- /**
110
- * The range's current interior — server-rendered client content on an
111
- * adopted document-SSR boot, or the previous output on a re-call. A
112
- * framework binding hydrates onto it and returns `undefined` to claim it
113
- * in place (zero DOM mutation).
114
- */
115
- existing: ChildNode[];
116
- /**
117
- * The range's own marker comments, when the occurrence has a placed range.
118
- * A framework binding whose slot content is reactive at the top level (a
119
- * boundary accessor, changing route children) owns the interior instead of
120
- * returning nodes: bind before `end` with the framework's insert primitive
121
- * and return `undefined` — the frame leaves the range alone (server morphs
122
- * already protect slot ranges).
123
- */
124
- range?: { start: Comment; end: Comment };
120
+ /**
121
+ * True only for the hydration-attach invocation of an adopted
122
+ * document-SSR range — the one call a consumer may answer with a claim
123
+ * (`existing` IS the server-rendered output for these args). Unset on
124
+ * stream-driven re-calls: those must render for real, or content the
125
+ * re-call displaced (e.g. `{$frame}` region ranges) is dropped.
126
+ */
127
+ adopted?: boolean;
128
+ /**
129
+ * Whether this occurrence is a render-prop CALL (the producer placed it
130
+ * with arguments — possibly empty — via a slot record) as opposed to a
131
+ * direct-insert position. Consumers cannot tell from the resolved props
132
+ * alone: an argless render prop and a direct insert both arrive as `{}`,
133
+ * but one is a function to invoke and the other a value to place.
134
+ */
135
+ invoked?: boolean;
136
+ /**
137
+ * Register cleanup for when this occurrence's range is removed from the
138
+ * server content, or the owning frame is disposed.
139
+ */
140
+ onCleanup(fn: () => void): void;
141
+ /**
142
+ * Live-props opt-in: a binding that registers here receives the
143
+ * re-resolved props when a re-sent record's args CHANGE in value, instead
144
+ * of the occurrence being re-called — the invocation's instance (and its
145
+ * client state) survives the change. Register synchronously during the
146
+ * invocation; one updater per occurrence (last registration wins). A
147
+ * genuine re-call or unmount clears it before/with the binding it served.
148
+ */
149
+ onUpdate(fn: (props: Record<string, unknown>) => void): void;
150
+ /**
151
+ * The range's current interior — server-rendered client content on an
152
+ * adopted document-SSR boot, or the previous output on a re-call. A
153
+ * framework binding hydrates onto it and returns `undefined` to claim it
154
+ * in place (zero DOM mutation).
155
+ */
156
+ existing: ChildNode[];
157
+ /**
158
+ * The range's own marker comments, when the occurrence has a placed range.
159
+ * A framework binding whose slot content is reactive at the top level (a
160
+ * boundary accessor, changing route children) owns the interior instead of
161
+ * returning nodes: bind before `end` with the framework's insert primitive
162
+ * and return `undefined` — the frame leaves the range alone (server morphs
163
+ * already protect slot ranges).
164
+ */
165
+ range?: {
166
+ start: Comment;
167
+ end: Comment;
168
+ };
125
169
  }
126
-
127
170
  /**
128
171
  * Client content for a server-declared slot. Direct-insert occurrences
129
172
  * call it with empty props; render-prop occurrences pass the occurrence's
@@ -133,39 +176,47 @@ export interface SlotContext {
133
176
  * @experimental
134
177
  */
135
178
  export type Slot = (props: Record<string, unknown>, ctx: SlotContext) => Node | Node[] | undefined;
136
-
137
179
  /** @experimental */
138
180
  export interface Frame {
139
- /** Merge a write into the store and flush (morph/reveal/slot sync). */
140
- apply(write: FrameWrite): void;
141
- /** The active version, or undefined before the first apply. */
142
- readonly version: number | undefined;
143
- /** Read-only view of the resident record store. */
144
- readonly store: Readonly<Record<string, unknown>>;
145
- /** The stream's error record, if an `error` chunk arrived. */
146
- readonly error: unknown;
147
- /** Whether the named fragment has been revealed into the boundary. */
148
- isRevealed(segment: string): boolean;
149
- /**
150
- * Re-key this live frame to a different boundary id (the mount-preserving
151
- * half of a call-site handoff): nothing tears down — the element, store,
152
- * and slot state stay — while leaving the old id stashes a retention
153
- * snapshot under it and joining the new id seeds/drains its retained
154
- * store and buffered chunks. Version affinity resets: histories are per
155
- * boundary id.
156
- */
157
- rebind(id: string): void;
158
- /**
159
- * Forget the version baseline without touching content — the next write
160
- * is accepted whatever its number. Called by the host after seeding a
161
- * registration from a retained snapshot, whose numbering belongs to a
162
- * different stream space.
163
- */
164
- rebase(): void;
165
- /** Tear down: slot cleanups cascade, later chunks are ignored. Idempotent. */
166
- dispose(): void;
181
+ /** Merge a write into the store and flush (morph/reveal/slot sync). */
182
+ apply(write: FrameWrite): void;
183
+ /** The active version, or undefined before the first apply. */
184
+ readonly version: number | undefined;
185
+ /** Read-only view of the resident record store. */
186
+ readonly store: Readonly<Record<string, unknown>>;
187
+ /** The stream's error record, if an `error` chunk arrived. */
188
+ readonly error: unknown;
189
+ /** Whether the named fragment has been revealed into the boundary. */
190
+ isRevealed(segment: string): boolean;
191
+ /**
192
+ * Re-key this live frame to a different boundary id (the mount-preserving
193
+ * half of a call-site handoff): nothing tears down — the element, store,
194
+ * and slot state stay — while leaving the old id stashes a retention
195
+ * snapshot under it and joining the new id seeds/drains its retained
196
+ * store and buffered chunks. Version affinity resets: histories are per
197
+ * boundary id.
198
+ */
199
+ rebind(id: string): void;
200
+ /**
201
+ * Forget the version baseline without touching content — the next write
202
+ * is accepted whatever its number. Called by the host after seeding a
203
+ * registration from a retained snapshot, whose numbering belongs to a
204
+ * different stream space.
205
+ */
206
+ rebase(): void;
207
+ /**
208
+ * The frame's have-list (RFC 11 §9.5): the server-minted digests of
209
+ * what this frame currently SHOWS — the root skeleton under `""`, each
210
+ * live hole and attr hole by ledger key, each revealed fragment by name.
211
+ * Kept at apply time, never derived from the DOM. `undefined` when the
212
+ * content's provenance carried no digests (a document-adopted interior
213
+ * with no seed, a re-materialized capture): a resume then takes the full
214
+ * snapshot.
215
+ */
216
+ have?(): Record<string, string> | undefined;
217
+ /** Tear down: slot cleanups cascade, later chunks are ignored. Idempotent. */
218
+ dispose(): void;
167
219
  }
168
-
169
220
  /**
170
221
  * Routes a flat stream of addressed chunks to frames by id, buffering chunks
171
222
  * for frames that have not registered yet (only the newest version's chunks
@@ -177,152 +228,165 @@ export interface Frame {
177
228
  * @experimental
178
229
  */
179
230
  export interface FrameHost {
180
- register(id: string, frame: Frame): void;
181
- /** Remove one frame (or all frames of the id when `frame` is omitted). */
182
- unregister(id: string, frame?: Frame): void;
183
- apply(chunk: FrameChunk): void;
184
- /** The first registered frame under the id, if any. */
185
- get(id: string): Frame | undefined;
186
- serialize(value: unknown): { $ref: string };
187
- /** `frameId` is the resolving frame's id — route to its stream's table. */
188
- resolve(ref: { $ref: string }, frameId?: string): unknown;
189
- /** See FrameHostOptions.revive. */
190
- revive?(value: unknown): unknown;
191
- /** See FrameHostOptions.isContainer. */
192
- isContainer?(value: unknown): boolean;
231
+ register(id: string, frame: Frame): void;
232
+ /** Remove one frame (or all frames of the id when `frame` is omitted). */
233
+ unregister(id: string, frame?: Frame): void;
234
+ apply(chunk: FrameChunk): void;
235
+ /** The first registered frame under the id, if any. */
236
+ get(id: string): Frame | undefined;
237
+ serialize(value: unknown): {
238
+ $ref: string;
239
+ };
240
+ /** `frameId` is the resolving frame's id — route to its stream's table. */
241
+ resolve(ref: {
242
+ $ref: string;
243
+ }, frameId?: string): unknown;
244
+ /** See FrameHostOptions.revive. */
245
+ revive?(value: unknown): unknown;
246
+ /** See FrameHostOptions.isContainer. */
247
+ isContainer?(value: unknown): boolean;
193
248
  }
194
-
195
- /**
196
- * The bubbling DOM event (`"frame:applied"`) a frame dispatches from its
197
- * parent element whenever server content lands in the document — root
198
- * materialize/morph, segment reveal, fallback materialization — with
199
- * `detail: { id, version, reason }`. One document-level listener sees every
200
- * boundary (nested region frames dispatch too); use it to re-apply
201
- * client-owned decorations on server-owned markup (router affordance
202
- * reflection, e.g. `aria-current`) without a MutationObserver.
203
- * @experimental
204
- */
205
- export const FRAME_APPLIED_EVENT: "frame:applied";
206
-
207
249
  /**
208
250
  * Options for `createFrameHost`.
209
251
  * @experimental
210
252
  */
211
253
  export interface FrameHostOptions {
212
- /**
213
- * Backs `{$ref}` slot args (typically a codec data table's `resolve`).
214
- * `frameId` identifies the resolving frame — data tables are
215
- * response-scoped, so multi-stream hosts route by it (nested region ids
216
- * prefix-match their root).
217
- */
218
- resolve?(ref: { $ref: string }, frameId?: string): unknown;
219
- /** Test/host-side counterpart of `resolve`. */
220
- serialize?(value: unknown): { $ref: string };
221
- /**
222
- * Receives each `data` chunk whole. Wire a codec table:
223
- * `applyData: c => table.apply(c)` (see `createJSONDataTable`).
224
- */
225
- applyData?(chunk: Extract<FrameChunk, { type: "data" }>): void;
226
- /**
227
- * A lazily-loaded deserializer's load, awaited by the transport before it
228
- * delivers a `data` chunk — `applyData`/`resolve` can assume the codec is
229
- * resident once data has arrived. Keeps codec weight out of the eager
230
- * client graph for responses that never carry serialized data.
231
- */
232
- prepareData?(): Promise<unknown>;
233
- /**
234
- * Revive protocol markers inside LITERAL slot args (values that are
235
- * neither `{$ref}` nor `{$frame}`) at arg-resolution time. Document-face
236
- * container traces ride this way — inline in the record, revived by the
237
- * integration (`reviveContainerTraces`) into live local containers.
238
- */
239
- revive?(value: unknown): unknown;
240
- /**
241
- * Whether a resolved arg value is a LIVE CONTAINER (a materialized trace —
242
- * see `isMaterializedContainer`). The record-dedupe compare must know: a
243
- * pending container's property reads throw not-ready, so async probes and
244
- * serialization compares would detonate it. Containers compare by
245
- * identity only.
246
- */
247
- isContainer?(value: unknown): boolean;
254
+ /**
255
+ * Backs `{$ref}` slot args (typically a codec data table's `resolve`).
256
+ * `frameId` identifies the resolving frame — data tables are
257
+ * response-scoped, so multi-stream hosts route by it (nested region ids
258
+ * prefix-match their root).
259
+ */
260
+ resolve?(ref: {
261
+ $ref: string;
262
+ }, frameId?: string): unknown;
263
+ /** Test/host-side counterpart of `resolve`. */
264
+ serialize?(value: unknown): {
265
+ $ref: string;
266
+ };
267
+ /**
268
+ * Receives each `data` chunk whole. Wire a codec table:
269
+ * `applyData: c => table.apply(c)` (see `createJSONDataTable`).
270
+ */
271
+ applyData?(chunk: Extract<FrameChunk, {
272
+ type: "data";
273
+ }>): void;
274
+ /**
275
+ * A lazily-loaded deserializer's load, awaited by the transport before it
276
+ * delivers a `data` chunk — `applyData`/`resolve` can assume the codec is
277
+ * resident once data has arrived. Keeps codec weight out of the eager
278
+ * client graph for responses that never carry serialized data.
279
+ */
280
+ prepareData?(): Promise<unknown>;
281
+ /**
282
+ * Revive protocol markers inside LITERAL slot args (values that are
283
+ * neither `{$ref}` nor `{$frame}`) at arg-resolution time. Document-face
284
+ * container traces ride this way — inline in the record, revived by the
285
+ * integration (`reviveContainerTraces`) into live local containers.
286
+ */
287
+ revive?(value: unknown): unknown;
288
+ /**
289
+ * Whether a resolved arg value is a LIVE CONTAINER (a materialized trace —
290
+ * see `isMaterializedContainer`). The record-dedupe compare must know: a
291
+ * pending container's property reads throw not-ready, so async probes and
292
+ * serialization compares would detonate it. Containers compare by
293
+ * identity only.
294
+ */
295
+ isContainer?(value: unknown): boolean;
296
+ /**
297
+ * Arms event types for behavior claims: the `_bnd` sweep collects the
298
+ * event names it finds and hands them here so delegated dispatch can
299
+ * reach them. Platform glue passes its `delegateEvents` — the option
300
+ * exists (rather than client.js importing the event system) so
301
+ * tree-shaken subsets without events pay nothing. Frames registered
302
+ * with this host inherit it unless they pass their own `delegate`.
303
+ */
304
+ delegate?(eventNames: Iterable<string>): void;
248
305
  }
249
-
250
- /** @experimental */
251
- export function createFrameHost(options?: FrameHostOptions): FrameHost;
252
-
253
306
  /**
254
307
  * Options for `createFrame` / `createFrameElement`.
255
308
  * @experimental
256
309
  */
257
310
  export interface FrameOptions {
258
- /** Register with this host under `id`, receiving routed/buffered chunks. */
259
- host?: FrameHost;
260
- id?: string;
261
- /** Client content keyed by prop name (occurrences resolve by prop). */
262
- slots?: Record<string, Slot>;
263
- /**
264
- * Adopt existing server-rendered DOM: the first apply morphs against it,
265
- * and slots sync immediately (hydration attach) — a document-SSR boot
266
- * needs no chunk.
267
- */
268
- adopt?: boolean;
269
- /** Called after each apply flush (tests/telemetry). */
270
- onApply?(info: { version: number; reason: "materialize" | "morph" | "reveal" | "error" }): void;
271
- /**
272
- * Wraps element-claim sweeps (`a[href]`/`form[action]` in materialized
273
- * server content — and only those) so claim consumers register their
274
- * per-element cleanup against the boundary's reactive owner, e.g.
275
- * `fn => runWithOwner(owner, fn)`. Nested region frames inherit it.
276
- * Without it, sweeps run under whatever owner is current (none, for
277
- * streamed chunks).
278
- */
279
- ownerScope?<T>(fn: () => T): T;
280
- /**
281
- * Boundary-driven segment reveal. When present, `#revealSegment` hands the
282
- * placeholder seam to this hook instead of swapping imperatively: the binding
283
- * reconstructs a client `<Loading>` there — `fallback` is the placeholder's
284
- * own template content (shown while holding), `content()` materializes the
285
- * segment and renders its client fills INSIDE the boundary so their readiness
286
- * gates the reveal — and inserts it before `before`. An unboundaried async
287
- * fill suspends up to that boundary and is covered instead of orphaned; one
288
- * boundary per revealed segment, i.e. per author-placed `<Loading>`. Omit it
289
- * for the framework-agnostic imperative swap (no reactive reveal).
290
- */
291
- reveal?(seam: { before: Node; fallback: Node[]; content: () => Node | DocumentFragment }): void;
292
- /**
293
- * Document-face record-race guard (adopt path only — solidjs/solid#2968).
294
- * Nothing on the wire formally orders an occurrence's args-record data
295
- * script before the event that triggers adoption, so a recordless
296
- * occurrence is ambiguous while this returns true: the frame defers its
297
- * mount one macrotask (all currently parsed scripts run first), calls
298
- * `drainRecords`, and classifies with whatever is then resolvable. Return
299
- * false once the document can run no further data scripts.
300
- */
301
- recordsPending?(): boolean;
302
- /** Re-absorb the document's arrived-by-now records (idempotent per key). */
303
- drainRecords?(): void;
311
+ /** Register with this host under `id`, receiving routed/buffered chunks. */
312
+ host?: FrameHost;
313
+ id?: string;
314
+ /** Client content keyed by prop name (occurrences resolve by prop). */
315
+ slots?: Record<string, Slot>;
316
+ /**
317
+ * Raw client props for behavior-claim resolution: server elements carrying
318
+ * `_bnd="pos=prop"` markers (compiled under the `serverComponents` option)
319
+ * resolve ref/event positions by name through this object — read live at
320
+ * dispatch/materialize time, so compiled prop getters stay latest-value.
321
+ */
322
+ props?: Record<string, unknown>;
323
+ /**
324
+ * Adopt existing server-rendered DOM: the first apply morphs against it,
325
+ * and slots sync immediately (hydration attach) — a document-SSR boot
326
+ * needs no chunk.
327
+ */
328
+ adopt?: boolean;
329
+ /** Called after each apply flush (tests/telemetry). */
330
+ onApply?(info: {
331
+ version: number;
332
+ reason: "materialize" | "morph" | "reveal" | "error";
333
+ }): void;
334
+ /**
335
+ * Wraps element-claim sweeps (`a[href]`/`form[action]` in materialized
336
+ * server content — and only those) so claim consumers register their
337
+ * per-element cleanup against the boundary's reactive owner, e.g.
338
+ * `fn => runWithOwner(owner, fn)`. Nested region frames inherit it.
339
+ * Without it, sweeps run under whatever owner is current (none, for
340
+ * streamed chunks).
341
+ */
342
+ ownerScope?<T>(fn: () => T): T;
343
+ /** Per-frame override of the host's `delegate` (see FrameHostOptions). */
344
+ delegate?(eventNames: Iterable<string>): void;
345
+ /**
346
+ * Boundary-driven segment reveal. When present, `#revealSegment` hands the
347
+ * placeholder seam to this hook instead of swapping imperatively: the binding
348
+ * reconstructs a client `<Loading>` there — `fallback` is the placeholder's
349
+ * own template content (shown while holding), `content()` materializes the
350
+ * segment and renders its client fills INSIDE the boundary so their readiness
351
+ * gates the reveal — and inserts it before `before`. An unboundaried async
352
+ * fill suspends up to that boundary and is covered instead of orphaned; one
353
+ * boundary per revealed segment, i.e. per author-placed `<Loading>`. Omit it
354
+ * for the framework-agnostic imperative swap (no reactive reveal).
355
+ */
356
+ reveal?(seam: {
357
+ before: Node;
358
+ fallback: Node[];
359
+ content: () => Node | DocumentFragment;
360
+ }): void;
361
+ /**
362
+ * Document-face record-race guard (adopt path only — solidjs/solid#2968).
363
+ * Nothing on the wire formally orders an occurrence's args-record data
364
+ * script before the event that triggers adoption, so a recordless
365
+ * occurrence is ambiguous while this returns true: the frame defers its
366
+ * mount one macrotask (all currently parsed scripts run first), calls
367
+ * `drainRecords`, and classifies with whatever is then resolvable. Return
368
+ * false once the document can run no further data scripts.
369
+ */
370
+ recordsPending?(): boolean;
371
+ /** Re-absorb the document's arrived-by-now records (idempotent per key). */
372
+ drainRecords?(): void;
304
373
  }
305
-
374
+ export declare function chunkToRecords(chunk: FrameChunk): Record<string, unknown>;
375
+ export declare function createFrameHost(options?: FrameHostOptions): FrameHost;
306
376
  /**
307
- * A frame rendering into an EXISTING element boundary. Pass `adopt: true` for
308
- * the document-SSR path: the element already holds server-rendered content,
309
- * so the first apply morphs against it and slots sync immediately (hydration
310
- * attach), claiming their server-rendered DOM — a document boot needs no
311
- * chunk.
312
- * @experimental
377
+ * The bubbling DOM event a frame dispatches from its parent element after
378
+ * server content lands in the document (root materialize/morph, segment
379
+ * reveal, fallback materialization) — `detail: { id, version, reason }`.
380
+ * Document-level listeners (router affordance reflection, scroll
381
+ * restoration) react to server-driven DOM changes without a
382
+ * MutationObserver; nested region frames dispatch too and the event
383
+ * bubbles, so one listener sees every boundary. Client-side renders never
384
+ * fire it — client code has reactivity to subscribe with.
313
385
  */
314
- export function createFrame(boundary: Element, options?: FrameOptions): Frame;
315
-
316
- /**
317
- * The default boundary/region element tag and its id attribute — the DOM
318
- * contract the producer emits at t=0 and the consumer creates/adopts.
319
- * @experimental
320
- */
321
- export const FRAME_TAG: "dx-frame";
322
- /** @experimental */
323
- export const FRAME_ID_ATTR: "data-fid";
324
-
325
- /**
386
+ export declare const FRAME_APPLIED_EVENT = "frame:applied";
387
+ export declare function createFrame(boundary: Element, options?: FrameOptions): Frame;
388
+ export declare const FRAME_TAG = "solid-frame";
389
+ export declare const FRAME_ID_ATTR = "data-fid"; /**
326
390
  * Create a boundary/region ELEMENT and bind a host-registered frame to it.
327
391
  * The frame mounts INTO the element (server content is its children, morphed
328
392
  * in place). Because the boundary is a real node, `insert` places the
@@ -331,8 +395,8 @@ export const FRAME_ID_ATTR: "data-fid";
331
395
  * `dispose()` (register it with your owner's cleanup).
332
396
  * @experimental
333
397
  */
334
- export function createFrameElement(options: FrameOptions): {
335
- readonly element: Element;
336
- readonly frame: Frame;
337
- dispose(): void;
398
+ export declare function createFrameElement(options: FrameOptions): {
399
+ readonly element: Element;
400
+ readonly frame: Frame;
401
+ dispose(): void;
338
402
  };