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

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 (60) hide show
  1. package/dist/server.dev.js +705 -151
  2. package/dist/server.js +604 -123
  3. package/dist/server.observe.js +617 -124
  4. package/dist/web.dev.js +102 -41
  5. package/dist/web.js +75 -37
  6. package/dist/web.observe.js +75 -39
  7. package/frames/dist/assets.js +92 -0
  8. package/frames/dist/bind.dev.js +326 -0
  9. package/frames/dist/bind.js +295 -0
  10. package/frames/dist/client.dev.js +693 -919
  11. package/frames/dist/client.js +636 -917
  12. package/frames/dist/client.observe.js +637 -917
  13. package/frames/dist/regions.js +130 -0
  14. package/frames/dist/server.dev.js +607 -212
  15. package/frames/dist/server.js +554 -212
  16. package/frames/dist/server.observe.js +554 -212
  17. package/frames/dist/trace.js +42 -0
  18. package/frames/dist/wire.js +133 -0
  19. package/package.json +30 -3
  20. package/performance-tracks/dist/performance-tracks.dev.js +2 -1
  21. package/performance-tracks/dist/performance-tracks.observe.js +2 -1
  22. package/performance-tracks/types/index.d.ts +8 -6
  23. package/serialization/dist/decode.js +37 -8
  24. package/serialization/dist/serialization.js +39 -10
  25. package/serialization/types/serializer-decode.d.ts +24 -2
  26. package/server-functions/dist/client.dev.js +178 -72
  27. package/server-functions/dist/client.js +99 -61
  28. package/server-functions/dist/client.observe.js +178 -72
  29. package/server-functions/dist/server.dev.js +117 -56
  30. package/server-functions/dist/server.js +117 -56
  31. package/server-functions/dist/server.observe.js +117 -56
  32. package/skills/server-components/SKILL.md +228 -0
  33. package/types/client.d.ts +37 -2
  34. package/types/constants.d.ts +2 -1
  35. package/types/diagnostics.d.ts +8 -0
  36. package/types/frames/assets-tier.d.ts +78 -0
  37. package/types/frames/bind-tier.d.ts +60 -0
  38. package/types/frames/client.d.ts +37 -3
  39. package/types/frames/frame-client.d.ts +249 -96
  40. package/types/frames/frame-container-plugin.d.ts +2 -10
  41. package/types/frames/frame-sink.d.ts +33 -0
  42. package/types/frames/frame-transport.d.ts +66 -18
  43. package/types/frames/regions-tier.d.ts +45 -0
  44. package/types/frames/serializer-decode.d.ts +24 -2
  45. package/types/frames/server.d.ts +53 -1
  46. package/types/frames/trace-tier.d.ts +2 -0
  47. package/types/frames/tree-rewrite.d.ts +39 -0
  48. package/types/frames/wire-tier.d.ts +116 -0
  49. package/types/index.d.ts +38 -0
  50. package/types/index.server.d.ts +10 -1
  51. package/types/jsx.d.ts +11 -1
  52. package/types/observe.d.ts +182 -12
  53. package/types/request-error-hook.d.ts +5 -0
  54. package/types/serializer-decode.d.ts +24 -2
  55. package/types/server-functions/client.d.ts +26 -0
  56. package/types/server-functions/registry.d.ts +4 -1
  57. package/types/server-functions/shared.d.ts +12 -8
  58. package/types/server-mock.d.ts +13 -1
  59. package/types/server-observe.d.ts +8 -0
  60. package/types/server.d.ts +125 -12
@@ -13,10 +13,11 @@
13
13
  * Every export in this module is `@experimental`.
14
14
  */
15
15
  /**
16
- * One transport chunk of a frame stream, addressed by frame `id`.
16
+ * One transport chunk of a frame stream, addressed by frame `id`. Any
17
+ * chunk may carry `tiers` (see `TierAnnouncement`).
17
18
  * @experimental
18
19
  */
