@solidjs/web 2.0.0-beta.24 → 2.0.0-beta.26
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/dev.cjs +11 -8
- package/dist/dev.js +11 -8
- package/dist/web.cjs +11 -8
- package/dist/web.js +11 -8
- package/frames/dist/client.cjs +135 -208
- package/frames/dist/client.dev.cjs +1408 -0
- package/frames/dist/client.dev.js +1396 -0
- package/frames/dist/client.js +136 -209
- package/frames/dist/server.cjs +106 -78
- package/frames/dist/server.js +106 -78
- package/package.json +27 -6
- package/server-functions/dist/client.cjs +3 -3
- package/server-functions/dist/client.js +3 -3
- package/server-functions/dist/server.cjs +3 -3
- package/server-functions/dist/server.js +3 -3
- package/types/frames/client.d.ts +13 -49
- package/types/frames/frame-client.d.ts +34 -28
- package/types/frames/server.d.ts +1 -20
- package/types-cjs/frames/client.d.cts +13 -49
- package/types-cjs/frames/frame-client.d.cts +34 -28
- package/types-cjs/frames/server.d.cts +1 -20
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/web",
|
|
3
3
|
"description": "Solid's web runtime: client rendering, hydration, SSR, and DOM-specific control flow (Portal, Dynamic).",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.26",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -231,6 +231,16 @@
|
|
|
231
231
|
}
|
|
232
232
|
},
|
|
233
233
|
"browser": {
|
|
234
|
+
"development": {
|
|
235
|
+
"import": {
|
|
236
|
+
"types": "./types/frames/client.d.ts",
|
|
237
|
+
"default": "./frames/dist/client.dev.js"
|
|
238
|
+
},
|
|
239
|
+
"require": {
|
|
240
|
+
"types": "./types-cjs/frames/client.d.cts",
|
|
241
|
+
"default": "./frames/dist/client.dev.cjs"
|
|
242
|
+
}
|
|
243
|
+
},
|
|
234
244
|
"import": {
|
|
235
245
|
"types": "./types/frames/client.d.ts",
|
|
236
246
|
"default": "./frames/dist/client.js"
|
|
@@ -260,6 +270,16 @@
|
|
|
260
270
|
"default": "./frames/dist/server.cjs"
|
|
261
271
|
}
|
|
262
272
|
},
|
|
273
|
+
"development": {
|
|
274
|
+
"import": {
|
|
275
|
+
"types": "./types/frames/client.d.ts",
|
|
276
|
+
"default": "./frames/dist/client.dev.js"
|
|
277
|
+
},
|
|
278
|
+
"require": {
|
|
279
|
+
"types": "./types-cjs/frames/client.d.cts",
|
|
280
|
+
"default": "./frames/dist/client.dev.cjs"
|
|
281
|
+
}
|
|
282
|
+
},
|
|
263
283
|
"import": {
|
|
264
284
|
"types": "./types/frames/client.d.ts",
|
|
265
285
|
"default": "./frames/dist/client.js"
|
|
@@ -296,25 +316,26 @@
|
|
|
296
316
|
"seroval-plugins": "~1.5.4"
|
|
297
317
|
},
|
|
298
318
|
"peerDependencies": {
|
|
299
|
-
"solid-js": "^2.0.0-beta.
|
|
319
|
+
"solid-js": "^2.0.0-beta.26"
|
|
300
320
|
},
|
|
301
321
|
"devDependencies": {
|
|
302
|
-
"solid-js": "2.0.0-beta.
|
|
322
|
+
"solid-js": "2.0.0-beta.26"
|
|
303
323
|
},
|
|
304
324
|
"scripts": {
|
|
305
325
|
"build": "npm-run-all -nl build:clean types:copy-jsx build:js",
|
|
306
326
|
"build:clean": "rimraf dist/",
|
|
307
327
|
"build:js": "rollup -c",
|
|
308
328
|
"link": "symlink-dir . node_modules/@solidjs/web",
|
|
309
|
-
"types": "npm-run-all -nl types:clean types:copy-jsx types:web types:copy-web types:web-storage types:copy-
|
|
310
|
-
"types:clean": "rimraf types/ types-cjs/ storage/types/ storage/types-cjs/ serialization/types/ serialization/types-cjs/",
|
|
329
|
+
"types": "npm-run-all -nl types:clean types:copy-jsx types:web types:copy-web types:web-storage types:copy-server-functions types:web-frames types:copy-serialization types:copy-frames types:cjs",
|
|
330
|
+
"types:clean": "rimraf types/ types-cjs/ storage/types/ storage/types-cjs/ serialization/types/ serialization/types-cjs/ frames/types/",
|
|
311
331
|
"types:copy-jsx": "ncp ../../node_modules/@dom-expressions/runtime/src/jsx.d.ts ./src/jsx.d.ts && ncp ../../node_modules/@dom-expressions/runtime/src/jsx-properties.d.ts ./src/jsx-properties.d.ts && dom-expressions-jsx-types --input ./src/jsx.d.ts --element \"SolidElement | Node | ArrayElement\" --import 'import type { Element as SolidElement } from \"solid-js\";'",
|
|
312
332
|
"types:web": "tsc --project ./tsconfig.build.json",
|
|
313
333
|
"types:copy-web": "ncp ../../node_modules/@dom-expressions/runtime/src/client.d.ts ./types/client.d.ts && ncp ../../node_modules/@dom-expressions/runtime/src/server.d.ts ./types/server.d.ts && ncp ../../node_modules/@dom-expressions/runtime/src/serializer.d.ts ./types/serializer.d.ts && ncp ../../node_modules/@dom-expressions/runtime/src/response.d.ts ./types/response.d.ts && ncp ./src/jsx.d.ts ./types/jsx.d.ts && ncp ./src/jsx-properties.d.ts ./types/jsx-properties.d.ts",
|
|
314
334
|
"types:web-storage": "tsc --project ./storage/tsconfig.build.json",
|
|
335
|
+
"types:web-frames": "tsc --project ./frames/tsconfig.build.json",
|
|
315
336
|
"types:copy-serialization": "node -e \"fs.mkdirSync('./serialization/types', { recursive: true }); fs.copyFileSync('../../node_modules/@dom-expressions/runtime/src/serializer.d.ts', './serialization/types/index.d.ts');\"",
|
|
316
337
|
"types:copy-server-functions": "node -e \"fs.mkdirSync('./types/server-functions', { recursive: true }); for (const f of ['shared', 'client', 'server']) fs.copyFileSync('../../node_modules/@dom-expressions/runtime/src/server-functions/' + f + '.d.ts', './types/server-functions/' + f + '.d.ts');\"",
|
|
317
|
-
"types:copy-frames": "node -e \"fs.mkdirSync('./types/frames', { recursive: true }); for (const f of ['frame-client', 'frame-transport', 'frame-sink', 'serializer']) fs.copyFileSync('../../node_modules/@dom-expressions/runtime/src/' + f + '.d.ts', './types/frames/' + f + '.d.ts'); for (const f of ['client', 'server']) fs.
|
|
338
|
+
"types:copy-frames": "node -e \"fs.mkdirSync('./types/frames', { recursive: true }); for (const f of ['frame-client', 'frame-transport', 'frame-sink', 'serializer']) fs.copyFileSync('../../node_modules/@dom-expressions/runtime/src/' + f + '.d.ts', './types/frames/' + f + '.d.ts'); for (const f of ['client', 'server']) fs.writeFileSync('./types/frames/' + f + '.d.ts', fs.readFileSync('./frames/types/' + f + '.d.ts', 'utf8').replaceAll('@dom-expressions/runtime/src/', './'));\"",
|
|
318
339
|
"types:cjs": "node ../../scripts/sync-dual-types.mjs ./types ./types-cjs ./storage/types ./storage/types-cjs ./serialization/types ./serialization/types-cjs",
|
|
319
340
|
"test": "vitest run && vitest run --config vite.config.server.mjs && vitest run --config vite.config.hydrate.mjs",
|
|
320
341
|
"test:server": "vitest run --config vite.config.server.mjs",
|
|
@@ -219,15 +219,15 @@ class ChunkReader {
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
async next() {
|
|
222
|
-
|
|
222
|
+
while (this.buffer.length < 12) {
|
|
223
223
|
if (this.done) {
|
|
224
|
-
return {
|
|
224
|
+
if (this.buffer.length === 0) return {
|
|
225
225
|
done: true,
|
|
226
226
|
value: undefined
|
|
227
227
|
};
|
|
228
|
+
throw new Error("Malformed server function stream.");
|
|
228
229
|
}
|
|
229
230
|
await this.readChunk();
|
|
230
|
-
return await this.next();
|
|
231
231
|
}
|
|
232
232
|
const head = new TextDecoder().decode(this.buffer.subarray(1, 11));
|
|
233
233
|
const bytes = Number.parseInt(head, 16);
|
|
@@ -217,15 +217,15 @@ class ChunkReader {
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
async next() {
|
|
220
|
-
|
|
220
|
+
while (this.buffer.length < 12) {
|
|
221
221
|
if (this.done) {
|
|
222
|
-
return {
|
|
222
|
+
if (this.buffer.length === 0) return {
|
|
223
223
|
done: true,
|
|
224
224
|
value: undefined
|
|
225
225
|
};
|
|
226
|
+
throw new Error("Malformed server function stream.");
|
|
226
227
|
}
|
|
227
228
|
await this.readChunk();
|
|
228
|
-
return await this.next();
|
|
229
229
|
}
|
|
230
230
|
const head = new TextDecoder().decode(this.buffer.subarray(1, 11));
|
|
231
231
|
const bytes = Number.parseInt(head, 16);
|
|
@@ -249,15 +249,15 @@ class ChunkReader {
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
async next() {
|
|
252
|
-
|
|
252
|
+
while (this.buffer.length < 12) {
|
|
253
253
|
if (this.done) {
|
|
254
|
-
return {
|
|
254
|
+
if (this.buffer.length === 0) return {
|
|
255
255
|
done: true,
|
|
256
256
|
value: undefined
|
|
257
257
|
};
|
|
258
|
+
throw new Error("Malformed server function stream.");
|
|
258
259
|
}
|
|
259
260
|
await this.readChunk();
|
|
260
|
-
return await this.next();
|
|
261
261
|
}
|
|
262
262
|
const head = new TextDecoder().decode(this.buffer.subarray(1, 11));
|
|
263
263
|
const bytes = Number.parseInt(head, 16);
|
|
@@ -247,15 +247,15 @@ class ChunkReader {
|
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
async next() {
|
|
250
|
-
|
|
250
|
+
while (this.buffer.length < 12) {
|
|
251
251
|
if (this.done) {
|
|
252
|
-
return {
|
|
252
|
+
if (this.buffer.length === 0) return {
|
|
253
253
|
done: true,
|
|
254
254
|
value: undefined
|
|
255
255
|
};
|
|
256
|
+
throw new Error("Malformed server function stream.");
|
|
256
257
|
}
|
|
257
258
|
await this.readChunk();
|
|
258
|
-
return await this.next();
|
|
259
259
|
}
|
|
260
260
|
const head = new TextDecoder().decode(this.buffer.subarray(1, 11));
|
|
261
261
|
const bytes = Number.parseInt(head, 16);
|
package/types/frames/client.d.ts
CHANGED
|
@@ -1,53 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* boundaries. There is deliberately no server-component API here beyond
|
|
4
|
-
* `installServerComponents()`: `dynamic` + server functions IS the client
|
|
5
|
-
* surface — a server-function call whose response is a frame stream
|
|
6
|
-
* resolves with a stable per-call-site component.
|
|
7
|
-
*
|
|
8
|
-
* Copied next to the runtime's frame d.ts files at publish (see
|
|
9
|
-
* types:copy-frames), so the relative imports below resolve in-place.
|
|
10
|
-
*/
|
|
11
|
-
export {
|
|
12
|
-
createFrame,
|
|
13
|
-
createFrameHost,
|
|
14
|
-
createFrameInsertable,
|
|
15
|
-
FRAME_APPLIED_EVENT
|
|
16
|
-
} from "./frame-client.js";
|
|
17
|
-
export type {
|
|
18
|
-
Frame,
|
|
19
|
-
FrameChunk,
|
|
20
|
-
FrameHost,
|
|
21
|
-
FrameHostOptions,
|
|
22
|
-
FrameOptions,
|
|
23
|
-
FrameWrite,
|
|
24
|
-
Slot,
|
|
25
|
-
SlotContext
|
|
26
|
-
} from "./frame-client.js";
|
|
27
|
-
export {
|
|
28
|
-
FRAME_STREAM_HEADER,
|
|
29
|
-
applyFrameResponse,
|
|
30
|
-
isFrameStreamResponse,
|
|
31
|
-
createServerComponentHandler
|
|
32
|
-
} from "./frame-transport.js";
|
|
1
|
+
export { createFrame, createFrameHost, createFrameElement, FRAME_APPLIED_EVENT } from "./frame-client.js";
|
|
2
|
+
export { FRAME_STREAM_HEADER, applyFrameResponse, isFrameStreamResponse, createServerComponentHandler } from "./frame-transport.js";
|
|
33
3
|
export { createJSONDataTable } from "./serializer.js";
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
import type { FrameHost } from "./frame-client.js";
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* The app-wide frame host (created on first use): one chunk router, with
|
|
40
|
-
* codec data tables rotated per response — deserializer cross-reference
|
|
41
|
-
* space is stream-scoped by contract.
|
|
42
|
-
*/
|
|
43
|
-
export function getFrameHost(): FrameHost;
|
|
44
|
-
|
|
4
|
+
export declare function getFrameHost(): any;
|
|
45
5
|
/**
|
|
46
6
|
* Installs the server-component transport policy on the server-function
|
|
47
|
-
* client: boundary identity derives from the reactive owner captured at
|
|
48
|
-
* call site,
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
7
|
+
* client: boundary identity derives from the reactive owner captured at
|
|
8
|
+
* each call site (`getOwner`), so distinct `dynamic()` sources get
|
|
9
|
+
* independent boundaries with nothing declared, refetches from the same
|
|
10
|
+
* source resolve to the identical component, and ownerless calls fall back
|
|
11
|
+
* to one boundary per function id.
|
|
12
|
+
*
|
|
13
|
+
* Call once in the client entry (an explicit call — the package is
|
|
14
|
+
* `sideEffects: false`, so a bare import would be tree-shaken away);
|
|
15
|
+
* call again to rebind to a custom host.
|
|
52
16
|
*/
|
|
53
|
-
export function installServerComponents(host?:
|
|
17
|
+
export declare function installServerComponents(host?: any): void;
|
|
@@ -41,15 +41,6 @@ export type FrameChunk =
|
|
|
41
41
|
inlineStyles?: { id: string; content?: string; attrs?: Record<string, string> }[];
|
|
42
42
|
}
|
|
43
43
|
| { type: "slot"; id: string; version: number; key: string; args: Record<string, unknown> }
|
|
44
|
-
| { type: "template"; id: string; version: number; key: string; html: string; fields: string[] }
|
|
45
|
-
| {
|
|
46
|
-
type: "block";
|
|
47
|
-
id: string;
|
|
48
|
-
version: number;
|
|
49
|
-
key: string;
|
|
50
|
-
template: string;
|
|
51
|
-
values: unknown[];
|
|
52
|
-
}
|
|
53
44
|
| { type: "complete"; id: string; version: number }
|
|
54
45
|
| { type: "error"; id: string; version: number; key?: string; error: unknown };
|
|
55
46
|
|
|
@@ -170,7 +161,7 @@ export interface FrameHostOptions {
|
|
|
170
161
|
|
|
171
162
|
export function createFrameHost(options?: FrameHostOptions): FrameHost;
|
|
172
163
|
|
|
173
|
-
/** Options for `createFrame` / `
|
|
164
|
+
/** Options for `createFrame` / `createFrameElement`. */
|
|
174
165
|
export interface FrameOptions {
|
|
175
166
|
/** Register with this host under `id`, receiving routed/buffered chunks. */
|
|
176
167
|
host?: FrameHost;
|
|
@@ -194,29 +185,44 @@ export interface FrameOptions {
|
|
|
194
185
|
* streamed chunks).
|
|
195
186
|
*/
|
|
196
187
|
ownerScope?<T>(fn: () => T): T;
|
|
188
|
+
/**
|
|
189
|
+
* Boundary-driven segment reveal. When present, `#revealSegment` hands the
|
|
190
|
+
* placeholder seam to this hook instead of swapping imperatively: the binding
|
|
191
|
+
* reconstructs a client `<Loading>` there — `fallback` is the placeholder's
|
|
192
|
+
* own template content (shown while holding), `content()` materializes the
|
|
193
|
+
* segment and renders its client fills INSIDE the boundary so their readiness
|
|
194
|
+
* gates the reveal — and inserts it before `before`. An unboundaried async
|
|
195
|
+
* fill suspends up to that boundary and is covered instead of orphaned; one
|
|
196
|
+
* boundary per revealed segment, i.e. per author-placed `<Loading>`. Omit it
|
|
197
|
+
* for the framework-agnostic imperative swap (no reactive reveal).
|
|
198
|
+
*/
|
|
199
|
+
reveal?(seam: { before: Node; fallback: Node[]; content: () => Node | DocumentFragment }): void;
|
|
197
200
|
}
|
|
198
201
|
|
|
199
|
-
/**
|
|
202
|
+
/**
|
|
203
|
+
* A frame rendering into an EXISTING element boundary. Pass `adopt: true` for
|
|
204
|
+
* the document-SSR path: the element already holds server-rendered content,
|
|
205
|
+
* so the first apply morphs against it and slots sync immediately (hydration
|
|
206
|
+
* attach), claiming their server-rendered DOM — a document boot needs no
|
|
207
|
+
* chunk.
|
|
208
|
+
*/
|
|
200
209
|
export function createFrame(boundary: Element, options?: FrameOptions): Frame;
|
|
201
210
|
|
|
211
|
+
/** The default boundary/region element tag and its id attribute — the DOM
|
|
212
|
+
* contract the producer emits at t=0 and the consumer creates/adopts. */
|
|
213
|
+
export const FRAME_TAG: "dx-frame";
|
|
214
|
+
export const FRAME_ID_ATTR: "data-fid";
|
|
215
|
+
|
|
202
216
|
/**
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
* cleanup).
|
|
217
|
+
* Create a boundary/region ELEMENT and bind a host-registered frame to it.
|
|
218
|
+
* The frame mounts INTO the element (server content is its children, morphed
|
|
219
|
+
* in place). Because the boundary is a real node, `insert` places the
|
|
220
|
+
* returned `element` in any position — single, array, or fragment — with no
|
|
221
|
+
* special-casing. One frame per element; lifecycle belongs to the creator via
|
|
222
|
+
* `dispose()` (register it with your owner's cleanup).
|
|
209
223
|
*/
|
|
210
|
-
export function
|
|
211
|
-
readonly
|
|
224
|
+
export function createFrameElement(options: FrameOptions): {
|
|
225
|
+
readonly element: Element;
|
|
226
|
+
readonly frame: Frame;
|
|
212
227
|
dispose(): void;
|
|
213
228
|
};
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Binds a frame to an EXISTING marker range — the document-SSR adoption
|
|
217
|
-
* path: the page already holds the server-rendered boundary between
|
|
218
|
-
* `frame:<id>:start`/`:end` comments; the frame constructed over it treats
|
|
219
|
-
* that content as its own (first stream morphs rather than materializes)
|
|
220
|
-
* and slots sync immediately, claiming their server-rendered DOM.
|
|
221
|
-
*/
|
|
222
|
-
export function adoptFrameRange(start: Comment, end: Comment, options?: FrameOptions): Frame;
|
package/types/frames/server.d.ts
CHANGED
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* @solidjs/web/frames — server half. Render server components (functions
|
|
3
|
-
* returned from server functions) to frame-chunk streams, serve them as
|
|
4
|
-
* framed HTTP responses through the server-function handler's
|
|
5
|
-
* transformResult hook, and render them inline during document SSR.
|
|
6
|
-
*
|
|
7
|
-
* Copied next to the runtime's frame d.ts files at publish (see
|
|
8
|
-
* types:copy-frames), so the relative imports below resolve in-place.
|
|
9
|
-
*/
|
|
10
|
-
export {
|
|
11
|
-
renderToFrameStream,
|
|
12
|
-
renderServerComponent,
|
|
13
|
-
serverComponentResponse,
|
|
14
|
-
frameTransformResult,
|
|
15
|
-
createFrameSink,
|
|
16
|
-
frameTransformDirectResult,
|
|
17
|
-
ServerComponentPlugin,
|
|
18
|
-
SERVER_COMPONENT_BOOTSTRAP
|
|
19
|
-
} from "./frame-sink.js";
|
|
20
|
-
export type { FrameAddress, FrameStream, FrameStreamOptions } from "./frame-sink.js";
|
|
1
|
+
export { renderToFrameStream, renderServerComponent, serverComponentResponse, frameTransformResult, createFrameSink, frameTransformDirectResult, ServerComponentPlugin, SERVER_COMPONENT_BOOTSTRAP } from "./frame-sink.js";
|
|
21
2
|
export { FRAME_STREAM_HEADER, isFrameStreamResponse } from "./frame-transport.js";
|
|
@@ -1,53 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* boundaries. There is deliberately no server-component API here beyond
|
|
4
|
-
* `installServerComponents()`: `dynamic` + server functions IS the client
|
|
5
|
-
* surface — a server-function call whose response is a frame stream
|
|
6
|
-
* resolves with a stable per-call-site component.
|
|
7
|
-
*
|
|
8
|
-
* Copied next to the runtime's frame d.ts files at publish (see
|
|
9
|
-
* types:copy-frames), so the relative imports below resolve in-place.
|
|
10
|
-
*/
|
|
11
|
-
export {
|
|
12
|
-
createFrame,
|
|
13
|
-
createFrameHost,
|
|
14
|
-
createFrameInsertable,
|
|
15
|
-
FRAME_APPLIED_EVENT
|
|
16
|
-
} from "./frame-client.cjs";
|
|
17
|
-
export type {
|
|
18
|
-
Frame,
|
|
19
|
-
FrameChunk,
|
|
20
|
-
FrameHost,
|
|
21
|
-
FrameHostOptions,
|
|
22
|
-
FrameOptions,
|
|
23
|
-
FrameWrite,
|
|
24
|
-
Slot,
|
|
25
|
-
SlotContext
|
|
26
|
-
} from "./frame-client.cjs";
|
|
27
|
-
export {
|
|
28
|
-
FRAME_STREAM_HEADER,
|
|
29
|
-
applyFrameResponse,
|
|
30
|
-
isFrameStreamResponse,
|
|
31
|
-
createServerComponentHandler
|
|
32
|
-
} from "./frame-transport.cjs";
|
|
1
|
+
export { createFrame, createFrameHost, createFrameElement, FRAME_APPLIED_EVENT } from "./frame-client.cjs";
|
|
2
|
+
export { FRAME_STREAM_HEADER, applyFrameResponse, isFrameStreamResponse, createServerComponentHandler } from "./frame-transport.cjs";
|
|
33
3
|
export { createJSONDataTable } from "./serializer.cjs";
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
import type { FrameHost } from "./frame-client.cjs";
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* The app-wide frame host (created on first use): one chunk router, with
|
|
40
|
-
* codec data tables rotated per response — deserializer cross-reference
|
|
41
|
-
* space is stream-scoped by contract.
|
|
42
|
-
*/
|
|
43
|
-
export function getFrameHost(): FrameHost;
|
|
44
|
-
|
|
4
|
+
export declare function getFrameHost(): any;
|
|
45
5
|
/**
|
|
46
6
|
* Installs the server-component transport policy on the server-function
|
|
47
|
-
* client: boundary identity derives from the reactive owner captured at
|
|
48
|
-
* call site,
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
7
|
+
* client: boundary identity derives from the reactive owner captured at
|
|
8
|
+
* each call site (`getOwner`), so distinct `dynamic()` sources get
|
|
9
|
+
* independent boundaries with nothing declared, refetches from the same
|
|
10
|
+
* source resolve to the identical component, and ownerless calls fall back
|
|
11
|
+
* to one boundary per function id.
|
|
12
|
+
*
|
|
13
|
+
* Call once in the client entry (an explicit call — the package is
|
|
14
|
+
* `sideEffects: false`, so a bare import would be tree-shaken away);
|
|
15
|
+
* call again to rebind to a custom host.
|
|
52
16
|
*/
|
|
53
|
-
export function installServerComponents(host?:
|
|
17
|
+
export declare function installServerComponents(host?: any): void;
|
|
@@ -41,15 +41,6 @@ export type FrameChunk =
|
|
|
41
41
|
inlineStyles?: { id: string; content?: string; attrs?: Record<string, string> }[];
|
|
42
42
|
}
|
|
43
43
|
| { type: "slot"; id: string; version: number; key: string; args: Record<string, unknown> }
|
|
44
|
-
| { type: "template"; id: string; version: number; key: string; html: string; fields: string[] }
|
|
45
|
-
| {
|
|
46
|
-
type: "block";
|
|
47
|
-
id: string;
|
|
48
|
-
version: number;
|
|
49
|
-
key: string;
|
|
50
|
-
template: string;
|
|
51
|
-
values: unknown[];
|
|
52
|
-
}
|
|
53
44
|
| { type: "complete"; id: string; version: number }
|
|
54
45
|
| { type: "error"; id: string; version: number; key?: string; error: unknown };
|
|
55
46
|
|
|
@@ -170,7 +161,7 @@ export interface FrameHostOptions {
|
|
|
170
161
|
|
|
171
162
|
export function createFrameHost(options?: FrameHostOptions): FrameHost;
|
|
172
163
|
|
|
173
|
-
/** Options for `createFrame` / `
|
|
164
|
+
/** Options for `createFrame` / `createFrameElement`. */
|
|
174
165
|
export interface FrameOptions {
|
|
175
166
|
/** Register with this host under `id`, receiving routed/buffered chunks. */
|
|
176
167
|
host?: FrameHost;
|
|
@@ -194,29 +185,44 @@ export interface FrameOptions {
|
|
|
194
185
|
* streamed chunks).
|
|
195
186
|
*/
|
|
196
187
|
ownerScope?<T>(fn: () => T): T;
|
|
188
|
+
/**
|
|
189
|
+
* Boundary-driven segment reveal. When present, `#revealSegment` hands the
|
|
190
|
+
* placeholder seam to this hook instead of swapping imperatively: the binding
|
|
191
|
+
* reconstructs a client `<Loading>` there — `fallback` is the placeholder's
|
|
192
|
+
* own template content (shown while holding), `content()` materializes the
|
|
193
|
+
* segment and renders its client fills INSIDE the boundary so their readiness
|
|
194
|
+
* gates the reveal — and inserts it before `before`. An unboundaried async
|
|
195
|
+
* fill suspends up to that boundary and is covered instead of orphaned; one
|
|
196
|
+
* boundary per revealed segment, i.e. per author-placed `<Loading>`. Omit it
|
|
197
|
+
* for the framework-agnostic imperative swap (no reactive reveal).
|
|
198
|
+
*/
|
|
199
|
+
reveal?(seam: { before: Node; fallback: Node[]; content: () => Node | DocumentFragment }): void;
|
|
197
200
|
}
|
|
198
201
|
|
|
199
|
-
/**
|
|
202
|
+
/**
|
|
203
|
+
* A frame rendering into an EXISTING element boundary. Pass `adopt: true` for
|
|
204
|
+
* the document-SSR path: the element already holds server-rendered content,
|
|
205
|
+
* so the first apply morphs against it and slots sync immediately (hydration
|
|
206
|
+
* attach), claiming their server-rendered DOM — a document boot needs no
|
|
207
|
+
* chunk.
|
|
208
|
+
*/
|
|
200
209
|
export function createFrame(boundary: Element, options?: FrameOptions): Frame;
|
|
201
210
|
|
|
211
|
+
/** The default boundary/region element tag and its id attribute — the DOM
|
|
212
|
+
* contract the producer emits at t=0 and the consumer creates/adopts. */
|
|
213
|
+
export const FRAME_TAG: "dx-frame";
|
|
214
|
+
export const FRAME_ID_ATTR: "data-fid";
|
|
215
|
+
|
|
202
216
|
/**
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
* cleanup).
|
|
217
|
+
* Create a boundary/region ELEMENT and bind a host-registered frame to it.
|
|
218
|
+
* The frame mounts INTO the element (server content is its children, morphed
|
|
219
|
+
* in place). Because the boundary is a real node, `insert` places the
|
|
220
|
+
* returned `element` in any position — single, array, or fragment — with no
|
|
221
|
+
* special-casing. One frame per element; lifecycle belongs to the creator via
|
|
222
|
+
* `dispose()` (register it with your owner's cleanup).
|
|
209
223
|
*/
|
|
210
|
-
export function
|
|
211
|
-
readonly
|
|
224
|
+
export function createFrameElement(options: FrameOptions): {
|
|
225
|
+
readonly element: Element;
|
|
226
|
+
readonly frame: Frame;
|
|
212
227
|
dispose(): void;
|
|
213
228
|
};
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Binds a frame to an EXISTING marker range — the document-SSR adoption
|
|
217
|
-
* path: the page already holds the server-rendered boundary between
|
|
218
|
-
* `frame:<id>:start`/`:end` comments; the frame constructed over it treats
|
|
219
|
-
* that content as its own (first stream morphs rather than materializes)
|
|
220
|
-
* and slots sync immediately, claiming their server-rendered DOM.
|
|
221
|
-
*/
|
|
222
|
-
export function adoptFrameRange(start: Comment, end: Comment, options?: FrameOptions): Frame;
|
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* @solidjs/web/frames — server half. Render server components (functions
|
|
3
|
-
* returned from server functions) to frame-chunk streams, serve them as
|
|
4
|
-
* framed HTTP responses through the server-function handler's
|
|
5
|
-
* transformResult hook, and render them inline during document SSR.
|
|
6
|
-
*
|
|
7
|
-
* Copied next to the runtime's frame d.ts files at publish (see
|
|
8
|
-
* types:copy-frames), so the relative imports below resolve in-place.
|
|
9
|
-
*/
|
|
10
|
-
export {
|
|
11
|
-
renderToFrameStream,
|
|
12
|
-
renderServerComponent,
|
|
13
|
-
serverComponentResponse,
|
|
14
|
-
frameTransformResult,
|
|
15
|
-
createFrameSink,
|
|
16
|
-
frameTransformDirectResult,
|
|
17
|
-
ServerComponentPlugin,
|
|
18
|
-
SERVER_COMPONENT_BOOTSTRAP
|
|
19
|
-
} from "./frame-sink.cjs";
|
|
20
|
-
export type { FrameAddress, FrameStream, FrameStreamOptions } from "./frame-sink.cjs";
|
|
1
|
+
export { renderToFrameStream, renderServerComponent, serverComponentResponse, frameTransformResult, createFrameSink, frameTransformDirectResult, ServerComponentPlugin, SERVER_COMPONENT_BOOTSTRAP } from "./frame-sink.cjs";
|
|
21
2
|
export { FRAME_STREAM_HEADER, isFrameStreamResponse } from "./frame-transport.cjs";
|