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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +1 -1
  2. package/dist/server.dev.js +5165 -0
  3. package/dist/server.js +1876 -374
  4. package/dist/{server.cjs → server.observe.js} +2070 -577
  5. package/dist/{dev.cjs → web.dev.js} +955 -567
  6. package/dist/web.js +646 -350
  7. package/dist/{dev.js → web.observe.js} +699 -421
  8. package/frames/dist/assets.js +92 -0
  9. package/frames/dist/client.dev.js +1296 -1198
  10. package/frames/dist/client.js +1128 -1191
  11. package/frames/dist/client.observe.js +2041 -0
  12. package/frames/dist/regions.js +171 -0
  13. package/frames/dist/server.dev.js +2545 -0
  14. package/frames/dist/server.js +1683 -3004
  15. package/frames/dist/server.observe.js +2544 -0
  16. package/frames/dist/trace.js +45 -0
  17. package/frames/dist/wire.js +594 -0
  18. package/frames/package.json +2 -25
  19. package/package.json +244 -256
  20. package/performance-tracks/dist/performance-tracks.dev.js +679 -0
  21. package/performance-tracks/dist/performance-tracks.js +6 -0
  22. package/performance-tracks/dist/performance-tracks.observe.js +667 -0
  23. package/performance-tracks/package.json +7 -0
  24. package/performance-tracks/types/index.d.ts +69 -0
  25. package/serialization/decode/package.json +2 -15
  26. package/serialization/dist/decode.js +121 -25
  27. package/serialization/dist/serialization.js +282 -88
  28. package/serialization/package.json +2 -15
  29. package/serialization/types/index.d.ts +115 -153
  30. package/serialization/types/serializer-decode.d.ts +173 -114
  31. package/serialization/types/serializer.d.ts +144 -0
  32. package/server-functions/dist/client.dev.js +1462 -0
  33. package/server-functions/dist/client.js +667 -165
  34. package/server-functions/dist/client.observe.js +1441 -0
  35. package/server-functions/dist/rich-args.js +102 -1
  36. package/server-functions/dist/server.dev.js +2802 -299
  37. package/server-functions/dist/server.js +2724 -314
  38. package/server-functions/dist/server.observe.js +3680 -0
  39. package/server-functions/package.json +2 -35
  40. package/server-functions/rich-args/package.json +2 -15
  41. package/skills/server-components/SKILL.md +117 -0
  42. package/storage/package.json +2 -15
  43. package/types/client.d.ts +342 -288
  44. package/types/constants.d.ts +22 -0
  45. package/types/cookies.d.ts +32 -84
  46. package/types/diagnostics.d.ts +80 -0
  47. package/types/frames/assets-tier.d.ts +78 -0
  48. package/types/frames/client.d.ts +40 -1
  49. package/types/frames/frame-client.d.ts +443 -280
  50. package/types/frames/frame-container-plugin.d.ts +64 -0
  51. package/types/frames/frame-morph.d.ts +29 -0
  52. package/types/frames/frame-sink.d.ts +141 -161
  53. package/types/frames/frame-transport.d.ts +263 -184
  54. package/types/frames/regions-tier.d.ts +60 -0
  55. package/types/frames/serializer-decode.d.ts +241 -0
  56. package/types/frames/serializer.d.ts +115 -153
  57. package/types/frames/server.d.ts +2 -2
  58. package/types/frames/trace-tier.d.ts +2 -0
  59. package/types/frames/tree-rewrite.d.ts +39 -0
  60. package/types/frames/wire-tier.d.ts +169 -0
  61. package/types/head.d.ts +20 -0
  62. package/types/index.d.ts +98 -81
  63. package/types/index.server.d.ts +159 -0
  64. package/types/jsx.d.ts +49 -44
  65. package/types/observe.d.ts +535 -0
  66. package/types/reconcile.d.ts +1 -0
  67. package/types/render.d.ts +11 -0
  68. package/types/request-error-hook.d.ts +5 -0
  69. package/types/response.d.ts +95 -147
  70. package/types/serializer-decode.d.ts +173 -114
  71. package/types/serializer.d.ts +115 -153
  72. package/types/server-functions/argument-codec.d.ts +30 -0
  73. package/types/server-functions/client.d.ts +237 -223
  74. package/types/server-functions/flash.d.ts +28 -30
  75. package/types/server-functions/registry.d.ts +105 -0
  76. package/types/server-functions/rich-args.d.ts +1 -10
  77. package/types/server-functions/server.d.ts +538 -531
  78. package/types/server-functions/shared.d.ts +398 -425
  79. package/types/server-functions/uploads.d.ts +53 -0
  80. package/types/server-mock.d.ts +154 -20
  81. package/types/server-observe.d.ts +86 -0
  82. package/types/server.d.ts +601 -422
  83. package/types/trace.d.ts +127 -0
  84. package/LICENSE +0 -21
  85. package/dist/web.cjs +0 -2033
  86. package/frames/dist/client.cjs +0 -2002
  87. package/frames/dist/client.dev.cjs +0 -2022
  88. package/frames/dist/server.cjs +0 -3877
  89. package/serialization/dist/decode.cjs +0 -139
  90. package/serialization/dist/serialization.cjs +0 -261
  91. package/serialization/types-cjs/index.d.cts +0 -182
  92. package/serialization/types-cjs/package.json +0 -3
  93. package/serialization/types-cjs/serializer-decode.d.cts +0 -182
  94. package/server-functions/dist/client.cjs +0 -834
  95. package/server-functions/dist/rich-args.cjs +0 -11
  96. package/server-functions/dist/server.cjs +0 -1242
  97. package/server-functions/dist/server.dev.cjs +0 -1242
  98. package/storage/dist/storage.cjs +0 -12
  99. package/storage/types-cjs/index.d.cts +0 -28
  100. package/storage/types-cjs/package.json +0 -3
  101. package/types/core.d.ts +0 -9
  102. package/types-cjs/client.d.cts +0 -337
  103. package/types-cjs/cookies.d.cts +0 -93
  104. package/types-cjs/core.d.cts +0 -9
  105. package/types-cjs/frames/client.d.cts +0 -36
  106. package/types-cjs/frames/frame-client.d.cts +0 -356
  107. package/types-cjs/frames/frame-sink.d.cts +0 -194
  108. package/types-cjs/frames/frame-transport.d.cts +0 -222
  109. package/types-cjs/frames/serializer.d.cts +0 -182
  110. package/types-cjs/frames/server.d.cts +0 -52
  111. package/types-cjs/index.d.cts +0 -244
  112. package/types-cjs/jsx-properties.d.cts +0 -93
  113. package/types-cjs/jsx.d.cts +0 -4159
  114. package/types-cjs/package.json +0 -3
  115. package/types-cjs/response.d.cts +0 -174
  116. package/types-cjs/serializer-decode.d.cts +0 -182
  117. package/types-cjs/serializer.d.cts +0 -182
  118. package/types-cjs/server-functions/client.d.cts +0 -262
  119. package/types-cjs/server-functions/flash.d.cts +0 -38
  120. package/types-cjs/server-functions/rich-args.d.cts +0 -10
  121. package/types-cjs/server-functions/server.d.cts +0 -681
  122. package/types-cjs/server-functions/shared.d.cts +0 -523
  123. package/types-cjs/server-mock.d.cts +0 -286
  124. package/types-cjs/server.d.cts +0 -544