19
- export type FrameChunk = {
20
+ export type FrameChunk = ({
20
21
  type: "start";
21
22
  id: string;
22
23
  version: number;
@@ -91,17 +92,64 @@ export type FrameChunk = {
91
92
  version: number;
92
93
  key: string;
93
94
  args: Record<string, unknown>;
95
+ } | {
96
+ /**
97
+ * One server sweep's re-emissions as one unit (RFC 11 addendum, C13):
98
+ * the `hole` / `attr` members a sweep produced, unaddressed (the
99
+ * envelope addresses them), applied as one write — one flush, one
100
+ * `frame:applied`. A sweep that changed one binding is emitted as
101
+ * that member alone.
102
+ */
103
+ type: "ops";
104
+ id: string;
105
+ version: number;
106
+ ops: ({
107
+ type: "hole";
108
+ key: string;
109
+ html: string;
110
+ digest?: string;
111
+ } | {
112
+ type: "attr";
113
+ key: string;
114
+ attrs: string;
115
+ removed?: string[];
116
+ digest?: string;
117
+ })[];
94
118
  } | {
95
119
  type: "complete";
96
120
  id: string;
97
121
  version: number;
122
+ /**
123
+ * Present when the producer ended a plain (non-`live`) response at
124
+ * its streaming bound rather than at its sources' settling (RFC 11
125
+ * addendum): `"yields"` — the later-yield count; `"time"` — the
126
+ * wall-clock bound after the first flush, or the request's abort
127
+ * after it. The content shown is a cut-off, not a settled value;
128
+ * `live()` is the declared way past the bound.
129
+ */
130
+ bound?: "yields" | "time";
98
131
  } | {
99
132
  type: "error";
100
133
  id: string;
101
134
  version: number;
102
135
  key?: string;
103
136
  error: unknown;
104
- };
137
+ }) & TierAnnouncement;
138
+ /**
139
+ * The in-band tier announcement (frames savings pass §2; additive — RFC 11
140
+ * addendum): the frames-client tiers the render first needed since the
141
+ * last chunk left — `"bind"`, `"regions"`, `"assets"`, `"trace"`,
142
+ * `"wire"` — on whichever chunk leaves next. The response head carries the
143
+ * tiers minted before it (`X-Frame-Tiers`); a tier minted later rides
144
+ * here. The client starts each named tier's load before applying the
145
+ * chunk; a `data` chunk additionally AWAITS them (its node tree needs the
146
+ * tier to decode). Absent on every chunk of a response that minted nothing
147
+ * after its head, and ignored by a client that predates it.
148
+ * @experimental
149
+ */
150
+ export interface TierAnnouncement {
151
+ tiers?: string[];
152
+ }
105
153
  /**
106
154
  * One store write applied to a frame: `r` maps record keys to values
107
155
  * (`chunkToRecords` produces these from wire chunks) and `version` is the
@@ -150,17 +198,17 @@ export interface SlotContext {
150
198
  /**
151
199
  * The range's current interior — server-rendered client content on an
152
200
  * 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).
201
+ * framework binding hydrates onto it (a claim: zero DOM mutation) or
202
+ * replaces it.
155
203
  */
156
204
  existing: ChildNode[];
157
205
  /**
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).
206
+ * The range's own marker comments, when the occurrence has a placed range
207
+ * — the anchor the fill owns its interior through: bind or place the
208
+ * output before `end` (over `existing`) with the framework's insert
209
+ * primitive. The frame never touches a range's interior itself (server
210
+ * morphs protect slot ranges). Absent for a binding-slot occurrence
211
+ * (`positions`) and for a range whose end marker is missing.
164
212
  */
165
213
  range?: {
166
214
  start: Comment;
@@ -171,11 +219,13 @@ export interface SlotContext {
171
219
  * Client content for a server-declared slot. Direct-insert occurrences
172
220
  * call it with empty props; render-prop occurrences pass the occurrence's
173
221
  * resolved args (primitives literal, `{$ref}` data resolved through the
174
- * host, `{$frame}` regions as marker-range fragments). Return nodes to fill
175
- * the range, or `undefined` to claim `ctx.existing` untouched.
222
+ * host, `{$frame}` regions as frame elements). The fill owns its range: it
223
+ * places or binds its output before `ctx.range.end`, over `ctx.existing`
224
+ * (claimed in place on hydration), and disposes it through `ctx.onCleanup`.
225
+ * The return value is not read.
176
226
  * @experimental
177
227
  */
178
- export type Slot = (props: Record<string, unknown>, ctx: SlotContext) => Node | Node[] | undefined;
228
+ export type Slot = (props: Record<string, unknown>, ctx: SlotContext) => void;
179
229
  /** @experimental */
180
230
  export interface Frame {
181
231
  /** Merge a write into the store and flush (morph/reveal/slot sync). */
@@ -186,8 +236,6 @@ export interface Frame {
186
236
  readonly store: Readonly<Record<string, unknown>>;
187
237
  /** The stream's error record, if an `error` chunk arrived. */
188
238
  readonly error: unknown;
189
- /** Whether the named fragment has been revealed into the boundary. */
190
- isRevealed(segment: string): boolean;
191
239
  /**
192
240
  * Re-key this live frame to a different boundary id (the mount-preserving
193
241
  * half of a call-site handoff): nothing tears down — the element, store,
@@ -198,29 +246,20 @@ export interface Frame {
198
246
  */
199
247
  rebind(id: string): void;
200
248
  /**
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.
249
+ * Push a staged response's slot args into the live occurrences they
250
+ * address, ahead of the records' real apply (see `FrameHost.preview`).
251
+ * @internal
205
252
  */
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;
253
+ preview?(records: Record<string, unknown>): void;
217
254
  /** Tear down: slot cleanups cascade, later chunks are ignored. Idempotent. */
218
255
  dispose(): void;
219
256
  }
220
257
  /**
221
258
  * Routes a flat stream of addressed chunks to frames by id, buffering chunks
222
259
  * for frames that have not registered yet (only the newest version's chunks
223
- * are kept). `data` chunks are response-scoped and go to `applyData`.
260
+ * are kept). `data` chunks are response-scoped and go to `applyData`; a
261
+ * `slot` chunk's `{$ref}` args are resolved at the write, through the
262
+ * response's data (a value, or a pending read the response settles).
224
263
  *
225
264
  * An id may have several frames (the same server component mounted more
226
265
  * than once): chunks fan out to all of them, and a frame registering after
@@ -232,19 +271,45 @@ export interface FrameHost {
232
271
  /** Remove one frame (or all frames of the id when `frame` is omitted). */
233
272
  unregister(id: string, frame?: Frame): void;
234
273
  apply(chunk: FrameChunk): void;
274
+ /**
275
+ * The reactive half of a staged response (see
276
+ * `createServerComponentHandler`): a `slot` chunk's args — settled
277
+ * through its own response's table, as at a write — reach the
278
+ * occurrences mounted under its id as re-resolved props into their live
279
+ * bindings, while the store, the markup, and every structural change
280
+ * wait for the chunk's `apply`. Other chunk types are ignored.
281
+ * @internal
282
+ */
283
+ preview?(chunk: FrameChunk): void;
235
284
  /** The first registered frame under the id, if any. */
236
285
  get(id: string): Frame | undefined;
286
+ /**
287
+ * The address as an async source: its first landing is the first flush of
288
+ * the first response for it — the root content or its completion; the
289
+ * stream's error is the source ERRORING (frames-rulings 3.3, A0
290
+ * corollary 4 outward: the frame is one async value, and its `:error`
291
+ * is that value rejecting, exactly as any `createAsync` that rejects). A
292
+ * promise resolved at the write that lands it while that response is in
293
+ * flight and REJECTED with the error record at an `:error` write;
294
+ * `undefined` once the address has a landing to show (a later response
295
+ * in flight then morphs over it — the committed value holds), or when
296
+ * nothing has begun for the address. An errored address has no landing
297
+ * to show: a read of it is a promise for the NEXT flight's landing — an
298
+ * errored landing is not a landing for a fresh consumer, and the
299
+ * consumer that reads it re-asks (the integration's `reset`). A mount's
300
+ * covering `<Loading>` pends on this — and on nothing inside the frame —
301
+ * exactly as it pends on any async source's first landing.
302
+ */
303
+ landing(id: string): Promise<void> | undefined;
237
304
  serialize(value: unknown): {
238
305
  $ref: string;
239
306
  };
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;
307
+ /**
308
+ * See FrameHostOptions.revive. Assignable after creation: the frames
309
+ * client's traces tier installs the container-trace reviver on the
310
+ * shared host when its chunk loads (`@solidjs/web/frames/trace`).
311
+ */
312
+ revive?(value: unknown, claiming?: boolean): unknown;
248
313
  }
249
314
  /**
250
315
  * Options for `createFrameHost`.
@@ -253,55 +318,66 @@ export interface FrameHost {
253
318
  export interface FrameHostOptions {
254
319
  /**
255
320
  * 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).
321
+ * Called at a `slot` chunk's write with the chunk's frame id and version
322
+ * — the RESPONSE the record belongs to (data tables are response-scoped;
323
+ * one response is one version of one id), so the integration answers from
324
+ * that response's table and never a later one's. Answers the key's value,
325
+ * or — for a key the response has not delivered yet — the table's own
326
+ * PENDING READ: a promise marked `s = 0`, carrying `c` (the callbacks run
327
+ * when it settles), that the key's `data` chunk settles (stamped `s`/`v`
328
+ * as it does) and `closeData` rejects (frames-rulings 1.3; the L1 rule —
329
+ * a value that never comes is an error, not a silence). The host counts
330
+ * a record's pending reads so a fresh mount waits for them
331
+ * (`record.pending`) and re-applies the record when the last settles.
332
+ * `current` is the version the id's store is at — every version below it
333
+ * is superseded, and an integration keeping a table per response may
334
+ * drop theirs.
259
335
  */
260
336
  resolve?(ref: {
261
337
  $ref: string;
262
- }, frameId?: string): unknown;
338
+ }, frameId: string, version: number, current?: number): unknown;
263
339
  /** Test/host-side counterpart of `resolve`. */
