@solidjs/web 2.0.0-rc.13 → 2.0.0-rc.15
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/dist/server.dev.js +317 -185
- package/dist/server.js +298 -161
- package/dist/server.observe.js +299 -171
- package/dist/web.dev.js +207 -189
- package/dist/web.js +180 -178
- package/dist/web.observe.js +180 -180
- package/frames/dist/assets.js +92 -0
- package/frames/dist/bind.dev.js +326 -0
- package/frames/dist/bind.js +295 -0
- package/frames/dist/client.dev.js +665 -1114
- package/frames/dist/client.js +630 -1087
- package/frames/dist/client.observe.js +629 -1087
- package/frames/dist/regions.js +130 -0
- package/frames/dist/server.dev.js +400 -201
- package/frames/dist/server.js +397 -198
- package/frames/dist/server.observe.js +397 -198
- package/frames/dist/trace.js +45 -0
- package/frames/dist/wire.js +133 -0
- package/package.json +30 -4
- package/performance-tracks/dist/performance-tracks.dev.js +2 -1
- package/performance-tracks/dist/performance-tracks.observe.js +2 -1
- package/performance-tracks/types/index.d.ts +8 -6
- package/serialization/dist/decode.js +38 -9
- package/serialization/dist/serialization.js +40 -11
- package/serialization/types/serializer-decode.d.ts +24 -2
- package/server-functions/dist/client.dev.js +101 -62
- package/server-functions/dist/client.js +101 -62
- package/server-functions/dist/client.observe.js +101 -62
- package/server-functions/dist/server.dev.js +178 -67
- package/server-functions/dist/server.js +178 -67
- package/server-functions/dist/server.observe.js +178 -67
- package/skills/server-components/SKILL.md +65 -43
- package/types/client.d.ts +120 -8
- package/types/constants.d.ts +3 -1
- package/types/diagnostics.d.ts +8 -0
- package/types/frames/assets-tier.d.ts +78 -0
- package/types/frames/bind-tier.d.ts +60 -0
- package/types/frames/client.d.ts +37 -3
- package/types/frames/frame-client.d.ts +249 -78
- package/types/frames/frame-container-plugin.d.ts +2 -2
- package/types/frames/frame-sink.d.ts +33 -0
- package/types/frames/frame-transport.d.ts +66 -18
- package/types/frames/regions-tier.d.ts +45 -0
- package/types/frames/serializer-decode.d.ts +24 -2
- package/types/frames/server.d.ts +33 -9
- package/types/frames/trace-tier.d.ts +2 -0
- package/types/frames/wire-tier.d.ts +116 -0
- package/types/head.d.ts +1 -0
- package/types/index.d.ts +61 -16
- package/types/index.server.d.ts +3 -18
- package/types/jsx.d.ts +4 -13
- package/types/observe.d.ts +4 -2
- package/types/response.d.ts +26 -4
- package/types/serializer-decode.d.ts +24 -2
- package/types/server-functions/client.d.ts +30 -0
- package/types/server-functions/registry.d.ts +4 -1
- package/types/server-functions/shared.d.ts +12 -8
- package/types/server-mock.d.ts +22 -3
- package/types/server.d.ts +119 -17
|
@@ -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
|
|
154
|
-
*
|
|
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
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
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
|
|
175
|
-
*
|
|
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) =>
|
|
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
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
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
|
-
|
|
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
|
-
/**
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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,46 +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
|
-
* `
|
|
257
|
-
*
|
|
258
|
-
*
|
|
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?:
|
|
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
|
-
}
|
|
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
|
|
277
|
-
*
|
|
278
|
-
*
|
|
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
|
|
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;
|
|
380
|
+
revive?(value: unknown, claiming?: boolean): unknown;
|
|
296
381
|
}
|
|
297
382
|
/**
|
|
298
383
|
* Options for `createFrame` / `createFrameElement`.
|
|
@@ -325,15 +410,16 @@ export interface FrameOptions {
|
|
|
325
410
|
*/
|
|
326
411
|
ownerScope?<T>(fn: () => T): T;
|
|
327
412
|
/**
|
|
328
|
-
* Boundary-driven segment reveal.
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
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).
|
|
337
423
|
*/
|
|
338
424
|
reveal?(seam: {
|
|
339
425
|
before: Node;
|
|
@@ -341,18 +427,49 @@ export interface FrameOptions {
|
|
|
341
427
|
content: () => Node | DocumentFragment;
|
|
342
428
|
}): void;
|
|
343
429
|
/**
|
|
344
|
-
*
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
*
|
|
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.
|
|
351
440
|
*/
|
|
352
|
-
|
|
353
|
-
/** Re-absorb the document's arrived-by-now records (idempotent per key). */
|
|
354
|
-
drainRecords?(): void;
|
|
441
|
+
hold?(): () => void;
|
|
355
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
|
+
*/
|
|
356
473
|
export declare function chunkToRecords(chunk: FrameChunk): Record<string, unknown>;
|
|
357
474
|
export declare function createFrameHost(options?: FrameHostOptions): FrameHost;
|
|
358
475
|
/**
|
|
@@ -366,6 +483,35 @@ export declare function createFrameHost(options?: FrameHostOptions): FrameHost;
|
|
|
366
483
|
* fire it — client code has reactivity to subscribe with.
|
|
367
484
|
*/
|
|
368
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
|
+
};
|
|
369
515
|
export declare function createFrame(boundary: Element, options?: FrameOptions): Frame;
|
|
370
516
|
export declare const FRAME_TAG = "solid-frame";
|
|
371
517
|
export declare const FRAME_ID_ATTR = "data-fid"; /**
|
|
@@ -382,3 +528,28 @@ export declare function createFrameElement(options: FrameOptions): {
|
|
|
382
528
|
readonly frame: Frame;
|
|
383
529
|
dispose(): void;
|
|
384
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;
|
|
@@ -11,7 +11,7 @@ export interface ContainerTraceMarker {
|
|
|
11
11
|
}
|
|
12
12
|
export declare function setContainerTraceResolver(fn: (value: unknown) => ContainerTrace | undefined): void;
|
|
13
13
|
export declare function setAsyncIterableSharer(fn: (source: AsyncIterable<any>) => AsyncIterable<any>): void;
|
|
14
|
-
export declare function setContainerTraceMaterializer(fn: (marker: ContainerTraceMarker) => unknown): void;
|
|
14
|
+
export declare function setContainerTraceMaterializer(fn: (marker: ContainerTraceMarker, claiming?: boolean) => unknown): void;
|
|
15
15
|
/**
|
|
16
16
|
* Serializer half: install the async-iterable → raw-seroval-stream mint
|
|
17
17
|
* (serializer-decode.js, which already carries seroval — this module must
|
|
@@ -33,7 +33,7 @@ export declare function isContainerTraced(value: unknown): boolean;
|
|
|
33
33
|
export declare function toBorderForm(value: unknown, envelopeContainers: boolean): unknown;
|
|
34
34
|
export declare function isMaterializedContainer(value: unknown): boolean;
|
|
35
35
|
export declare function isContainerTraceMarker(value: unknown): value is ContainerTraceMarker;
|
|
36
|
-
export declare function reviveContainerTraces(value: unknown): unknown;
|
|
36
|
+
export declare function reviveContainerTraces(value: unknown, claiming?: boolean): unknown;
|
|
37
37
|
declare function parseTrace(value: any, ctx: any): {
|
|
38
38
|
a: number;
|
|
39
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?: {
|