@solidjs/web 2.0.0-rc.2 → 2.0.0-rc.20
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.
- package/README.md +1 -1
- package/dist/server.dev.js +5065 -0
- package/dist/server.js +1757 -355
- package/dist/{server.cjs → server.observe.js} +1951 -558
- package/dist/{dev.cjs → web.dev.js} +945 -550
- package/dist/web.js +635 -332
- package/dist/{dev.js → web.observe.js} +688 -403
- package/frames/dist/assets.js +92 -0
- package/frames/dist/client.dev.js +1296 -1198
- package/frames/dist/client.js +1128 -1191
- package/frames/dist/client.observe.js +2041 -0
- package/frames/dist/regions.js +171 -0
- package/frames/dist/server.dev.js +2549 -0
- package/frames/dist/server.js +1688 -3005
- package/frames/dist/server.observe.js +2548 -0
- package/frames/dist/trace.js +45 -0
- package/frames/dist/wire.js +594 -0
- package/frames/package.json +2 -25
- package/package.json +244 -256
- package/performance-tracks/dist/performance-tracks.dev.js +679 -0
- package/performance-tracks/dist/performance-tracks.js +6 -0
- package/performance-tracks/dist/performance-tracks.observe.js +667 -0
- package/performance-tracks/package.json +7 -0
- package/performance-tracks/types/index.d.ts +69 -0
- package/serialization/decode/package.json +2 -15
- package/serialization/dist/decode.js +121 -25
- package/serialization/dist/serialization.js +242 -88
- package/serialization/package.json +2 -15
- package/serialization/types/index.d.ts +85 -158
- package/serialization/types/serializer-decode.d.ts +173 -114
- package/serialization/types/serializer.d.ts +109 -0
- package/server-functions/dist/client.dev.js +1462 -0
- package/server-functions/dist/client.js +667 -165
- package/server-functions/dist/client.observe.js +1441 -0
- package/server-functions/dist/rich-args.js +84 -1
- package/server-functions/dist/server.dev.js +2714 -297
- package/server-functions/dist/server.js +2595 -271
- package/server-functions/dist/server.observe.js +3594 -0
- package/server-functions/package.json +2 -35
- package/server-functions/rich-args/package.json +2 -15
- package/skills/server-components/SKILL.md +117 -0
- package/storage/package.json +2 -15
- package/types/client.d.ts +342 -288
- package/types/constants.d.ts +22 -0
- package/types/cookies.d.ts +32 -84
- package/types/diagnostics.d.ts +80 -0
- package/types/frames/assets-tier.d.ts +78 -0
- package/types/frames/client.d.ts +40 -1
- package/types/frames/frame-client.d.ts +443 -280
- package/types/frames/frame-container-plugin.d.ts +64 -0
- package/types/frames/frame-morph.d.ts +29 -0
- package/types/frames/frame-sink.d.ts +141 -161
- package/types/frames/frame-transport.d.ts +263 -184
- package/types/frames/regions-tier.d.ts +60 -0
- package/types/frames/serializer-decode.d.ts +241 -0
- package/types/frames/serializer.d.ts +85 -158
- package/types/frames/server.d.ts +2 -2
- package/types/frames/trace-tier.d.ts +2 -0
- package/types/frames/tree-rewrite.d.ts +39 -0
- package/types/frames/wire-tier.d.ts +169 -0
- package/types/head.d.ts +20 -0
- package/types/index.d.ts +98 -81
- package/types/index.server.d.ts +159 -0
- package/types/jsx.d.ts +49 -44
- package/types/observe.d.ts +535 -0
- package/types/reconcile.d.ts +1 -0
- package/types/render.d.ts +11 -0
- package/types/request-error-hook.d.ts +5 -0
- package/types/response.d.ts +95 -147
- package/types/serializer-decode.d.ts +173 -114
- package/types/serializer.d.ts +85 -158
- package/types/server-functions/argument-codec.d.ts +30 -0
- package/types/server-functions/client.d.ts +238 -223
- package/types/server-functions/flash.d.ts +28 -30
- package/types/server-functions/registry.d.ts +105 -0
- package/types/server-functions/rich-args.d.ts +1 -10
- package/types/server-functions/server.d.ts +539 -531
- package/types/server-functions/shared.d.ts +398 -425
- package/types/server-functions/uploads.d.ts +50 -0
- package/types/server-mock.d.ts +120 -13
- package/types/server-observe.d.ts +86 -0
- package/types/server.d.ts +571 -422
- package/types/trace.d.ts +127 -0
- package/LICENSE +0 -21
- package/dist/web.cjs +0 -2033
- package/frames/dist/client.cjs +0 -2002
- package/frames/dist/client.dev.cjs +0 -2022
- package/frames/dist/server.cjs +0 -3877
- package/serialization/dist/decode.cjs +0 -139
- package/serialization/dist/serialization.cjs +0 -261
- package/serialization/types-cjs/index.d.cts +0 -182
- package/serialization/types-cjs/package.json +0 -3
- package/serialization/types-cjs/serializer-decode.d.cts +0 -182
- package/server-functions/dist/client.cjs +0 -834
- package/server-functions/dist/rich-args.cjs +0 -11
- package/server-functions/dist/server.cjs +0 -1242
- package/server-functions/dist/server.dev.cjs +0 -1242
- package/storage/dist/storage.cjs +0 -12
- package/storage/types-cjs/index.d.cts +0 -28
- package/storage/types-cjs/package.json +0 -3
- package/types/core.d.ts +0 -9
- package/types-cjs/client.d.cts +0 -337
- package/types-cjs/cookies.d.cts +0 -93
- package/types-cjs/core.d.cts +0 -9
- package/types-cjs/frames/client.d.cts +0 -36
- package/types-cjs/frames/frame-client.d.cts +0 -356
- package/types-cjs/frames/frame-sink.d.cts +0 -194
- package/types-cjs/frames/frame-transport.d.cts +0 -222
- package/types-cjs/frames/serializer.d.cts +0 -182
- package/types-cjs/frames/server.d.cts +0 -52
- package/types-cjs/index.d.cts +0 -244
- package/types-cjs/jsx-properties.d.cts +0 -93
- package/types-cjs/jsx.d.cts +0 -4159
- package/types-cjs/package.json +0 -3
- package/types-cjs/response.d.cts +0 -174
- package/types-cjs/serializer-decode.d.cts +0 -182
- package/types-cjs/serializer.d.cts +0 -182
- package/types-cjs/server-functions/client.d.cts +0 -262
- package/types-cjs/server-functions/flash.d.cts +0 -38
- package/types-cjs/server-functions/rich-args.d.cts +0 -10
- package/types-cjs/server-functions/server.d.cts +0 -681
- package/types-cjs/server-functions/shared.d.cts +0 -523
- package/types-cjs/server-mock.d.cts +0 -286
- 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
|
-
|
|
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
|
-
|
|
13
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
|
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<
|
|
45
|
-
|
|
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
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
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
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
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
|
|
127
|
-
|
|
128
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
-
*
|
|
187
|
-
* (
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
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
|
|
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;
|