264
340
  serialize?(value: unknown): {
265
341
  $ref: string;
266
342
  };
267
343
  /**
268
344
  * Receives each `data` chunk whole. Wire a codec table:
269
- * `applyData: c => table.apply(c)` (see `createJSONDataTable`).
345
+ * `applyData: c => table.apply(c)` (see `createJSONDataTable`); a table
346
+ * per response keys on `chunk.version` (see `resolve` for `current`).
270
347
  */
271
348
  applyData?(chunk: Extract<FrameChunk, {
272
349
  type: "data";
273
- }>): void;
350
+ }>, current?: number): void;
351
+ /**
352
+ * The response (one version of one id) has ended — its `complete`, or
353
+ * its `error` with no key — and a key it never delivered never comes:
354
+ * the integration closes that response's table so every pending read of
355
+ * it rejects (`table.close(error)`, with the response's error record when
356
+ * it ended by one). Called after the end chunk's own apply, so the frame
357
+ * has the response's last word first.
358
+ */
359
+ closeData?(frameId: string, version: number, error?: unknown): void;
274
360
  /**
275
361
  * 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.
362
+ * delivers a `data` chunk or a `slot` chunk whose args carry a `{$ref}` —
363
+ * `applyData`/`resolve` can assume the codec is resident when a chunk
364
+ * that reads data arrives. Keeps codec weight out of the eager client
365
+ * graph for responses that never carry serialized data.
279
366
  */