@@ -0,0 +1,64 @@
1
+ /** A container's border serialization: one subscribe() per consumer. */
2
+ export interface ContainerTrace {
3
+ subscribe(): AsyncIterable<any>;
4
+ /** Whether the container's root is an array — the consumer's seed shape. */
5
+ array: boolean;
6
+ }
7
+ /** The eval-face wire literal a trace decodes to before materialization. */
8
+ export interface ContainerTraceMarker {
9
+ $tr: AsyncIterable<any>;
10
+ $ta?: number;
11
+ }
12
+ export declare function setContainerTraceResolver(fn: (value: unknown) => ContainerTrace | undefined): void;
13
+ export declare function setAsyncIterableSharer(fn: (source: AsyncIterable<any>) => AsyncIterable<any>): void;
14
+ export declare function setContainerTraceMaterializer(fn: (marker: ContainerTraceMarker, claiming?: boolean) => unknown): void;
15
+ /**
16
+ * Serializer half: install the async-iterable → raw-seroval-stream mint
17
+ * (serializer-decode.js, which already carries seroval — this module must
18
+ * stay seroval-free because it also rides the EAGER frames-client graph,
19
+ * and seroval ships without `sideEffects: false`).
20
+ *
21
+ * Why a raw stream and not the iterable itself: seroval decodes an async
22
+ * iterable as a generator WRAPPER over its internal stream, so every
23
+ * buffered value is microtasks away — but hydration's claim walk is
24
+ * SYNCHRONOUS. A trace whose snapshot the document already delivered must
25
+ * read as ready DURING the walk (every other async source has a sync
26
+ * hydration answer: promise stamps, serialized records), or the consuming
27
+ * boundary renders a phantom fallback over settled markup (the chat
28
+ * welcome/status meter miss). A raw stream decodes as the stream object
29
+ * itself, whose `.on()` replays the buffer synchronously at subscribe.
30
+ */
31
+ export declare function setContainerTraceStreamMint(fn: any): void; /** Whether a value is a traced container (server side; WeakMap probe, trap-safe). */
32
+ export declare function isContainerTraced(value: unknown): boolean;
33
+ export declare function toBorderForm(value: unknown, envelopeContainers: boolean): unknown;
34
+ export declare function isMaterializedContainer(value: unknown): boolean;
35
+ export declare function isContainerTraceMarker(value: unknown): value is ContainerTraceMarker;
36
+ export declare function reviveContainerTraces(value: unknown, claiming?: boolean): unknown;
37
+ declare function parseTrace(value: any, ctx: any): {
38
+ a: number;
39
+ i: any;
40
+ };
41
+ /**
42
+ * Seroval plugin carrying reactive containers across the slot border as
43
+ * traces. Part of the codec's DEFAULT plugin set (serializer-decode.js), so
44
+ * every face — the hydration serializer, the frames codec, flight
45
+ * payloads, the client data tables — carries it with nothing to wire, and
46
+ * its weight lives in the (lazy) codec graph, never the eager client.
47
+ *
48
+ * @type {import("seroval").Plugin<object, { a: number, i: any }>}
49
+ */
50
+ export declare const ContainerTracePlugin: {
51
+ tag: string;
52
+ test(value: any): boolean;
53
+ parse: {
54
+ sync(): never;
55
+ async(value: any, ctx: any): Promise<{
56
+ a: number;
57
+ i: any;
58
+ }>;
59
+ stream: typeof parseTrace;
60
+ };
61
+ serialize(node: any, ctx: any): string;
62
+ deserialize(node: any, ctx: any): any;
63
+ };
64
+ export {};
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Morph a frame's content toward a new root: `ranges` is the frame-wide
3
+ * displaced-range index (the eager client's `#applyRoot` builds it), and
4
+ * subtrees the reconcile inserted whole are grafted afterwards.
5
+ * @internal
6
+ */
7
+ export declare function morph(parent: any, fragment: any, claim: any, ranges: any): void;
8
+ /** Land each displaced range a morph pass left in `ranges` where its
9
+ * occurrence now is under `roots` (see `flushGrafts`). @internal */
10
+ export declare function graft(roots: any, ranges: any): void;
11
+ export declare function morphAttributes(oldEl: any, newEl: any, claim: any): void;
12
+ /**
13
+ * Reconcile the children of `parent` toward the children of `source`, reusing
14
+ * existing DOM in place. `source` is a freshly parsed, disposable node whose
15
+ * children are moved into `parent` only when they are genuinely new.
16
+ *
17
+ * When `boundStart`/`boundEnd` are given, only the nodes in `(boundStart,
18
+ * boundEnd)` are reconciled and new nodes are inserted before `boundEnd` —
19
+ * this is how a range-boundary frame reconciles between its markers without
20
+ * touching the client content around them.
21
+ *
22
+ * `ranges` (threaded through the whole recursion from the frame's root apply)
23
+ * indexes the frame content's slot ranges by occurrence id as they stood
24
+ * BEFORE this morph. Occurrence ids are unique within a frame's content, so
25
+ * a range the new content places under a different parent (keyed list churn)
26
+ * is still THAT occurrence — the index is what lets the morph relocate it,
27
+ * live interior intact, where sibling-scoped matching sees only a new id.
28
+ */
29
+ export declare function reconcileChildren(parent: any, source: any, boundStart?: any, boundEnd?: any, claim?: any, ranges?: any, grafts?: any): void;
@@ -1,132 +1,122 @@
1
- // EXPERIMENTAL — the frames/server-components surface ships as an
2
- // experimental preview, excluded from the 2.0 stability guarantee: API
3
- // shapes and the wire format may change between prereleases (RFC 11).
4
- // Every export in this module is @experimental.
5
- import { FrameChunk } from "./frame-client.js";
6
-
1
+ import type { FrameMessage } from "./frame-client.js";
7
2
  /**
8
3
  * Addresses a frame stream: the boundary id and this response's version.
9
4
  * @experimental
10
5
  */
11
6
  export interface FrameAddress {
12
- id: string;
13
- version: number;
7
+ id: string;
8
+ version: number;
14
9
  }
15
-
16
- /**
17
- * The emission surface `renderToStream` routes through when producing a
18
- * frame stream instead of a document (see the `sink` render option). Each
19
- * method emits transport-agnostic chunks; `emit` is the envelope boundary.
20
- * @internal Compiler/renderer wiring — use `renderToFrameStream` or
21
- * `renderServerComponent` instead.
22
- * @experimental
23
- */
24
- export function createFrameSink(
25
- emit: (chunk: FrameChunk) => void,
26
- frame: FrameAddress
27
- ): Record<string, (...args: any[]) => void>;
28
-
29
10
  /**
30
11
  * Options shared by the frame producers.
31
12
  * @experimental
32
13
  */
33
14
  export interface FrameStreamOptions {
34
- /** Boundary address; defaults to `{ id: "", version: 1 }`. */
35
- frame?: { id?: string; version?: number };
36
- /** Remaining `renderToStream` options (plugins, onError, manifest, ...). */
37
- [key: string]: unknown;
15
+ /** Boundary address; defaults to `{ id: "", version: 1 }`. */
16
+ frame?: {
17
+ id?: string;
18
+ version?: number;
19
+ };
20
+ /**
21
+ * The request's abort: tears the render down as a client disconnect would
22
+ * (see `renderToStream`'s `signal`). `serverComponentResponse` and
23
+ * `frameFlightResponse` chain it with their own body's `cancel`.
24
+ */
25
+ signal?: AbortSignal;
26
+ /**
27
+ * The call arrived at the live address — a `live` loop is reading
28
+ * (`getServerFunctionInvocation().live`). `serverComponentResponse` then
29
+ * frames the chunks as server-sent events, as the codec stream is framed
30
+ * there (`text/event-stream`, `no-store`, the idle heartbeat, the dev
31
+ * chaos knob), so the loop reads the frame stream through the reader it
32
+ * already has and a proxy holds the connection open as it would any
33
+ * event stream. The chunk protocol is unchanged; only the framing is.
34
+ */
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
+ * `:complete` with `: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): `:complete` with `: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;
58
+ /**
59
+ * A RESUME (RFC 11 §9.5): the have-list the reconnecting client sent —
60
+ * the digests it holds for this address, keyed as the chunks carry them
61
+ * (`""` the root skeleton, `lh:N` / `lha:N` holes, `pl-N` revealed
62
+ * fragments; see `FRAME_HAVE_HEADER`). With it the render is
63
+ * conditional: the root html is skipped when its skeleton digest matches,
64
+ * and a hole or fragment is emitted only once it has settled and its
65
+ * digest differs — so a no-op reconnect transfers nothing and a fallback
66
+ * is never emitted over content. Absent, the render is the progressive
67
+ * stream it always was. `frameTransformResult` reads it off the request.
68
+ */
69
+ resume?: {
70
+ have: Record<string, string>;
71
+ };
72
+ /** Remaining `renderToStream` options (plugins, onError, manifest, ...). */
73
+ [key: string]: unknown;
38
74
  }
39
-
40
75
  /**
41
- * A produced frame stream: pipe chunks, or await the collected array.
76
+ * A produced frame stream: pipe its wire messages, or await the collected
77
+ * array.
42
78
  * @experimental
43
79
  */
44
- export interface FrameStream extends PromiseLike<FrameChunk[]> {
45
- pipe(writable: { write(chunk: FrameChunk): void; end?(): void }): void;
80
+ export interface FrameStream extends PromiseLike<FrameMessage[]> {
81
+ pipe(writable: {
82
+ write(message: FrameMessage): void;
83
+ end?(): void;
84
+ }): void;
46
85
  }
47
-
48
- /**
49
- * Render to a FrameChunk stream: the same render core as `renderToStream`
50
- * with emission swapped to the frame sink and the document writable replaced
51
- * by a chunk envelope (`start` up front, `complete` at stream end). Data
52
- * records default to the keyed JSON codec (decode with
53
- * `createJSONDataTable`).
54
- * @experimental
55
- */
56
- export function renderToFrameStream(code: () => unknown, options?: FrameStreamOptions): FrameStream;
57
-
58
- /**
59
- * Render a **server component** — a `props => JSX` function, typically
60
- * returned from a server function — to a FrameChunk stream. `props` is a
61
- * slot-props proxy, not data:
62
- *
63
- * - reading a prop as a child emits a marker range the client fills;
64
- * - calling a prop as a render function emits a `slot` chunk for a fresh
65
- * occurrence (a primitive `$key` arg names it, so client state follows the
66
- * entity across responses — the slot-level analogue of For's `keyed`
67
- * function; positional otherwise, which is the right default for most
68
- * flows);
69
- * - primitive args ride the chunk; server JSX args stream as nested regions
70
- * (`{$frame}` — html once, never data); other values serialize as `{$ref}`
71
- * data records with referential dedupe.
72
- *
73
- * The props a *client* passes never reach the server — server inputs are the
74
- * function's arguments.
75
- * @experimental
76
- */
77
- export function renderServerComponent(
78
- component: (props: Record<string, any>) => unknown,
79
- options?: FrameStreamOptions
80
- ): FrameStream;
81
-
86
+ export { SERVER_COMPONENT, SERVER_COMPONENT_SOURCE, SERVER_COMPONENT_ADDRESS, ServerComponentPlugin } from "./frame-transport.js";
82
87
  /**
83
- * The slot props proxy used by `renderServerComponent`. Every key
84
- * virtually exists (`in` is always true — a prop is a position the client
85
- * may fill), enumeration is empty by design, and serialization goes through
86
- * the live render context, so it must only be used during the frame's
87
- * render.
88
- * @internal Exposed for framework bindings composing their own producers.
89
- * @experimental
88
+ * Statement form of the registry bootstrap, for a document shell that wants
89
+ * to install `_$SC` ahead of every data script (e.g. a plugin injecting it
90
+ * into `<head>`). No longer required — serialized references self-bootstrap
91
+ * — but kept for integrations still emitting it; the idempotent form makes
92
+ * the double-definition harmless. Never splice it before the authored
93
+ * `<head>` elements: a head-open script claims as the first walked child at
94
+ * hydration and drifts every positional claim after it.
90
95
  */
91
- export function createSlotProps(
92
- sink: ReturnType<typeof createFrameSink>,
93
- frame: FrameAddress
94
- ): Record<string, any>;
95
-
96
- /**
97
- * A server component as an HTTP Response: the chunk stream framed with the
98
- * server-function wire convention, tagged `X-Frame-Stream: <frame id>` for
99
- * the client and `X-Content-Raw` so the server-function handler forwards it
100
- * untouched. `init` (headers/status, e.g. from a `respond()` envelope)
101
- * merges in; the frame tags win on conflict.
96
+ export declare const SERVER_COMPONENT_BOOTSTRAP: string; /**
97
+ * The emission surface `renderToStream` routes through when producing a
98
+ * frame stream instead of a document (see the `sink` render option). Each
99
+ * method writes records; `write` is the envelope boundary.
100
+ * @internal Compiler/renderer wiring — use `renderToFrameStream` or
101
+ * `renderServerComponent` instead.
102
102
  * @experimental
103
103
  */
104
- export function serverComponentResponse(
105
- component: (props: Record<string, any>) => unknown,
106
- options?: FrameStreamOptions,
107
- init?: { headers?: HeadersInit; status?: number }
108
- ): Response;
109
-
104
+ export declare function createFrameSink(write: (message: FrameMessage) => void, frame: FrameAddress, have?: Record<string, string>, hooks?: {
105
+ live?: boolean;
106
+ onYield?: () => void;
107
+ }): Record<string, (...args: any[]) => void>;
110
108
  /**
111
- * The server-component convention as a `transformResult` policy for
112
- * `handleServerFunctionRequest`: a function result — or a `respond()`
113
- * envelope whose value is a function — becomes a frame-stream Response,
114
- * with the frame id defaulting to the server function's id so repeat calls
115
- * target the same client boundary. Everything else passes through.
116
- *
117
- * @example
118
- * ```ts
119
- * handleServerFunctionRequest(request, {
120
- * transformResult: frameTransformResult,
121
- * provideEvent
122
- * });
123
- * ```
124
- * @experimental
109
+ * The root's SKELETON: its html with every live-hole range and slot range
110
+ * emptied (markers kept). What remains is the structure hole emissions
111
+ * address into — static markup, marker ids and their nesting, placeholder
112
+ * ids and fallbacks. Equal skeletons mean equal hole/fragment keys, which
113
+ * is what makes emitting into the client's existing DOM sound; a differing
114
+ * one re-ships the root whole (structure changed — a hole count that moved
115
+ * with data, a static branch that flipped).
125
116
  */
126
- export function frameTransformResult(event: unknown, result: unknown): unknown;
127
-
128
- // === Document SSR (t = 0) ===
129
-
117
+ export declare function frameSkeleton(html: any): any;
118
+ export declare function renderToFrameStream(code: () => unknown, options?: FrameStreamOptions): FrameStream;
119
+ export declare function renderServerComponent(component: (props: Record<string, any>) => unknown, options?: FrameStreamOptions): FrameStream;
130
120
  /**
131
121
  * Document-mode slot props — the t = 0 counterpart of
132
122
  * `createSlotProps`: the server component renders INLINE in the
@@ -136,59 +126,49 @@ export function frameTransformResult(event: unknown, result: unknown): unknown;
136
126
  * regions onto the server-rendered ranges.
137
127
  * @experimental
138
128
  */
139
- export function createDocumentSlotProps(
140
- clientProps: Record<string, unknown>,
141
- frameId: string
142
- ): Record<string, unknown>;
143
-
144
- /**
145
- * The in-process mirror of `frameTransformResult` for DOCUMENT SSR: install
146
- * as `configureServerFunctionsServer({ transformDirectResult })` and a
147
- * direct (same-process) server-function result that is a function comes back
148
- * as an inline-renderable server component (frame markers + document
149
- * slot props), branded with its function id and the call's wire address.
150
- * Non-function results pass through.
151
- * @experimental
152
- */
153
- export function frameTransformDirectResult<T>(
154
- value: T,
155
- options: { id: string; args?: unknown[] }
156
- ): T;
157
-
158
- /**
159
- * The frame half of single-flight, as a `transformFlightResult` policy for
160
- * `handleServerFunctionRequest`: when part of what a mutation invalidated is
161
- * markup (a component-valued flight-data entry), the frame stream carries
162
- * the whole payload — each component's content as a region addressed by its
163
- * call, the `{ value, data }` envelope as `outcome` chunks with the
164
- * component entries serialized as flight references. Returns `undefined`
165
- * when nothing invalidated is markup (the response stays the plain
166
- * single-flight envelope).
167
- * @experimental
168
- */
169
- export function frameTransformFlightResult(
170
- event: unknown,
171
- outcome: { value: unknown; data: unknown },
172
- context?: unknown
173
- ): Promise<Response | undefined>;
174
-
175
- // The brands and the codec plugin live with the transport (client bundles
176
- // resolve flight references against the live registry); re-exported here for
177
- // server integrations importing the document-SSR surface.
178
- export {
179
- SERVER_COMPONENT,
180
- SERVER_COMPONENT_ADDRESS,
181
- SERVER_COMPONENT_SOURCE,
182
- ServerComponentPlugin
183
- } from "./frame-transport.js";
184
-
129
+ export declare function createDocumentSlotProps(clientProps: Record<string, unknown>, frameId: string): Record<string, unknown>;
130
+ export declare function frameTransformDirectResult<T>(value: T, options: {
131
+ id: string;
132
+ args?: unknown[];
133
+ /**
134
+ * The client chunk URL of each frames-client tier, by tier name (the
135
+ * integration's, from its manifest — the server does not know the
136
+ * client's chunks). Given, the document emits a `modulepreload` for a
137
+ * tier when a server component first mints its feature, beside the
138
+ * `sc:tiers` record it writes either way; absent, the record alone
139
+ * announces the name and the client's `installServerComponents` starts
140
+ * the import from it. Document-wide: the first call's map is the
141
+ * render's.
142
+ */
143
+ tierUrls?: Record<string, string>;
144
+ }): T;
145
+ export declare function createSlotProps(sink: ReturnType<typeof createFrameSink>, frame: FrameAddress): Record<string, any>;
146
+ export declare function serverComponentResponse(component: (props: Record<string, any>) => unknown, options?: FrameStreamOptions, init?: {
147
+ headers?: HeadersInit;
148
+ status?: number;
149
+ }): Response;
150
+ export declare function frameTransformResult(event: unknown, result: unknown): unknown;
151
+ export declare function frameTransformFlightResult(event: unknown, outcome: {
152
+ value: unknown;
153
+ data: unknown;
154
+ }, context?: unknown): Promise<Response | undefined>;
185
155
  /**
186
- * Statement form of the `self._$SC` placeholder-registry bootstrap
187
- * (idempotent — first definition wins). No longer required in the document
188
- * shell: each hydration script's first serialized server-component reference
189
- * self-bootstraps the registry. Kept for integrations still installing it
190
- * document-wide; the client upgrades the registry via
191
- * `installServerComponents()`.
192
- * @experimental
156
+ * A framed response carrying several frames and a single-flight outcome:
157
+ * each frame's chunks in order (the host routes and buffers by id), then the
158
+ * `{ value, data }` envelope as `outcome` chunks.
159
+ *
160
+ * Those chunks carry the codec's own nodes, one per chunk, so async values
161
+ * inside flight data settle progressively exactly as they do in a plain
162
+ * single-flight body — the consumer replays them into the same decoder.
163
+ *
164
+ * `signal` is the request's abort (`frameTransformFlightResult` passes it):
165
+ * with the body's own `cancel`, either tears the frame in progress down and
166
+ * ends the response.
193
167
  */
194
- export const SERVER_COMPONENT_BOOTSTRAP: string;
168
+ export declare function frameFlightResponse({ primary, regions, outcome, codec, signal }: {
169
+ primary: any;
170
+ regions?: any[];
171
+ outcome: any;
172
+ codec: any;
173
+ signal: any;
174
+ }, init?: {}): Response;