@solidjs/web 2.0.0-beta.25 → 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 +117 -209
- package/frames/dist/client.dev.cjs +1408 -0
- package/frames/dist/client.dev.js +1396 -0
- package/frames/dist/client.js +118 -210
- package/frames/dist/server.cjs +106 -78
- package/frames/dist/server.js +106 -78
- package/package.json +23 -3
- 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 +1 -1
- package/types/frames/frame-client.d.ts +34 -28
- package/types-cjs/frames/client.d.cts +1 -1
- package/types-cjs/frames/frame-client.d.cts +34 -28
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
export { createFrame, createFrameHost,
|
|
1
|
+
export { createFrame, createFrameHost, createFrameElement, FRAME_APPLIED_EVENT } from "./frame-client.js";
|
|
2
2
|
export { FRAME_STREAM_HEADER, applyFrameResponse, isFrameStreamResponse, createServerComponentHandler } from "./frame-transport.js";
|
|
3
3
|
export { createJSONDataTable } from "./serializer.js";
|
|
4
4
|
export declare function getFrameHost(): any;
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
export { createFrame, createFrameHost,
|
|
1
|
+
export { createFrame, createFrameHost, createFrameElement, FRAME_APPLIED_EVENT } from "./frame-client.cjs";
|
|
2
2
|
export { FRAME_STREAM_HEADER, applyFrameResponse, isFrameStreamResponse, createServerComponentHandler } from "./frame-transport.cjs";
|
|
3
3
|
export { createJSONDataTable } from "./serializer.cjs";
|
|
4
4
|
export declare function getFrameHost(): any;
|
|
@@ -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;
|