280
367
  prepareData?(): Promise<unknown>;
281
368
  /**
282
369
  * Revive protocol markers inside LITERAL slot args (values that are
283
- * neither `{$ref}` nor `{$frame}`) at arg-resolution time. Document-face
370
+ * neither `{$ref}` nor `{$frame}`) at arg-resolution time — the mount's
371
+ * read of the record, where an adopted occurrence's claim can read the
372
+ * revived value as the markup was rendered from it. Document-face
284
373
  * container traces ride this way — inline in the record, revived by the
285
374
  * integration (`reviveContainerTraces`) into live local containers.
375
+ * `claiming` marks the args of an adopt-time mount — the occurrence is
376
+ * about to hydrate server markup rendered from these values (the
377
+ * materializer parks a trace's backlog beyond the snapshot the markup
378
+ * shows until hydration ends — frames-rulings 3.6 (iii)).
286
379
  */
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;
380
+ revive?(value: unknown, claiming?: boolean): unknown;
305
381
  }
306
382
  /**
307
383
  * Options for `createFrame` / `createFrameElement`.
@@ -313,13 +389,6 @@ export interface FrameOptions {
313
389
  id?: string;
314
390
  /** Client content keyed by prop name (occurrences resolve by prop). */
315
391
  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
392
  /**
324
393
  * Adopt existing server-rendered DOM: the first apply morphs against it,
325
394
  * and slots sync immediately (hydration attach) — a document-SSR boot
@@ -340,18 +409,17 @@ export interface FrameOptions {
340
409
  * streamed chunks).
341
410
  */
