foldkit-ssr 0.4.0 → 0.6.0
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 +6 -0
- package/dist/{client-ASzkY6Sw.mjs → client-DVG9_3rL.mjs} +21 -4
- package/dist/client-DVG9_3rL.mjs.map +1 -0
- package/dist/{client-BDyZf200.d.mts → client-DkwAniQQ.d.mts} +195 -114
- package/dist/client-DkwAniQQ.d.mts.map +1 -0
- package/dist/client.d.mts +2 -2
- package/dist/client.mjs +1 -2
- package/dist/index.d.mts +176 -85
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +56 -24
- package/dist/index.mjs.map +1 -1
- package/dist/vite.d.mts +2 -2
- package/dist/vite.d.mts.map +1 -1
- package/package.json +17 -17
- package/dist/client-ASzkY6Sw.mjs.map +0 -1
- package/dist/client-BDyZf200.d.mts.map +0 -1
|
@@ -1,8 +1,61 @@
|
|
|
1
1
|
import { Layer, Option, Result, Schema, Stream } from "effect";
|
|
2
|
-
import { ActiveSurface, Metadata, WritableProjection } from "foldkit-surface";
|
|
2
|
+
import { ActiveSurface, Metadata, SurfaceSource, WritableProjection } from "foldkit-surface";
|
|
3
3
|
import { Attribute, Html, HtmlBuilder, KeyboardModifiers } from "foldkit/html";
|
|
4
4
|
import { Runtime } from "foldkit";
|
|
5
5
|
import { Ports } from "foldkit/port";
|
|
6
|
+
//#region src/listen.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* A binding as the envelope carries it: Foldkit's attribute (`OnSubmit`,
|
|
9
|
+
* `OnBlur`), whose tag says what its handler does beside dispatching; the
|
|
10
|
+
* Message, encoded through the application's Message Schema (for a hole, with
|
|
11
|
+
* the hole filled by a placeholder); the fields the event fills, `depth`
|
|
12
|
+
* placement wrappers down; and the attribute's options. Its ordinal is its
|
|
13
|
+
* index.
|
|
14
|
+
*/
|
|
15
|
+
interface EncodedBinding {
|
|
16
|
+
readonly attribute: string;
|
|
17
|
+
readonly message: unknown;
|
|
18
|
+
readonly hole?: ReadonlyArray<string>;
|
|
19
|
+
readonly depth?: number;
|
|
20
|
+
readonly options?: unknown;
|
|
21
|
+
}
|
|
22
|
+
/** A binding decoded from the page: its Message is one of the application's. */
|
|
23
|
+
interface DecodedBinding {
|
|
24
|
+
readonly attribute: string;
|
|
25
|
+
readonly event: string;
|
|
26
|
+
readonly message: unknown;
|
|
27
|
+
readonly hole?: ReadonlyArray<string> | undefined;
|
|
28
|
+
readonly depth?: number | undefined;
|
|
29
|
+
readonly options?: unknown;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* What the markers make of one event: the Messages its bindings dispatch, in
|
|
33
|
+
* the order the live page would, and, when the walk met a handler the page
|
|
34
|
+
* could not name, that element. An answer with `unnamed` is incomplete: the
|
|
35
|
+
* live page would do more than its Messages say.
|
|
36
|
+
*/
|
|
37
|
+
interface Answer {
|
|
38
|
+
readonly event: Event;
|
|
39
|
+
readonly messages: ReadonlyArray<unknown>;
|
|
40
|
+
readonly unnamed?: Element | undefined;
|
|
41
|
+
}
|
|
42
|
+
interface ListenOptions {
|
|
43
|
+
readonly bindings: ReadonlyArray<DecodedBinding>;
|
|
44
|
+
readonly onAnswer: (answer: Answer) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Every event the page's markers name, as the envelope lists them. Given,
|
|
47
|
+
* `listen` needs no pass over the page to find the events a marker names
|
|
48
|
+
* with `*` alone; without it, it reads every element's attributes, which on
|
|
49
|
+
* a large page is most of its cost.
|
|
50
|
+
*/
|
|
51
|
+
readonly events?: Iterable<string> | undefined;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Listens at `root` for every event the bindings name, and answers each from
|
|
55
|
+
* the markers. Returns what removes the listeners.
|
|
56
|
+
*/
|
|
57
|
+
declare const listen: (root: Element, options: ListenOptions) => (() => void);
|
|
58
|
+
//#endregion
|
|
6
59
|
//#region src/resumable.d.ts
|
|
7
60
|
/** The attribute prefix of an element's binding marker. */
|
|
8
61
|
declare const BINDING_ATTRIBUTE = "data-foldkit-plus-on-";
|
|
@@ -65,6 +118,17 @@ type ResumableBuilder<Message> = Omit<HtmlBuilder<Message>, 'OnInput' | 'OnChang
|
|
|
65
118
|
readonly OnKeyDown: KeyHole<Message>;
|
|
66
119
|
readonly OnKeyUp: KeyHole<Message>;
|
|
67
120
|
};
|
|
121
|
+
/**
|
|
122
|
+
* The resumable builder for a view's `h`. Use it in place of `h`; it has the
|
|
123
|
+
* same elements and attributes, and the hole forms of the four value events.
|
|
124
|
+
*/
|
|
125
|
+
declare const builder: <Builder extends AnyBuilder>(h: Builder) => ResumableBuilder<MessageOf<Builder>>;
|
|
126
|
+
/**
|
|
127
|
+
* A view or renderer written against the resumable builder, as one that takes
|
|
128
|
+
* the builder it is given: `Surface.rootView(Page, params, Resume.view(render))`,
|
|
129
|
+
* `SurfaceView.define`, or an application's own view.
|
|
130
|
+
*/
|
|
131
|
+
declare const view: <Model, Builder extends AnyBuilder, Out>(render: (model: Model, rh: ResumableBuilder<MessageOf<Builder>>) => Out) => (model: Model, h: Builder) => Out;
|
|
68
132
|
//#endregion
|
|
69
133
|
//#region src/context.d.ts
|
|
70
134
|
type Region = ReadonlyArray<Html | string>;
|
|
@@ -74,54 +138,6 @@ interface UnnamedHandler {
|
|
|
74
138
|
readonly event: string;
|
|
75
139
|
}
|
|
76
140
|
//#endregion
|
|
77
|
-
//#region src/listen.d.ts
|
|
78
|
-
/**
|
|
79
|
-
* A binding as the envelope carries it: Foldkit's attribute (`OnSubmit`,
|
|
80
|
-
* `OnBlur`), whose tag says what its handler does beside dispatching; the
|
|
81
|
-
* Message, encoded through the application's Message Schema (for a hole, with
|
|
82
|
-
* the hole filled by a placeholder); the fields the event fills, `depth`
|
|
83
|
-
* placement wrappers down; and the attribute's options. Its ordinal is its
|
|
84
|
-
* index.
|
|
85
|
-
*/
|
|
86
|
-
interface EncodedBinding {
|
|
87
|
-
readonly attribute: string;
|
|
88
|
-
readonly message: unknown;
|
|
89
|
-
readonly hole?: ReadonlyArray<string>;
|
|
90
|
-
readonly depth?: number;
|
|
91
|
-
readonly options?: unknown;
|
|
92
|
-
}
|
|
93
|
-
/** A binding decoded from the page: its Message is one of the application's. */
|
|
94
|
-
interface DecodedBinding {
|
|
95
|
-
readonly attribute: string;
|
|
96
|
-
readonly event: string;
|
|
97
|
-
readonly message: unknown;
|
|
98
|
-
readonly hole?: ReadonlyArray<string> | undefined;
|
|
99
|
-
readonly depth?: number | undefined;
|
|
100
|
-
readonly options?: unknown;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* What the markers make of one event: the Messages its bindings dispatch, in
|
|
104
|
-
* the order the live page would, and, when the walk met a handler the page
|
|
105
|
-
* could not name, that element. An answer with `unnamed` is incomplete: the
|
|
106
|
-
* live page would do more than its Messages say.
|
|
107
|
-
*/
|
|
108
|
-
interface Answer {
|
|
109
|
-
readonly event: Event;
|
|
110
|
-
readonly messages: ReadonlyArray<unknown>;
|
|
111
|
-
readonly unnamed?: Element | undefined;
|
|
112
|
-
}
|
|
113
|
-
interface ListenOptions {
|
|
114
|
-
readonly bindings: ReadonlyArray<DecodedBinding>;
|
|
115
|
-
readonly onAnswer: (answer: Answer) => void;
|
|
116
|
-
/**
|
|
117
|
-
* Every event the page's markers name, as the envelope lists them. Given,
|
|
118
|
-
* `listen` needs no pass over the page to find the events a marker names
|
|
119
|
-
* with `*` alone; without it, it reads every element's attributes, which on
|
|
120
|
-
* a large page is most of its cost.
|
|
121
|
-
*/
|
|
122
|
-
readonly events?: Iterable<string> | undefined;
|
|
123
|
-
}
|
|
124
|
-
//#endregion
|
|
125
141
|
//#region src/shared.d.ts
|
|
126
142
|
/**
|
|
127
143
|
* The attribute Foldkit's server stamps on an application's root, as
|
|
@@ -135,6 +151,12 @@ declare const FOLDKIT_APP_ATTRIBUTE = "data-foldkit-app";
|
|
|
135
151
|
* beside the app stamp, and the client reads it before adopting anything.
|
|
136
152
|
*/
|
|
137
153
|
declare const RESUME_ATTRIBUTE = "data-foldkit-plus-resume";
|
|
154
|
+
/**
|
|
155
|
+
* JSON for a script element: `<` is escaped so `</script>` in the data ends
|
|
156
|
+
* nothing. U+2028 and U+2029 are escaped too: they are fine in JSON and break a
|
|
157
|
+
* reader that treats the text as JavaScript.
|
|
158
|
+
*/
|
|
159
|
+
declare const serializeJsonScript: (value: unknown) => string;
|
|
138
160
|
/**
|
|
139
161
|
* What a page says of itself beyond Foldkit's `Document` (`title`, `lang`,
|
|
140
162
|
* `dir`, `canonical`, `ogUrl`): what a search result and a link preview show.
|
|
@@ -163,6 +185,8 @@ interface Meta {
|
|
|
163
185
|
declare const META_ATTRIBUTE = "data-foldkit-meta";
|
|
164
186
|
/** The head markup of a `Meta`, every value escaped, one element per line. */
|
|
165
187
|
declare const metaMarkup: (meta: Meta) => string;
|
|
188
|
+
/** One entry of a resume plan's `surfaces`: a lone Surface, or a `Surface.each` family. */
|
|
189
|
+
type PlanSurface<Model> = ActiveSurface<Model> | SurfaceSource<Model>;
|
|
166
190
|
/**
|
|
167
191
|
* Which part of the Model the browser owns, and what it starts from.
|
|
168
192
|
*
|
|
@@ -179,7 +203,7 @@ interface ResumePlan<Model, Fields extends Schema.Struct.Fields, Commands = unkn
|
|
|
179
203
|
/** Model paths allowed to start from the baseline, as `ModelRef.dependency` gives them. */
|
|
180
204
|
readonly local: ReadonlyArray<ReadonlyArray<string>>;
|
|
181
205
|
/** The Surfaces the browser may activate, which the plan must cover. */
|
|
182
|
-
readonly surfaces: ReadonlyArray<
|
|
206
|
+
readonly surfaces: ReadonlyArray<PlanSurface<Model>>;
|
|
183
207
|
/** State another package owns, each captured and restored by that package. */
|
|
184
208
|
readonly parts: ReadonlyArray<ResumePart<Model>>;
|
|
185
209
|
/** The application's Message Schema, which encodes the page's bindings. */
|
|
@@ -242,6 +266,36 @@ declare const ResumeRefused_base: Schema.Class<ResumeRefused, Schema.TaggedStruc
|
|
|
242
266
|
}>, import("effect/Cause").YieldableError>;
|
|
243
267
|
/** Why a page's resume envelope was refused. */
|
|
244
268
|
declare class ResumeRefused extends ResumeRefused_base {}
|
|
269
|
+
/**
|
|
270
|
+
* A resume plan for an application. The baseline defaults to the
|
|
271
|
+
* application's initial Model. It is never written: a writable projection's
|
|
272
|
+
* `set` returns a new Model, so a baseline Foldkit freezes in development is
|
|
273
|
+
* safe to start from.
|
|
274
|
+
*
|
|
275
|
+
* `surfaces` are the Surfaces the browser may activate, and `local` the Model
|
|
276
|
+
* fields allowed to start from the baseline, such as an open menu. Rendering
|
|
277
|
+
* refuses a plan that leaves a Surface's read or activation in neither.
|
|
278
|
+
*/
|
|
279
|
+
declare const plan: <Model, Fields extends Schema.Struct.Fields, Commands = unknown>(application: {
|
|
280
|
+
readonly initial: Model;
|
|
281
|
+
readonly owner?: object;
|
|
282
|
+
readonly Message?: Schema.Top | undefined;
|
|
283
|
+
}, config: {
|
|
284
|
+
readonly id: string;
|
|
285
|
+
readonly state: WritableProjection<Model, Fields>;
|
|
286
|
+
readonly baseline?: Model | undefined;
|
|
287
|
+
readonly boot?: ((model: Model) => Commands) | undefined;
|
|
288
|
+
readonly local?: ReadonlyArray<{
|
|
289
|
+
readonly dependency: ReadonlyArray<string>;
|
|
290
|
+
}> | undefined;
|
|
291
|
+
readonly surfaces?: ReadonlyArray<PlanSurface<Model>> | undefined;
|
|
292
|
+
readonly parts?: ReadonlyArray<ResumePart<Model>> | undefined;
|
|
293
|
+
readonly start?: Start | undefined;
|
|
294
|
+
readonly deferrable?: ReadonlyArray<string> | undefined;
|
|
295
|
+
readonly fallback?: 'server' | undefined;
|
|
296
|
+
readonly meta?: ((model: Model) => Meta) | undefined;
|
|
297
|
+
readonly version?: unknown | undefined;
|
|
298
|
+
}) => ResumePlan<Model, Fields, Commands>;
|
|
245
299
|
/**
|
|
246
300
|
* How a page's recorded route is compared with the browser's. `full` compares
|
|
247
301
|
* path and query. `path` compares the path alone, ignoring a trailing slash or
|
|
@@ -249,8 +303,36 @@ declare class ResumeRefused extends ResumeRefused_base {}
|
|
|
249
303
|
* for every query, and for `/about` and `/about/` alike.
|
|
250
304
|
*/
|
|
251
305
|
type RouteMatch = 'full' | 'path';
|
|
306
|
+
/**
|
|
307
|
+
* The Model a page resumes from: the baseline with the stamped root's envelope
|
|
308
|
+
* set onto it. Refused, with the reason, when the page holds no stamped root
|
|
309
|
+
* or more than one, when the root carries no envelope or not JSON, when it is
|
|
310
|
+
* not this protocol or this plan, or when the slice does not decode through
|
|
311
|
+
* the plan's Schema. A page is never half-restored.
|
|
312
|
+
*/
|
|
313
|
+
declare const resume: <Model, Fields extends Schema.Struct.Fields>(plan: ResumePlan<Model, Fields>, page: ParentNode, options?: {
|
|
314
|
+
readonly route?: string | undefined;
|
|
315
|
+
}) => Result.Result<Model, ResumeRefused>;
|
|
252
316
|
/** The attribute on a static region's element, naming the region. */
|
|
253
317
|
declare const STATIC_ATTRIBUTE = "data-foldkit-plus-static";
|
|
318
|
+
/**
|
|
319
|
+
* A region of the page the server owns for the life of the document. It is
|
|
320
|
+
* rendered on the server with the inert builder, so it can dispatch no
|
|
321
|
+
* Message. The browser adopts the server's markup as trusted `InnerHTML` and
|
|
322
|
+
* never runs `render`, so the region reads nothing from the browser's Model
|
|
323
|
+
* and a plan need not send what it reads.
|
|
324
|
+
*
|
|
325
|
+
* A region changes only with a new document. Content a Message should change
|
|
326
|
+
* belongs in a Surface, not here.
|
|
327
|
+
*/
|
|
328
|
+
declare const staticRegion: (id: string, render: (ih: HtmlBuilder<never>) => Region) => Html;
|
|
329
|
+
/**
|
|
330
|
+
* Whether the view call in progress is the server rendering a page, rather than the browser: true
|
|
331
|
+
* through both of `render`'s passes, false while the browser resumes and outside any render. For a
|
|
332
|
+
* view that sends markup it will adopt in the browser rather than draw there, such as
|
|
333
|
+
* `foldkit-richtext-dom`'s editor host, whose placement takes this as `serverRendered`.
|
|
334
|
+
*/
|
|
335
|
+
declare const serving: () => boolean;
|
|
254
336
|
/**
|
|
255
337
|
* The `makeApplication` options `SSR` hands to Foldkit as they are, typed as
|
|
256
338
|
* Foldkit types them.
|
|
@@ -293,78 +375,77 @@ interface Loadable {
|
|
|
293
375
|
readonly load: () => Promise<void>;
|
|
294
376
|
readonly isLoaded: () => boolean;
|
|
295
377
|
}
|
|
378
|
+
/**
|
|
379
|
+
* The page's bindings, decoded through the plan's Message Schema, kept to the
|
|
380
|
+
* Messages the Surfaces active for `model` may send, and checked against
|
|
381
|
+
* every marker in `root`. Refused, with the reason, when the page carries
|
|
382
|
+
* none, an entry is not one of the application's Messages or one no active
|
|
383
|
+
* Surface lists, or a marker names a binding the page does not carry: a page
|
|
384
|
+
* is answered whole or not at all.
|
|
385
|
+
*/
|
|
386
|
+
declare const bindings: <Model, Fields extends Schema.Struct.Fields>(plan: ResumePlan<Model, Fields>, page: ParentNode, root: Element, model: Model) => Result.Result<ReadonlyArray<DecodedBinding>, ResumeRefused>;
|
|
296
387
|
//#endregion
|
|
297
388
|
//#region src/client.d.ts
|
|
389
|
+
/**
|
|
390
|
+
* Starts the browser from the page's resumed Model, without running `init`.
|
|
391
|
+
*
|
|
392
|
+
* In the order Foldkit checks a page: the build id first, before the payload
|
|
393
|
+
* is read, then the envelope and its route. A page from another build is
|
|
394
|
+
* refused by Foldkit itself. A page that cannot resume is refused and contained
|
|
395
|
+
* by Foldkit's own refusal, and the reason is logged. A server page is never
|
|
396
|
+
* rendered again on the client. A page with no server render at all, no
|
|
397
|
+
* stamped root, is rendered on the client as usual.
|
|
398
|
+
*/
|
|
399
|
+
declare const hydrate: <Model, Fields extends Schema.Struct.Fields, Message = any>(config: ResumableConfig<Model, Message>, plan: ResumePlan<Model, Fields>, options: {
|
|
400
|
+
readonly buildId: string;
|
|
401
|
+
/**
|
|
402
|
+
* Whether this page is taken over: asked before anything is adopted, so
|
|
403
|
+
* a page showing another reader's data never becomes live facts. Omitted
|
|
404
|
+
* adopts as before. Must not throw: a throwing predicate propagates out
|
|
405
|
+
* of `hydrate` with no runtime booted and nothing contained.
|
|
406
|
+
*/
|
|
407
|
+
readonly when?: ((page: Document) => boolean) | undefined;
|
|
408
|
+
/**
|
|
409
|
+
* What a declined or stale page does: `render` runs the application
|
|
410
|
+
* afresh where the rendered page is, replacing its markup in place (the
|
|
411
|
+
* config's container with no served page). Omitted contains the page the
|
|
412
|
+
* way a resume failure does.
|
|
413
|
+
*/
|
|
414
|
+
readonly otherwise?: 'render' | undefined;
|
|
415
|
+
/**
|
|
416
|
+
* With `otherwise: 'render'`, when the fresh application is ready to be
|
|
417
|
+
* seen: until a Model it has drawn satisfies this, it draws out of view
|
|
418
|
+
* and the served page stays, so a page is not swapped for its loading
|
|
419
|
+
* state and back. Omitted, the fresh application replaces the page at
|
|
420
|
+
* once. The served page stays no longer than `UNTIL_LIMIT_MS`.
|
|
421
|
+
*/
|
|
422
|
+
readonly until?: ((model: Model) => boolean) | undefined;
|
|
423
|
+
/**
|
|
424
|
+
* Whether the plan's data version is still current: asked once, with
|
|
425
|
+
* `plan.version`, before anything is adopted. Omitted never asks. A plan
|
|
426
|
+
* with no version still asks, with `undefined` (a check shaped like
|
|
427
|
+
* `version === expected` then marks every such page stale). Must not
|
|
428
|
+
* throw, as `when`.
|
|
429
|
+
*/
|
|
430
|
+
readonly fresh?: ((version: unknown) => boolean) | undefined;
|
|
431
|
+
}) => void;
|
|
298
432
|
/** The longest a served page stays in view while a fresh application waits for `until`. */
|
|
299
433
|
declare const UNTIL_LIMIT_MS = 3000;
|
|
300
434
|
/** The resumable track: bindings the server's markup names, so a page can answer before it boots. */
|
|
301
435
|
declare const Resume: {
|
|
302
|
-
builder:
|
|
303
|
-
view:
|
|
304
|
-
bindings:
|
|
305
|
-
listen:
|
|
436
|
+
builder: typeof builder;
|
|
437
|
+
view: typeof view;
|
|
438
|
+
bindings: typeof bindings;
|
|
439
|
+
listen: typeof listen;
|
|
306
440
|
};
|
|
307
441
|
/** The browser's part of `SSR`: the same functions, without the server's. */
|
|
308
442
|
declare const SSR: {
|
|
309
|
-
plan:
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
readonly id: string;
|
|
315
|
-
readonly state: import("foldkit-surface").WritableProjection<Model, Fields>;
|
|
316
|
-
readonly baseline?: Model | undefined;
|
|
317
|
-
readonly boot?: ((model: Model) => Commands) | undefined;
|
|
318
|
-
readonly local?: ReadonlyArray<{
|
|
319
|
-
readonly dependency: ReadonlyArray<string>;
|
|
320
|
-
}> | undefined;
|
|
321
|
-
readonly surfaces?: ReadonlyArray<import("foldkit-surface").ActiveSurface<Model>> | undefined;
|
|
322
|
-
readonly parts?: ReadonlyArray<ResumePart<Model>> | undefined;
|
|
323
|
-
readonly start?: Start | undefined;
|
|
324
|
-
readonly deferrable?: ReadonlyArray<string> | undefined;
|
|
325
|
-
readonly fallback?: "server" | undefined;
|
|
326
|
-
readonly meta?: ((model: Model) => Meta) | undefined;
|
|
327
|
-
readonly version?: unknown | undefined;
|
|
328
|
-
}) => ResumePlan<Model, Fields, Commands>;
|
|
329
|
-
resume: <Model, Fields extends Schema.Struct.Fields>(plan: ResumePlan<Model, Fields>, page: ParentNode, options?: {
|
|
330
|
-
readonly route?: string | undefined;
|
|
331
|
-
}) => Result.Result<Model, ResumeRefused>;
|
|
332
|
-
hydrate: <Model, Fields extends Schema.Struct.Fields, Message = any>(config: ResumableConfig<Model, Message>, plan: ResumePlan<Model, Fields>, options: {
|
|
333
|
-
readonly buildId: string;
|
|
334
|
-
/**
|
|
335
|
-
* Whether this page is taken over: asked before anything is adopted, so
|
|
336
|
-
* a page showing another reader's data never becomes live facts. Omitted
|
|
337
|
-
* adopts as before. Must not throw: a throwing predicate propagates out
|
|
338
|
-
* of `hydrate` with no runtime booted and nothing contained.
|
|
339
|
-
*/
|
|
340
|
-
readonly when?: ((page: Document) => boolean) | undefined;
|
|
341
|
-
/**
|
|
342
|
-
* What a declined or stale page does: `render` runs the application
|
|
343
|
-
* afresh where the rendered page is, replacing its markup in place (the
|
|
344
|
-
* config's container with no served page). Omitted contains the page the
|
|
345
|
-
* way a resume failure does.
|
|
346
|
-
*/
|
|
347
|
-
readonly otherwise?: "render" | undefined;
|
|
348
|
-
/**
|
|
349
|
-
* With `otherwise: 'render'`, when the fresh application is ready to be
|
|
350
|
-
* seen: until a Model it has drawn satisfies this, it draws out of view
|
|
351
|
-
* and the served page stays, so a page is not swapped for its loading
|
|
352
|
-
* state and back. Omitted, the fresh application replaces the page at
|
|
353
|
-
* once. The served page stays no longer than `UNTIL_LIMIT_MS`.
|
|
354
|
-
*/
|
|
355
|
-
readonly until?: ((model: Model) => boolean) | undefined;
|
|
356
|
-
/**
|
|
357
|
-
* Whether the plan's data version is still current: asked once, with
|
|
358
|
-
* `plan.version`, before anything is adopted. Omitted never asks. A plan
|
|
359
|
-
* with no version still asks, with `undefined` (a check shaped like
|
|
360
|
-
* `version === expected` then marks every such page stale). Must not
|
|
361
|
-
* throw, as `when`.
|
|
362
|
-
*/
|
|
363
|
-
readonly fresh?: ((version: unknown) => boolean) | undefined;
|
|
364
|
-
}) => void;
|
|
365
|
-
static: (id: string, render: (ih: import("foldkit/html").HtmlBuilder<never>) => Region) => import("foldkit/html").Html;
|
|
366
|
-
serving: () => boolean;
|
|
443
|
+
plan: typeof plan;
|
|
444
|
+
resume: typeof resume;
|
|
445
|
+
hydrate: typeof hydrate;
|
|
446
|
+
static: typeof staticRegion;
|
|
447
|
+
serving: typeof serving;
|
|
367
448
|
};
|
|
368
449
|
//#endregion
|
|
369
|
-
export {
|
|
370
|
-
//# sourceMappingURL=client-
|
|
450
|
+
export { UnnamedHandler as C, SLOT_ATTRIBUTE as D, ResumableBuilder as E, DecodedBinding as O, staticRegion as S, FALLBACK_FIELD as T, metaMarkup as _, Loadable as a, serializeJsonScript as b, PlanSurface as c, ResumePart as d, ResumePlan as f, Start as g, STATIC_ATTRIBUTE as h, FOLDKIT_APP_ATTRIBUTE as i, EncodedBinding as k, RESUME_ATTRIBUTE as l, RouteMatch as m, SSR as n, META_ATTRIBUTE as o, ResumeRefused as p, UNTIL_LIMIT_MS as r, Meta as s, Resume as t, ResumableConfig as u, plan as v, BINDING_ATTRIBUTE as w, serving as x, resume as y };
|
|
451
|
+
//# sourceMappingURL=client-DkwAniQQ.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-DkwAniQQ.d.mts","names":[],"sources":["../src/listen.ts","../src/resumable.ts","../src/context.ts","../src/shared.ts","../src/client.ts"],"mappings":";;;;;;;;;;;;;;UA0BiB;WACN;WACA;WACA,OAAO;WACP;WACA;;;UA8CM;WACN;WACA;WACA;WACA,OAAO;WACP;WACA;;;;;;;;UAkIM;WACN,OAAO;WACP,UAAU;WACV,UAAU;;UAGJ;WACN,UAAU,cAAc;WACxB,WAAW,QAAQ;;;;;;;WAOnB,SAAS;;;;;;cAOP,SAAM,MAAU,SAAO,SAAW;;;;cCvNlC;;cA4GA;;cAMA;cAEC;;UAGG,QAAQ;YACb,UAAU;;KAGjB,QAAQ,GAAG,IAAI,KAAK,sBAAsB,YAAY;;KAGtD,kBAAkB,OAAO;WAAiB,QAAQ,OAAO,OAAO;;;KAGhE,KAAK,KAAK;WAAqB,YAAY;IAAM;;KAGjD,QAAQ,KAAK,QAAQ,KAAK,KAAK;;KAG/B,KAAK,GAAG,SAAS,KAAK,KAAK,mBAAmB;KAE9C,gBAAgB,GAAG,YAAY,KAAK,aAAa,qBAElD;KAEC,cAAc,GAAG,gBAAgB,KAAK,GAAG,0BAC1C,6EACa,cAAc,KAAK,GAAG,UACjC,yFACA,KAAK,GAAG,aAAa,KAAK,GAAG,wCACZ,KAAK,GAAG,aAAa,KAAK,GAAG,oBAE1C,wDACF;KAEH,aAAa,GAAG,gBAAgB,KAAK,GAAG,6EACJ,KAAK,GAAG,oBAE3C,mFACF;;UAGa,SAAS;GACvB,YAAY,kBAAkB,UAAU,UAAU;GAClD,UAAU,uBAAuB,cAAc,QAAQ,SACtD,QAAQ,IAAI,gBAAgB,GAAG,WAAW,cAAc,GAAG,QAC3D,QAAQ,QACP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AAe,OAAO,OAAO,QAAQ,eAAa,QAChE,gBAAgB,OAAO,UAAQ,MACjC,WAAW,OAAO,SAAO;WAEpB;;;;;;;WAOA,SAAS,MAAM;;;;;;;WAOf;;;;;;;;WAQA,UAAU,OAAO;;;;;;;;WAQjB,UAAU;;;cAgGV;;cA8JA;;;;;;;cAGA"}
|
package/dist/client.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
export { BINDING_ATTRIBUTE, type DecodedBinding, FALLBACK_FIELD, FOLDKIT_APP_ATTRIBUTE, type Loadable, META_ATTRIBUTE, type Meta, RESUME_ATTRIBUTE, type ResumableBuilder, type ResumableConfig, Resume, type ResumePart, type ResumePlan, ResumeRefused, SLOT_ATTRIBUTE, SSR, STATIC_ATTRIBUTE, type Start, UNTIL_LIMIT_MS, type UnnamedHandler, metaMarkup };
|
|
1
|
+
import { C as UnnamedHandler, D as SLOT_ATTRIBUTE, E as ResumableBuilder, O as DecodedBinding, T as FALLBACK_FIELD, _ as metaMarkup, a as Loadable, c as PlanSurface, d as ResumePart, f as ResumePlan, g as Start, h as STATIC_ATTRIBUTE, i as FOLDKIT_APP_ATTRIBUTE, l as RESUME_ATTRIBUTE, n as SSR, o as META_ATTRIBUTE, p as ResumeRefused, r as UNTIL_LIMIT_MS, s as Meta, t as Resume, u as ResumableConfig, w as BINDING_ATTRIBUTE } from "./client-DkwAniQQ.mjs";
|
|
2
|
+
export { BINDING_ATTRIBUTE, type DecodedBinding, FALLBACK_FIELD, FOLDKIT_APP_ATTRIBUTE, type Loadable, META_ATTRIBUTE, type Meta, type PlanSurface, RESUME_ATTRIBUTE, type ResumableBuilder, type ResumableConfig, Resume, type ResumePart, type ResumePlan, ResumeRefused, SLOT_ATTRIBUTE, SSR, STATIC_ATTRIBUTE, type Start, UNTIL_LIMIT_MS, type UnnamedHandler, metaMarkup };
|
package/dist/client.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { BINDING_ATTRIBUTE, FALLBACK_FIELD, FOLDKIT_APP_ATTRIBUTE, META_ATTRIBUTE, RESUME_ATTRIBUTE, Resume, ResumeRefused, SLOT_ATTRIBUTE, SSR, STATIC_ATTRIBUTE, UNTIL_LIMIT_MS, metaMarkup };
|
|
1
|
+
export { w as BINDING_ATTRIBUTE, E as FALLBACK_FIELD, i as FOLDKIT_APP_ATTRIBUTE, a as META_ATTRIBUTE, o as RESUME_ATTRIBUTE, t as Resume, s as ResumeRefused, D as SLOT_ATTRIBUTE, n as SSR, c as STATIC_ATTRIBUTE, r as UNTIL_LIMIT_MS, f as metaMarkup } from "./client-DVG9_3rL.mjs";
|