@solidjs/web 2.0.0-rc.2 → 2.0.0-rc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/server.dev.js +5165 -0
- package/dist/server.js +1876 -374
- package/dist/{server.cjs → server.observe.js} +2070 -577
- package/dist/{dev.cjs → web.dev.js} +955 -567
- package/dist/web.js +646 -350
- package/dist/{dev.js → web.observe.js} +699 -421
- package/frames/dist/assets.js +92 -0
- package/frames/dist/client.dev.js +1296 -1198
- package/frames/dist/client.js +1128 -1191
- package/frames/dist/client.observe.js +2041 -0
- package/frames/dist/regions.js +171 -0
- package/frames/dist/server.dev.js +2545 -0
- package/frames/dist/server.js +1683 -3004
- package/frames/dist/server.observe.js +2544 -0
- package/frames/dist/trace.js +45 -0
- package/frames/dist/wire.js +594 -0
- package/frames/package.json +2 -25
- package/package.json +244 -256
- package/performance-tracks/dist/performance-tracks.dev.js +679 -0
- package/performance-tracks/dist/performance-tracks.js +6 -0
- package/performance-tracks/dist/performance-tracks.observe.js +667 -0
- package/performance-tracks/package.json +7 -0
- package/performance-tracks/types/index.d.ts +69 -0
- package/serialization/decode/package.json +2 -15
- package/serialization/dist/decode.js +121 -25
- package/serialization/dist/serialization.js +282 -88
- package/serialization/package.json +2 -15
- package/serialization/types/index.d.ts +115 -153
- package/serialization/types/serializer-decode.d.ts +173 -114
- package/serialization/types/serializer.d.ts +144 -0
- package/server-functions/dist/client.dev.js +1462 -0
- package/server-functions/dist/client.js +667 -165
- package/server-functions/dist/client.observe.js +1441 -0
- package/server-functions/dist/rich-args.js +102 -1
- package/server-functions/dist/server.dev.js +2802 -299
- package/server-functions/dist/server.js +2724 -314
- package/server-functions/dist/server.observe.js +3680 -0
- package/server-functions/package.json +2 -35
- package/server-functions/rich-args/package.json +2 -15
- package/skills/server-components/SKILL.md +117 -0
- package/storage/package.json +2 -15
- package/types/client.d.ts +342 -288
- package/types/constants.d.ts +22 -0
- package/types/cookies.d.ts +32 -84
- package/types/diagnostics.d.ts +80 -0
- package/types/frames/assets-tier.d.ts +78 -0
- package/types/frames/client.d.ts +40 -1
- package/types/frames/frame-client.d.ts +443 -280
- package/types/frames/frame-container-plugin.d.ts +64 -0
- package/types/frames/frame-morph.d.ts +29 -0
- package/types/frames/frame-sink.d.ts +141 -161
- package/types/frames/frame-transport.d.ts +263 -184
- package/types/frames/regions-tier.d.ts +60 -0
- package/types/frames/serializer-decode.d.ts +241 -0
- package/types/frames/serializer.d.ts +115 -153
- package/types/frames/server.d.ts +2 -2
- package/types/frames/trace-tier.d.ts +2 -0
- package/types/frames/tree-rewrite.d.ts +39 -0
- package/types/frames/wire-tier.d.ts +169 -0
- package/types/head.d.ts +20 -0
- package/types/index.d.ts +98 -81
- package/types/index.server.d.ts +159 -0
- package/types/jsx.d.ts +49 -44
- package/types/observe.d.ts +535 -0
- package/types/reconcile.d.ts +1 -0
- package/types/render.d.ts +11 -0
- package/types/request-error-hook.d.ts +5 -0
- package/types/response.d.ts +95 -147
- package/types/serializer-decode.d.ts +173 -114
- package/types/serializer.d.ts +115 -153
- package/types/server-functions/argument-codec.d.ts +30 -0
- package/types/server-functions/client.d.ts +237 -223
- package/types/server-functions/flash.d.ts +28 -30
- package/types/server-functions/registry.d.ts +105 -0
- package/types/server-functions/rich-args.d.ts +1 -10
- package/types/server-functions/server.d.ts +538 -531
- package/types/server-functions/shared.d.ts +398 -425
- package/types/server-functions/uploads.d.ts +53 -0
- package/types/server-mock.d.ts +154 -20
- package/types/server-observe.d.ts +86 -0
- package/types/server.d.ts +601 -422
- package/types/trace.d.ts +127 -0
- package/LICENSE +0 -21
- package/dist/web.cjs +0 -2033
- package/frames/dist/client.cjs +0 -2002
- package/frames/dist/client.dev.cjs +0 -2022
- package/frames/dist/server.cjs +0 -3877
- package/serialization/dist/decode.cjs +0 -139
- package/serialization/dist/serialization.cjs +0 -261
- package/serialization/types-cjs/index.d.cts +0 -182
- package/serialization/types-cjs/package.json +0 -3
- package/serialization/types-cjs/serializer-decode.d.cts +0 -182
- package/server-functions/dist/client.cjs +0 -834
- package/server-functions/dist/rich-args.cjs +0 -11
- package/server-functions/dist/server.cjs +0 -1242
- package/server-functions/dist/server.dev.cjs +0 -1242
- package/storage/dist/storage.cjs +0 -12
- package/storage/types-cjs/index.d.cts +0 -28
- package/storage/types-cjs/package.json +0 -3
- package/types/core.d.ts +0 -9
- package/types-cjs/client.d.cts +0 -337
- package/types-cjs/cookies.d.cts +0 -93
- package/types-cjs/core.d.cts +0 -9
- package/types-cjs/frames/client.d.cts +0 -36
- package/types-cjs/frames/frame-client.d.cts +0 -356
- package/types-cjs/frames/frame-sink.d.cts +0 -194
- package/types-cjs/frames/frame-transport.d.cts +0 -222
- package/types-cjs/frames/serializer.d.cts +0 -182
- package/types-cjs/frames/server.d.cts +0 -52
- package/types-cjs/index.d.cts +0 -244
- package/types-cjs/jsx-properties.d.cts +0 -93
- package/types-cjs/jsx.d.cts +0 -4159
- package/types-cjs/package.json +0 -3
- package/types-cjs/response.d.cts +0 -174
- package/types-cjs/serializer-decode.d.cts +0 -182
- package/types-cjs/serializer.d.cts +0 -182
- package/types-cjs/server-functions/client.d.cts +0 -262
- package/types-cjs/server-functions/flash.d.cts +0 -38
- package/types-cjs/server-functions/rich-args.d.cts +0 -10
- package/types-cjs/server-functions/server.d.cts +0 -681
- package/types-cjs/server-functions/shared.d.cts +0 -523
- package/types-cjs/server-mock.d.cts +0 -286
- package/types-cjs/server.d.cts +0 -544
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flags
|
|
3
|
+
*
|
|
4
|
+
* - 1 - Stateful property - value derives from reactive state
|
|
5
|
+
* - 2 - Locked to property - value not specially treated
|
|
6
|
+
*/
|
|
7
|
+
declare const DOMWithState: Record<string, Record<string, 1 | 2>>;
|
|
8
|
+
declare const ChildProperties: Set<string>;
|
|
9
|
+
declare const LinkAttributes: Set<string>;
|
|
10
|
+
declare const $$SLOT: unique symbol;
|
|
11
|
+
declare const $$HOST: unique symbol;
|
|
12
|
+
declare const DelegatedEvents: Set<string>;
|
|
13
|
+
declare const SVGElements: Set<string>;
|
|
14
|
+
declare const MathMLElements: Set<string>;
|
|
15
|
+
declare const Namespaces: Record<string, string>;
|
|
16
|
+
declare const VoidElements: Set<string>;
|
|
17
|
+
declare const RawTextElements: Set<string>;
|
|
18
|
+
declare const DOMElements: Set<string>;
|
|
19
|
+
declare const COMPOSED_BODY_FRAMING: ReadonlySet<string>;
|
|
20
|
+
declare function isHttpNavigationTarget(target: string): boolean;
|
|
21
|
+
declare function isEventName(name: string): boolean;
|
|
22
|
+
export { DOMWithState, ChildProperties, LinkAttributes, DelegatedEvents, SVGElements, MathMLElements, VoidElements, RawTextElements, Namespaces, DOMElements, $$SLOT, $$HOST, COMPOSED_BODY_FRAMING, isHttpNavigationTarget, isEventName };
|
package/types/cookies.d.ts
CHANGED
|
@@ -1,93 +1,41 @@
|
|
|
1
|
-
// Cookie wire format: the platform-gap primitives, and ALL of core's
|
|
2
|
-
// cookie surface — core owns the exchange (the request's headers in, the
|
|
3
|
-
// response stub's headers out) and the codec, nothing ambient. Blessed
|
|
4
|
-
// patterns:
|
|
5
|
-
//
|
|
6
|
-
// parseCookieHeader(event.request.headers.get("cookie"))
|
|
7
|
-
// event.response.headers.append("set-cookie", serializeCookie(name, value, options))
|
|
8
|
-
//
|
|
9
|
-
// Dependency-free and isomorphic (exported from both entries — real
|
|
10
|
-
// implementation, never a stub); integrity/confidentiality layers
|
|
11
|
-
// (sessions) belong to the caller, on top of these primitives.
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Attributes for a `Set-Cookie` header, mirroring RFC 6265. `path`
|
|
15
|
-
* defaults to `/`; nothing else is defaulted.
|
|
16
|
-
*/
|
|
17
1
|
export interface CookieOptions {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
/** Cookie `Path` attribute. Defaults to `/`. */
|
|
3
|
+
path?: string;
|
|
4
|
+
/** Cookie `Domain` attribute. Emitted only when provided. */
|
|
5
|
+
domain?: string;
|
|
6
|
+
/** Cookie `Max-Age` attribute, in seconds (truncated to an integer). */
|
|
7
|
+
maxAge?: number;
|
|
8
|
+
/** Cookie `Expires` attribute. */
|
|
9
|
+
expires?: Date;
|
|
10
|
+
/** Emit the `HttpOnly` attribute. */
|
|
11
|
+
httpOnly?: boolean;
|
|
12
|
+
/** Emit the `Secure` attribute. */
|
|
13
|
+
secure?: boolean;
|
|
14
|
+
/** Cookie `SameSite` attribute, any case. */
|
|
15
|
+
sameSite?: "lax" | "strict" | "none" | "Lax" | "Strict" | "None";
|
|
16
|
+
/**
|
|
17
|
+
* Emit the `Partitioned` attribute (CHIPS): a third-party cookie keyed to
|
|
18
|
+
* the top-level site it was set under — the only third-party cookie that
|
|
19
|
+
* keeps working as browsers finish removing the rest. Requires `secure`.
|
|
20
|
+
*/
|
|
21
|
+
partitioned?: boolean;
|
|
32
22
|
}
|
|
33
|
-
|
|
34
23
|
/**
|
|
35
24
|
* Parses a `Cookie` request header into a name → value map. Names and
|
|
36
25
|
* values are `decodeURIComponent`-decoded (falling back to the raw text
|
|
37
|
-
* when decoding throws
|
|
38
|
-
*
|
|
26
|
+
* when decoding throws — cookies set by other producers are not
|
|
27
|
+
* necessarily percent-encoded); a quoted value keeps its content, per the
|
|
28
|
+
* RFC 6265 grammar. `null`/empty input parses to an empty map.
|
|
39
29
|
*
|
|
40
30
|
* The read half of the platform gap — the blessed request-cookie read is
|
|
41
31
|
* `parseCookieHeader(event.request.headers.get("cookie"))`.
|
|
42
32
|
*/
|
|
43
|
-
export function parseCookieHeader(header: string | null | undefined): Record<string, string>;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
* is `event.response.headers.append("set-cookie", serializeCookie(name,
|
|
53
|
-
* value, options))`, which every head materialization path carries to the
|
|
54
|
-
* wire entry-by-entry.
|
|
55
|
-
*/
|
|
56
|
-
export function serializeCookie(name: string, value: string, options?: CookieOptions): string;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Name of the cookie carrying the outcome of a server function call made
|
|
60
|
-
* without the client runtime (`"flash"`). A no-JS form post has no way to
|
|
61
|
-
* receive a value — the browser follows the redirect and renders the next
|
|
62
|
-
* page — so the handler stashes the outcome here for the render after it
|
|
63
|
-
* to pick up, which is how a form submitted without JavaScript still shows
|
|
64
|
-
* its result.
|
|
65
|
-
*
|
|
66
|
-
* The name, detection and clearing are cookie utilities and isomorphic
|
|
67
|
-
* (integrations read the cookie from code that also ships to the browser);
|
|
68
|
-
* the codec that fills and decodes it is server-only and lives behind the
|
|
69
|
-
* server-functions server entry.
|
|
70
|
-
*/
|
|
71
|
-
export const FLASH_COOKIE: string;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Whether a Cookie header carries a flash cookie, readable or not. Cheap
|
|
75
|
-
* enough to call on every render so the clear can be queued before the
|
|
76
|
-
* response headers flush.
|
|
77
|
-
*/
|
|
78
|
-
export function hasFlashCookie(cookieHeader: string | null): boolean;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* The `Set-Cookie` value clearing the flash cookie. The outcome is
|
|
82
|
-
* one-shot: append this as soon as the cookie is detected, whether or not
|
|
83
|
-
* it decodes, so a stale outcome cannot resurface on a later request.
|
|
84
|
-
*/
|
|
85
|
-
export function clearFlashCookie(): string;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* The raw encoded flash payload out of a Cookie header, if present — the
|
|
89
|
-
* codec's own accessor.
|
|
90
|
-
*
|
|
91
|
-
* @internal
|
|
92
|
-
*/
|
|
93
|
-
export function matchFlashCookie(cookieHeader: string | null): string | undefined;
|
|
33
|
+
export declare function parseCookieHeader(header: string | null | undefined): Record<string, string>;
|
|
34
|
+
export declare function serializeCookie(name: string, value: string, options?: CookieOptions): string;
|
|
35
|
+
export declare const FLASH_COOKIE = "flash";
|
|
36
|
+
/** Whether a Cookie header carries a flash cookie (readable or not). */
|
|
37
|
+
export declare function hasFlashCookie(cookieHeader: string | null): boolean;
|
|
38
|
+
/** The raw encoded flash payload out of a Cookie header, if present. */
|
|
39
|
+
export declare function matchFlashCookie(cookieHeader: string | null): string | undefined;
|
|
40
|
+
/** The Set-Cookie value clearing the flash cookie after it has been read. */
|
|
41
|
+
export declare function clearFlashCookie(): string;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type DiagnosticEvent } from "solid-js";
|
|
2
|
+
export type Finding = Omit<DiagnosticEvent, "sequence">;
|
|
3
|
+
/**
|
|
4
|
+
* Records a finding — observe and dev tiers — and, in dev, reports it on the
|
|
5
|
+
* console. `subject` locates it (the current server owner by default; its
|
|
6
|
+
* component labels give the `ownerPath`); pass `null` for a finding with no
|
|
7
|
+
* location by nature (a stream event). No-op in prod.
|
|
8
|
+
*/
|
|
9
|
+
export declare function emitFinding(finding: Finding, subject?: unknown): void;
|
|
10
|
+
/**
|
|
11
|
+
* The structured record alone, for a site that THROWS its message: the
|
|
12
|
+
* thrown error is the console face and the core lands the once-per-code
|
|
13
|
+
* footer beneath it. Reporting as well would print the finding twice.
|
|
14
|
+
*/
|
|
15
|
+
export declare function recordFinding(finding: Finding, subject?: unknown): void;
|
|
16
|
+
/**
|
|
17
|
+
* A dev CHECK: `emitFinding` behind the dev gate, so the site reads as one
|
|
18
|
+
* call and the observe and prod artifacts carry none of it. Extra console
|
|
19
|
+
* arguments (the offending descriptor, the caught error) go on `data` — the
|
|
20
|
+
* structured record keeps them, the console face prints the message.
|
|
21
|
+
*/
|
|
22
|
+
export declare function devCheck(finding: Finding, subject?: unknown): void;
|
|
23
|
+
/**
|
|
24
|
+
* Dev CHECK, one code on both platforms: a hole the compiler left unscoped
|
|
25
|
+
* (a bare identifier — `{renderHead}` — is the one shape that can be a
|
|
26
|
+
* function at runtime without the compiler seeing an expression to scope)
|
|
27
|
+
* evaluated to a function that built hydratable content, and that content
|
|
28
|
+
* took its ids from the ENCLOSING owner's counter. A scoped hole reserves
|
|
29
|
+
* its slot at registration and nests its content under it, so it moves the
|
|
30
|
+
* counter by exactly one, at the same point on both sides; an unscoped one
|
|
31
|
+
* moves it by however much it built, when it ran — statement order on the
|
|
32
|
+
* client, walk order on the server — and every id after it permutes. The
|
|
33
|
+
* shape is unreachable from type-checked code (`JSX.Element` excludes
|
|
34
|
+
* functions) and is not scoped in production; this check is its cost.
|
|
35
|
+
*
|
|
36
|
+
* Unscoped allocation alone is not the finding — a function hole that runs
|
|
37
|
+
* at the same counter position on both sides (nothing scoped after it in
|
|
38
|
+
* its template; a boundary's zero-arity fallback thunk at the end of an
|
|
39
|
+
* element) hydrates fine. Each side reports the permutation it can see:
|
|
40
|
+
* the server knows the position the hole was REGISTERED at (`registered`,
|
|
41
|
+
* where the client builds it in statement order) and the one it EVALUATED
|
|
42
|
+
* it at (`before`, walk order, after the scoped holes that follow it
|
|
43
|
+
* reserved theirs) and reports when they differ; the client, which always
|
|
44
|
+
* builds in place, reports when the content it built inside the hole
|
|
45
|
+
* missed its server-rendered keys. `before`/`after` are the counter's next
|
|
46
|
+
* id around the evaluation; `site` names the hole (`data.name` the
|
|
47
|
+
* function, `data.hole` the position). Callers dedupe per site so a row
|
|
48
|
+
* template reports once.
|
|
49
|
+
*/
|
|
50
|
+
export declare function unscopedHoleAllocatedIds(before: string, after: string, site: {
|
|
51
|
+
name?: string;
|
|
52
|
+
hole?: number;
|
|
53
|
+
registered?: string;
|
|
54
|
+
}, subject?: unknown): void;
|
|
55
|
+
/**
|
|
56
|
+
* Dev CHECK: a function reached an attribute whose name starts with `on` but
|
|
57
|
+
* is not an event handler — a lowercase `onclick`, or a 1.x `on:click`. Only
|
|
58
|
+
* `on` + an uppercase letter (`onClick`) binds an event in 2.0; anything else
|
|
59
|
+
* is a plain attribute, so the function is stringified into the attribute's
|
|
60
|
+
* text. Reported once per attribute name so a row template reports once.
|
|
61
|
+
*/
|
|
62
|
+
export declare function lowercaseEventAttribute(name: string, node: Element): void;
|
|
63
|
+
/**
|
|
64
|
+
* Dev CHECK, before every compiled or spread write of a stateful DOM
|
|
65
|
+
* property (`input.value`, `input.checked`, `option.selected`,
|
|
66
|
+
* `video.muted`, ...): Solid is about to write the same value it wrote last
|
|
67
|
+
* time, but the element no longer holds what that write left there. Nothing
|
|
68
|
+
* Solid wrote changed it, so the user did — typed, clicked, toggled — and
|
|
69
|
+
* that edit never reached the bound signal; the write is about to erase it.
|
|
70
|
+
* The write re-applies an unchanged value because the binding re-ran
|
|
71
|
+
* without its value changing: another binding in the same template effect
|
|
72
|
+
* changed, a spread re-ran, or the source fired with an equal value
|
|
73
|
+
* (`equals: false`). Warns once per element and property; the write itself
|
|
74
|
+
* goes ahead unchanged. Pair with `recordStatefulWrite` after the write.
|
|
75
|
+
*/
|
|
76
|
+
export declare function checkStatefulWrite(node: Element, prop: string, value: unknown): void;
|
|
77
|
+
/** Dev: remembers what a stateful write left on the element (see `checkStatefulWrite`). */
|
|
78
|
+
export declare function recordStatefulWrite(node: Element, prop: string, value: unknown): void;
|
|
79
|
+
/** `Name: message` for an Error, `String(value)` otherwise. */
|
|
80
|
+
export declare function errorText(error: unknown): string;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@solidjs/web/frames/assets` — the frames client's ASSETS tier (frames
|
|
3
|
+
* savings pass §3 row C5): what a segment's `seg:<k>:assets` record does to
|
|
4
|
+
* the document head, loaded on demand through the tier mechanism
|
|
5
|
+
* (`prepareTier("assets")`, frame-client.ts).
|
|
6
|
+
*
|
|
7
|
+
* What rides in this chunk, and so leaves the eager frames client: the
|
|
8
|
+
* import-free mirror of the client asset registry's head conventions
|
|
9
|
+
* (`ensureStylesheet` / `ensurePreload` / `ensureModulePreload` /
|
|
10
|
+
* `applyInlineStyles`, `findHeadElement`'s attribute-compared lookup and
|
|
11
|
+
* head.ts's `qualifierValue`), the per-frame flush a pending stylesheet
|
|
12
|
+
* wakes, and the assets pass over a record (modules, typed preloads, inline
|
|
13
|
+
* styles). The eager client keeps the record itself (the wire's
|
|
14
|
+
* `seg:<k>:assets` record, the host's `seg::assets` accumulate), the pass's walk over
|
|
15
|
+
* the store, and the reveal's READINESS TERM: a segment whose assets record
|
|
16
|
+
* carries stylesheets or inline styles while this tier is not resident is
|
|
17
|
+
* not ready — the server's `<Loading>` fallback stays on screen; the reveal
|
|
18
|
+
* happens at max(tier load, stylesheet load) (frames savings pass §1,
|
|
19
|
+
* "assets": no FOUC, no blank). Once the tier is resident only stylesheets
|
|
20
|
+
* gate: inline styles apply at the record's arrival (the walk runs ahead of
|
|
21
|
+
* the segments in the same flush), modules and preloads likewise, and a
|
|
22
|
+
* segment with none of these never waits on the tier.
|
|
23
|
+
*
|
|
24
|
+
* The module's exports ARE its dispatch: `prepareTier` stamps the load with
|
|
25
|
+
* the module once it has resolved (`tierLoads.assets.r`), and the eager
|
|
26
|
+
* client calls `gate` from `#segmentReady` and `apply` from `#flush`'s
|
|
27
|
+
* assets walk off that stamp. No `install()`: the tier registers nothing
|
|
28
|
+
* and imports nothing of the client — it needs no shared instance, only
|
|
29
|
+
* the frame handed to `gate` (its `apply` is the flush a settled sheet
|
|
30
|
+
* triggers).
|
|
31
|
+
*
|
|
32
|
+
* The server announces this tier wherever it emits an assets chunk
|
|
33
|
+
* (`sink.needs("assets")` — the shell's pre-flush assets, a style-gated
|
|
34
|
+
* fragment's, a late module / preload; frame-sink.ts): `X-Frame-Tiers` /
|
|
35
|
+
* `chunk.tiers` on a stream, `_$HY.r["sc:tiers"]` + a `modulepreload` on a
|
|
36
|
+
* document — so the load is a warm start; an un-announced record starts it
|
|
37
|
+
* from the readiness check or the walk and the segment waits (the same DOM,
|
|
38
|
+
* later).
|
|
39
|
+
* @experimental
|
|
40
|
+
*/
|
|
41
|
+
import type { Frame } from "./frame-client.js";
|
|
42
|
+
/** A stylesheet entry as the sink writes it: a url, or `{ href, attrs }`. */
|
|
43
|
+
export type StylesheetEntry = string | {
|
|
44
|
+
href: string;
|
|
45
|
+
attrs?: Record<string, string>;
|
|
46
|
+
};
|
|
47
|
+
/** A typed preload entry (`<link rel="preload">`): request-qualifying attributes, optional href. */
|
|
48
|
+
export interface PreloadEntry {
|
|
49
|
+
href?: string;
|
|
50
|
+
attrs: Record<string, string>;
|
|
51
|
+
}
|
|
52
|
+
/** An inline style entry (`<style data-asset>`). */
|
|
53
|
+
export interface InlineStyleEntry {
|
|
54
|
+
id: string;
|
|
55
|
+
content?: string;
|
|
56
|
+
attrs?: Record<string, string>;
|
|
57
|
+
}
|
|
58
|
+
/** The head-affecting members of a `seg:<k>:assets` record. */
|
|
59
|
+
export interface AssetsRecord {
|
|
60
|
+
modules?: string[];
|
|
61
|
+
styles?: StylesheetEntry[];
|
|
62
|
+
inlineStyles?: InlineStyleEntry[];
|
|
63
|
+
preloads?: PreloadEntry[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The stylesheet gate for one segment (`#segmentReady`'s style term, once
|
|
67
|
+
* the tier is resident): ensure every named sheet is in the head — pending
|
|
68
|
+
* links are inserted now, even while another prerequisite is missing, so
|
|
69
|
+
* the load overlaps the rest of the stream — and report whether all have
|
|
70
|
+
* settled. `frame` is re-flushed when a pending one settles.
|
|
71
|
+
*/
|
|
72
|
+
export declare function gate(entries: StylesheetEntry[], frame: Frame): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The assets pass for one record (`#flush`'s walk, once per record identity
|
|
75
|
+
* per mount): module preloads, typed preloads, inline styles. Stylesheets
|
|
76
|
+
* are the gate's (`gate`) — never applied here.
|
|
77
|
+
*/
|
|
78
|
+
export declare function apply(record: AssetsRecord): void;
|
package/types/frames/client.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type TierModule } from "./frame-client.js";
|
|
1
2
|
export { createFrame, createFrameHost, createFrameElement, FRAME_APPLIED_EVENT } from "./frame-client.js";
|
|
3
|
+
export type { TierModule } from "./frame-client.js";
|
|
2
4
|
export { FRAME_STREAM_HEADER, applyFrameResponse, isFrameStreamResponse, createServerComponentHandler } from "./frame-transport.js";
|
|
3
5
|
export type { Slot } from "./server.js";
|
|
4
6
|
/**
|
|
@@ -16,6 +18,31 @@ export declare function asyncArg<T>(value: PromiseLike<T> | AsyncIterable<T>): T
|
|
|
16
18
|
* @experimental
|
|
17
19
|
*/
|
|
18
20
|
export declare function getFrameHost(): any;
|
|
21
|
+
/**
|
|
22
|
+
* Turn deferred hydration off (or back on) for the frames this client
|
|
23
|
+
* adopts from now on: off, an adopted occurrence mounts in the adoption
|
|
24
|
+
* pass. A test seam for the specs that pin adoption-time ordering.
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export declare function setDeferredHydration(on: boolean): void;
|
|
28
|
+
/**
|
|
29
|
+
* Options for `installServerComponents`.
|
|
30
|
+
* @experimental
|
|
31
|
+
*/
|
|
32
|
+
export interface InstallOptions {
|
|
33
|
+
/**
|
|
34
|
+
* Frames-client tiers by name → loader. A tier's module's exports are its
|
|
35
|
+
* appliers (the runtime dispatches to them once resident) and its
|
|
36
|
+
* optional `install()` is called once the import resolves; every live
|
|
37
|
+
* frame is then flushed so what the tier makes applicable applies (a held
|
|
38
|
+
* occurrence mounts, a style-gated segment requests its sheets). A name
|
|
39
|
+
* with no loader is resident (eager); `trace` (`@solidjs/web/frames/trace`),
|
|
40
|
+
* `regions` (`@solidjs/web/frames/regions`) and `assets`
|
|
41
|
+
* (`@solidjs/web/frames/assets`) have built-in loaders that an entry here
|
|
42
|
+
* replaces. See `installServerComponents`.
|
|
43
|
+
*/
|
|
44
|
+
tiers?: Record<string, () => Promise<TierModule>>;
|
|
45
|
+
}
|
|
19
46
|
/**
|
|
20
47
|
* Installs the server-component transport policy on the server-function
|
|
21
48
|
* client — the identity split (DR-1): CONTENT is keyed by the call's
|
|
@@ -31,6 +58,18 @@ export declare function getFrameHost(): any;
|
|
|
31
58
|
* Call once in the client entry (an explicit call — the package is
|
|
32
59
|
* `sideEffects: false`, so a bare import would be tree-shaken away);
|
|
33
60
|
* call again to rebind to a custom host.
|
|
61
|
+
*
|
|
62
|
+
* `options.tiers` maps a frames-client tier's name to its loader (`() =>
|
|
63
|
+
* import(...)`, the module whose exports are the tier's appliers, with an
|
|
64
|
+
* optional `install()`): the client resolves tier chunks itself, so the
|
|
65
|
+
* server announces NAMES only (`_$HY.r["sc:tiers"]`, `X-Frame-Tiers`) and
|
|
66
|
+
* the loads start here from the document's record — the `modulepreload`
|
|
67
|
+
* the document may also carry made the fetch warm. The built-in table
|
|
68
|
+
* carries `trace` (the container tier's client half,
|
|
69
|
+
* `@solidjs/web/frames/trace`), `regions` (nested server-content regions,
|
|
70
|
+
* `@solidjs/web/frames/regions`) and `assets` (the head mirror and the
|
|
71
|
+
* stylesheet gate, `@solidjs/web/frames/assets`); a loader given here for
|
|
72
|
+
* a name replaces the built-in one (tests gate a tier's load this way).
|
|
34
73
|
* @experimental
|
|
35
74
|
*/
|
|
36
|
-
export declare function installServerComponents(host?: any): void;
|
|
75
|
+
export declare function installServerComponents(host?: any, options?: InstallOptions): void;
|