342
411
  ownerScope?<T>(fn: () => T): T;
343
- /** Per-frame override of the host's `delegate` (see FrameHostOptions). */
344
- delegate?(eventNames: Iterable<string>): void;
345
412
  /**
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).
413
+ * Boundary-driven segment reveal. `#revealSegment` hands the placeholder
414
+ * seam to this hook: the binding reconstructs a client `<Loading>` there —
415
+ * `fallback` is the placeholder's own template content (shown while
416
+ * holding), `content()` materializes the segment and renders its client
417
+ * fills INSIDE the boundary so their readiness gates the reveal — and
418
+ * inserts it before `before`. An unboundaried async fill suspends up to
419
+ * that boundary and is covered instead of orphaned; one boundary per
420
+ * revealed segment, i.e. per author-placed `<Loading>`. Omitted, the
421
+ * default seam inserts `content()` before `before` at once and removes
422
+ * `before` (the framework-agnostic swap: no boundary, no reactive reveal).
355
423
  */
356
424
  reveal?(seam: {
357
425
  before: Node;
@@ -359,18 +427,49 @@ export interface FrameOptions {
359
427
  content: () => Node | DocumentFragment;
360
428
  }): void;
361
429
  /**
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.
430
+ * Adopt path only. Called when a sync leaves an adopted occurrence
431
+ * waiting — for its args record, for a read of it to settle, or for the
432
+ * tier its mount needs to load — while none was before; returns the
433
+ * release, called when a sync leaves none waiting or the frame disposes. The
434
+ * integration registers the hold with whatever counts its page as not
435
+ * yet settled (hydration-done counts it as a pending boundary —
436
+ * frames-rulings 3.1): a claim the frame has not made yet is page work
437
+ * still pending. The record's delivery is the integration's to observe
438
+ * (the document declares it at the marker and settles it — see
439
+ * `adoptBoundary`); the frame only re-syncs on the write.
369
440
  */
370
- recordsPending?(): boolean;
371
- /** Re-absorb the document's arrived-by-now records (idempotent per key). */
372
- drainRecords?(): void;
441
+ hold?(): () => void;
373
442
  }
443
+ /** @internal (the bind tier's own copy — see bind-tier.ts) */
444
+ export declare const SLOT_MARKER = "_s:";
445
+ /** @internal (the bind tier's own copy — see bind-tier.ts) */
446
+ export declare const SLOT_TEXT: string;
447
+ /**
448
+ * Whether a slot arg value is an async value passed whole (a promise or an
449
+ * async iterable) — DR-2's value tier. The server never resolves these to
450
+ * dead values; the client suspends at the consumption read.
451
+ * @internal (the client entry's and the bind tier's — each its own copy)
452
+ */
453
+ export declare function isAsyncValue(v: any): boolean;
454
+ /**
455
+ * A value's shape, as the binding-slot shape findings name it.
456
+ * @internal (dev only; the client entry's and the bind tier's)
457
+ */
458
+ export declare function shapeOf(v: unknown): string;
459
+ /**
460
+ * Dev finding (`BINDING_SLOT_POSITION`): the client side of a binding slot
461
+ * has the wrong shape — the fill's return is not an object or the prop is
462
+ * not a function (`fill-shape`), or a text position's value is not a
463
+ * primitive (`text-shape`). Through the diagnostics channel, so an
464
+ * observer captures it beside the server's findings.
465
+ * @internal (dev only; the client entry's and the bind tier's)
466
+ */
467
+ export declare function slotShapeFinding(data: Record<string, string>, message: string): void; /**
468
+ * Maps a wire chunk onto resident-store record writes. `data` chunks map to
469
+ * no records — they are response-scoped and the host applies them through
470
+ * its data hook.
471
+ * @experimental
472
+ */
374
473
  export declare function chunkToRecords(chunk: FrameChunk): Record<string, unknown>;
375
474
  export declare function createFrameHost(options?: FrameHostOptions): FrameHost;
376
475
  /**
@@ -384,6 +483,35 @@ export declare function createFrameHost(options?: FrameHostOptions): FrameHost;
384
483
  * fire it — client code has reactivity to subscribe with.
385
484
  */
386
485
  export declare const FRAME_APPLIED_EVENT = "frame:applied";
486
+ /**
487
+ * A frames-client tier's module, as its loader resolves it: its exports are
488
+ * the tier's appliers — the functions the runtime dispatches to once the
489
+ * module is resident (the regions tier's `resolve` / `bind` / …, the assets
490
+ * tier's `gate` / `apply`) — and the optional `install()` runs once at the
491
+ * load, for state that lives outside the runtime's dispatch (the traces
492
+ * tier sets the shared host's `revive`). The index signature is what lets a
493
+ * module with no `install` — a module whose exports are all appliers — be
494
+ * one (TypeScript's weak-type rule would otherwise reject it).
495
+ * @experimental
496
+ */
497
+ export interface TierModule {
498
+ install?(): void;
499
+ [applier: string]: unknown;
500
+ }
501
+ export declare const tierLoaders: Record<string, () => Promise<TierModule>>;
502
+ /** @internal */
503
+ export declare const tierLoads: Record<string, Promise<void> & {
504
+ r?: any;
505
+ }>;
506
+ /**
507
+ * Start (or join) a tier's load. Idempotent per name; a name with no loader
508
+ * is resident already and resolves at once. Resolves once the module has
509
+ * installed and every live frame has been flushed.
510
+ * @internal The frames client's own seam (the announcement reads call it).
511
+ */
512
+ export declare function prepareTier(name: string): Promise<void> & {
513
+ r?: any;
514
+ };
387
515
  export declare function createFrame(boundary: Element, options?: FrameOptions): Frame;
388
516
  export declare const FRAME_TAG = "solid-frame";
389
517
  export declare const FRAME_ID_ATTR = "data-fid"; /**
@@ -400,3 +528,28 @@ export declare function createFrameElement(options: FrameOptions): {
400
528
  readonly frame: Frame;
401
529
  dispose(): void;
402
530
  };
531
+ /**
532
+ * Create a bare boundary/region element (no frame bound yet). `<solid-frame>` is
533
+ * inlined as `display:contents` — not a stylesheet or custom-element
534
+ * registration — so it holds before any bundle loads and needs nothing
535
+ * defined: an undefined custom element is inert HTMLUnknownElement, and
536
+ * `display:contents` makes it generate no box, so its children lay out in the
537
+ * frame's parent.
538
+ *
539
+ * Exported (with `isFrameElement` and `eachInRange`) for the regions tier
540
+ * (`regions-tier.ts`), which bundles its own copy of these pure helpers;
541
+ * the eager entry re-exports none of them.
542
+ * @internal
543
+ */
544
+ export declare function makeFrameElement(id: any): HTMLElement;
545
+ /** Whether `node` is a frame boundary/region element (carries our id attr).
546
+ * @internal */
547
+ export declare function isFrameElement(node: any): any;
548
+ /**
549
+ * Walk a slot range's interior — every node between `start` and the range's
550
+ * end marker — calling `cb` on each. The next sibling is captured before the
551
+ * callback runs, so callbacks may detach the node. Returns the end marker
552
+ * (null if the range is truncated).
553
+ * @internal (exported for the regions tier — see `makeFrameElement`)
554
+ */
555
+ export declare function eachInRange(start: any, key: any, cb: any): any;
@@ -1,11 +1,3 @@
1
- /**
2
- * The container tier at the slot border: reactive containers (projections)
3
- * cross serialization boundaries as TRACES — an async iterable whose first
4
- * yield is a full state snapshot and whose later yields are patch batches —
5
- * and materialize back into live local containers. Renderer-agnostic glue;
6
- * the reactive core injects both halves. See frame-container-plugin.js.
7
- * @experimental
8
- */
9
1
  /** A container's border serialization: one subscribe() per consumer. */
10
2
  export interface ContainerTrace {
11
3
  subscribe(): AsyncIterable<any>;
@@ -19,7 +11,7 @@ export interface ContainerTraceMarker {
19
11
  }
20
12
  export declare function setContainerTraceResolver(fn: (value: unknown) => ContainerTrace | undefined): void;
21
13
  export declare function setAsyncIterableSharer(fn: (source: AsyncIterable<any>) => AsyncIterable<any>): void;
22
- export declare function setContainerTraceMaterializer(fn: (marker: ContainerTraceMarker) => unknown): void;
14
+ export declare function setContainerTraceMaterializer(fn: (marker: ContainerTraceMarker, claiming?: boolean) => unknown): void;
23
15
  /**
24
16
  * Serializer half: install the async-iterable → raw-seroval-stream mint
25
17
  * (serializer-decode.js, which already carries seroval — this module must
@@ -41,7 +33,7 @@ export declare function isContainerTraced(value: unknown): boolean;
41
33
  export declare function toBorderForm(value: unknown, envelopeContainers: boolean): unknown;
42
34
  export declare function isMaterializedContainer(value: unknown): boolean;
43
35
  export declare function isContainerTraceMarker(value: unknown): value is ContainerTraceMarker;
44
- export declare function reviveContainerTraces(value: unknown): unknown;
36
+ export declare function reviveContainerTraces(value: unknown, claiming?: boolean): unknown;
45
37
  declare function parseTrace(value: any, ctx: any): {
46
38
  a: number;
47
39
  i: any;
@@ -33,6 +33,28 @@ export interface FrameStreamOptions {
33
33
  * event stream. The chunk protocol is unchanged; only the framing is.
34
34
  */
35
35
  live?: boolean;
36
+ /**
37
+ * The plain response's streaming bound, in later yields (frames savings
38
+ * pass §6 decision 4). A plain (non-`live`) server component whose
39
+ * content reads a standing source — a generator, a projection — keeps
40
+ * its response open and ships each later commit as holes; with no
41
+ * declaration of liveness anywhere, that response ends here: after this
42
+ * many emitting sweeps past the first flush the producer emits
43
+ * `{ type: "complete", bound: "yields" }` and closes. `live()` is the
44
+ * declared way past the bound; a `live` response is never bounded.
45
+ * Default 64. `0` / `Infinity` disables the count bound.
46
+ */
47
+ maxYields?: number;
48
+ /**
49
+ * The plain response's streaming bound, in wall-clock milliseconds after
50
+ * the first flush (the same decision): `{ type: "complete", bound:
51
+ * "time" }` then the body closes. The request's `signal` aborting after
52
+ * the first flush ends a plain response the same way — a platform's
53
+ * deadline is a time bound the client can tell from a death. Default
54
+ * 30 000. `0` / `Infinity` disables the timer (the `signal` still ends
55
+ * it).
56
+ */
57
+ maxDurationMs?: number;
36
58
  /**
37
59
  * A RESUME (RFC 11 §9.5): the have-list the reconnecting client sent —
38
60
  * the digests it holds for this address, keyed as the chunks carry them
@@ -104,6 +126,17 @@ export declare function createDocumentSlotProps(clientProps: Record<string, unkn
104
126
  export declare function frameTransformDirectResult<T>(value: T, options: {
105
127
  id: string;
106
128
  args?: unknown[];
129
+ /**
130
+ * The client chunk URL of each frames-client tier, by tier name (the
131
+ * integration's, from its manifest — the server does not know the
132
+ * client's chunks). Given, the document emits a `modulepreload` for a
133
+ * tier when a server component first mints its feature, beside the
134
+ * `sc:tiers` record it writes either way; absent, the record alone
135
+ * announces the name and the client's `installServerComponents` starts
136
+ * the import from it. Document-wide: the first call's map is the
137
+ * render's.
138
+ */
139
+ tierUrls?: Record<string, string>;
107
140
  }): T;
108
141
  export declare function createSlotProps(sink: ReturnType<typeof createFrameSink>, frame: FrameAddress): Record<string, any>;
109
142
  export declare function serverComponentResponse(component: (props: Record<string, any>) => unknown, options?: FrameStreamOptions, init?: {