@solidjs/web 2.0.0-rc.6 → 2.0.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.cjs +105 -35
- package/dist/server.dev.cjs +3794 -0
- package/dist/server.dev.js +3627 -0
- package/dist/server.js +106 -36
- package/dist/web.cjs +39 -385
- package/dist/{dev.cjs → web.dev.cjs} +91 -396
- package/dist/{dev.js → web.dev.js} +93 -393
- package/dist/web.js +41 -382
- package/frames/dist/client.cjs +11 -3
- package/frames/dist/client.dev.cjs +11 -3
- package/frames/dist/client.dev.js +11 -3
- package/frames/dist/client.js +11 -3
- package/frames/dist/server.cjs +234 -32
- package/frames/dist/server.dev.cjs +4584 -0
- package/frames/dist/server.dev.js +4571 -0
- package/frames/dist/server.js +234 -32
- package/frames/package.json +10 -0
- package/package.json +78 -8
- package/serialization/dist/decode.cjs +18 -4
- package/serialization/dist/decode.js +18 -4
- package/serialization/dist/serialization.cjs +18 -4
- package/serialization/dist/serialization.js +18 -4
- package/server-functions/dist/client.cjs +13 -14
- package/server-functions/dist/client.js +13 -14
- package/server-functions/dist/server.cjs +331 -83
- package/server-functions/dist/server.dev.cjs +338 -82
- package/server-functions/dist/server.dev.js +338 -82
- package/server-functions/dist/server.js +331 -83
- package/types/client.d.ts +0 -3
- package/types/frames/frame-client.d.ts +1 -1
- package/types/head.d.ts +3 -0
- package/types/index.d.ts +18 -7
- package/types/index.server.d.ts +31 -9
- package/types/render.d.ts +3 -1
- package/types/server-functions/flash.d.ts +12 -3
- package/types/server-functions/server.d.ts +27 -3
- package/types/server-mock.d.ts +43 -7
- package/types/server.d.ts +47 -5
- package/types-cjs/client.d.cts +0 -3
- package/types-cjs/frames/frame-client.d.cts +1 -1
- package/types-cjs/head.d.cts +3 -0
- package/types-cjs/index.d.cts +18 -7
- package/types-cjs/index.server.d.cts +31 -9
- package/types-cjs/render.d.cts +3 -1
- package/types-cjs/server-functions/flash.d.cts +12 -3
- package/types-cjs/server-functions/server.d.cts +27 -3
- package/types-cjs/server-mock.d.cts +43 -7
- package/types-cjs/server.d.cts +47 -5
- package/types/patch-driver.d.ts +0 -3
- package/types-cjs/patch-driver.d.cts +0 -3
package/types/client.d.ts
CHANGED
|
@@ -79,8 +79,6 @@ export interface RequestEvent {
|
|
|
79
79
|
export type { CookieOptions } from "./cookies.js";
|
|
80
80
|
export type { ServerFunction, ServerFunctionMetadata, ServerFunctionRPC } from "./server-functions/shared.js";
|
|
81
81
|
export declare const waitAsset: (promise: Promise<unknown>) => void;
|
|
82
|
-
export declare let listDriver: ((parent: Node, listFn: any, marker?: Node, lateClassic?: () => void) => boolean) | undefined;
|
|
83
|
-
export declare function installListDriver(driver: typeof listDriver): void;
|
|
84
82
|
export { DOMWithState, ChildProperties, DOMElements, SVGElements, MathMLElements, VoidElements, RawTextElements, Namespaces, DelegatedEvents } from "./constants.js";
|
|
85
83
|
/** Client stub — hydration bootstrap is a server-only emit. */
|
|
86
84
|
export declare function generateHydrationScript(_options?: {
|
|
@@ -149,7 +147,6 @@ export declare function applyRef<T extends Element = Element>(r: ((element: NoIn
|
|
|
149
147
|
export declare function ref(fn: () => ((element: Element) => void) | ((element: Element) => void)[], element: Element): void;
|
|
150
148
|
/** Compiler-emitted primitive; not for hand-written code. @internal */
|
|
151
149
|
export declare function scope<T extends () => any>(fn: T): T;
|
|
152
|
-
export declare function getInsertionParent(): Node | undefined;
|
|
153
150
|
export declare function installHydrationRuntime(): void;
|
|
154
151
|
/**
|
|
155
152
|
* Compiler-emitted primitive; not for hand-written code.
|
package/types/head.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const HEAD_ELIGIBLE_TAGS: Set<string>;
|
|
2
2
|
export declare const HEAD_ATTR_NAME: RegExp;
|
|
3
3
|
export declare const RESOURCE_LINK_RELS: Set<string>;
|
|
4
|
+
export declare const RESOURCE_QUALIFIERS: string[];
|
|
4
5
|
export declare const STYLESHEET_FETCH_META: Set<string>;
|
|
5
6
|
export declare function evalHeadValue(v: any): any;
|
|
6
7
|
export declare function evalHeadProps(props: any, presets: any): {};
|
|
@@ -11,6 +12,8 @@ export declare function classifyHeadTag(desc: any): {
|
|
|
11
12
|
resource: boolean;
|
|
12
13
|
rel?: undefined;
|
|
13
14
|
};
|
|
15
|
+
export declare function qualifierValue(name: any, value: any): any;
|
|
16
|
+
export declare function asciiLowerCase(value: any): any;
|
|
14
17
|
export declare function resourceIdentity(tag: any, props: any): string;
|
|
15
18
|
export declare function replaceableIdentity(tag: any, props: any, key: any, unique: any): any;
|
|
16
19
|
export declare function resolveHead(groups: any): Map<any, any>;
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Component } from "solid-js";
|
|
2
2
|
import type { JSX } from "./jsx.js";
|
|
3
3
|
export * from "./client.js";
|
|
4
|
-
export { patchDriver, rowProof, driveList } from "./patch-driver.js";
|
|
5
4
|
export * from "./server-mock.js";
|
|
6
5
|
export * from "./response.js";
|
|
7
6
|
export type { JSX } from "./jsx.js";
|
|
@@ -79,7 +78,16 @@ export declare function Portal(props: {
|
|
|
79
78
|
mount?: Element;
|
|
80
79
|
children: JSX.Element;
|
|
81
80
|
}): JSX.Element;
|
|
82
|
-
export
|
|
81
|
+
export interface DynamicOptions {
|
|
82
|
+
/**
|
|
83
|
+
* SSR only: hold the document's first flush until the source settles, so
|
|
84
|
+
* the resolved component renders into the shell instead of streaming in
|
|
85
|
+
* behind its boundary's fallback. Same meaning as `createMemo`'s
|
|
86
|
+
* `deferStream`. Ignored on the client.
|
|
87
|
+
*/
|
|
88
|
+
deferStream?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export declare function dynamic<T extends ValidComponent>(source: () => T | Promise<T> | null | undefined | false, _options?: DynamicOptions): Component<ComponentProps<T>>;
|
|
83
91
|
/**
|
|
84
92
|
* Renders an arbitrary custom or native component and forwards the other
|
|
85
93
|
* props. JSX form of `dynamic()` — same primitive, picked at the JSX site.
|
|
@@ -152,9 +160,10 @@ export declare function clientOnly<T extends Component<any>>(fn: () => Promise<{
|
|
|
152
160
|
* `event.response` status at write time and restores it when the owning
|
|
153
161
|
* scope is disposed — so a boundary that errored, declared a status, and
|
|
154
162
|
* then recovered retracts its write instead of stomping a status a
|
|
155
|
-
* surviving part of the tree legitimately set. Once the
|
|
156
|
-
*
|
|
157
|
-
*
|
|
163
|
+
* surviving part of the tree legitimately set. Once the response head is
|
|
164
|
+
* `committed` (head derived/sent — the shell flush of a piped
|
|
165
|
+
* `renderToStream`, the completion of an awaited one, `createSSRResponse`
|
|
166
|
+
* for a `renderToString` result), writes and retractions are no-ops.
|
|
158
167
|
*/
|
|
159
168
|
export declare function httpStatus(_code: number, _text?: string): void;
|
|
160
169
|
/**
|
|
@@ -172,8 +181,10 @@ export declare function httpStatus(_code: number, _text?: string): void;
|
|
|
172
181
|
* Retraction semantics (server): the header's prior value is snapshotted at
|
|
173
182
|
* write time and restored when the owning scope is disposed (deleted if
|
|
174
183
|
* there was none) — a boundary that errors or recovers retracts its writes.
|
|
175
|
-
* Once the
|
|
176
|
-
*
|
|
184
|
+
* Once the response head is `committed` (head derived/sent — the shell
|
|
185
|
+
* flush of a piped `renderToStream`, the completion of an awaited one,
|
|
186
|
+
* `createSSRResponse` for a `renderToString` result), writes and
|
|
187
|
+
* retractions are no-ops.
|
|
177
188
|
*/
|
|
178
189
|
export declare function httpHeader(_name: string, _value: string, _options?: {
|
|
179
190
|
append?: boolean;
|
package/types/index.server.d.ts
CHANGED
|
@@ -13,14 +13,28 @@ export { For, Show, Loading, Reveal, Switch, Match, Repeat, Errored, NoHydration
|
|
|
13
13
|
export declare const isServer: boolean;
|
|
14
14
|
/**
|
|
15
15
|
* Build-time constant indicating whether code is running in a dev build.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* Set by `_SOLID_DEV_` substitution per artifact, exactly like the client
|
|
17
|
+
* entry: `dist/server.dev.*` (the `development` export condition) → `true`,
|
|
18
|
+
* `dist/server.*` → `false`. The server runtime's own `_SOLID_DEV_` gates are
|
|
19
|
+
* replaced by the same pass, so this flag and the bundle's internal behavior
|
|
20
|
+
* cannot disagree.
|
|
18
21
|
*/
|
|
19
22
|
export declare const isDev: boolean;
|
|
20
23
|
export type IntrinsicElement = Extract<keyof JSX.IntrinsicElements, string>;
|
|
21
24
|
export type ValidComponent = IntrinsicElement | Component<any> | (string & {});
|
|
22
25
|
export type ComponentProps<T extends ValidComponent> = T extends Component<infer P> ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : Record<string, unknown>;
|
|
23
|
-
export
|
|
26
|
+
export interface DynamicOptions {
|
|
27
|
+
/**
|
|
28
|
+
* SSR only: hold the document's first flush until the source settles, so
|
|
29
|
+
* the resolved component renders into the shell instead of streaming in
|
|
30
|
+
* behind its boundary's fallback. Same meaning as `createMemo`'s
|
|
31
|
+
* `deferStream`. Default `false` — a `dynamic()` source is data of unknown
|
|
32
|
+
* cost and streams by default (a code-split `lazy()` always holds the shell
|
|
33
|
+
* for its module load, since its code is a prerequisite to the render).
|
|
34
|
+
*/
|
|
35
|
+
deferStream?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function dynamic<T extends ValidComponent>(source: () => T | Promise<T> | null | undefined | false, options?: DynamicOptions): Component<ComponentProps<T>>;
|
|
24
38
|
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
25
39
|
[K in keyof P]: P[K];
|
|
26
40
|
} & {
|
|
@@ -90,9 +104,14 @@ export declare function clientOnly<T extends Component<any>>(fn: () => Promise<{
|
|
|
90
104
|
* write without stomping a status a surviving part of the tree legitimately
|
|
91
105
|
* set (e.g. a 404 page whose inner boundary recovers stays a 404), and
|
|
92
106
|
* sibling scopes may dispose in any order (#2984). Both the write and the
|
|
93
|
-
* cleanup are no-ops once the
|
|
94
|
-
*
|
|
95
|
-
*
|
|
107
|
+
* cleanup are no-ops once the response head is `committed` (head
|
|
108
|
+
* derived/sent — status can no longer change). The head commits when it
|
|
109
|
+
* freezes: at shell flush for a piped `renderToStream` (`createSSRResponse`
|
|
110
|
+
* commits on the first write), at completion for an awaited one (the render
|
|
111
|
+
* commits right before its final dispose, so the declarations still live at
|
|
112
|
+
* that point are the ones the consumer derives the head from), and when
|
|
113
|
+
* `createSSRResponse` receives a `renderToString` result. On the client this
|
|
114
|
+
* is a no-op.
|
|
96
115
|
*/
|
|
97
116
|
export declare function httpStatus(code: number, text?: string): void;
|
|
98
117
|
/**
|
|
@@ -116,9 +135,12 @@ export declare function httpStatus(code: number, text?: string): void;
|
|
|
116
135
|
* multiple values must survive as separate entries — the base is captured
|
|
117
136
|
* and replayed entry-exact (`getSetCookie()` + re-append; `get()`/`set()`
|
|
118
137
|
* would comma-join the entries and then collapse them into one corrupt
|
|
119
|
-
* header). Both the write and the cleanup are no-ops once the
|
|
120
|
-
*
|
|
121
|
-
*
|
|
138
|
+
* header). Both the write and the cleanup are no-ops once the response head
|
|
139
|
+
* is `committed` (head derived/sent — headers can no longer change); the
|
|
140
|
+
* head commits when it freezes — shell flush for a piped `renderToStream`,
|
|
141
|
+
* completion (right before the final dispose) for an awaited one,
|
|
142
|
+
* `createSSRResponse` for a `renderToString` result — see `httpStatus`. On
|
|
143
|
+
* the client this is a no-op.
|
|
122
144
|
*/
|
|
123
145
|
export declare function httpHeader(name: string, value: string, options?: {
|
|
124
146
|
append?: boolean;
|
package/types/render.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** Dev: remember the element the running binding effect writes (first one wins). */
|
|
2
|
+
export declare function tagElement(node: Node): void;
|
|
3
|
+
export declare function effect<T>(fn: (prev?: T) => T, effectFn: (value: T, prev?: T) => void | (() => void), options?: {
|
|
2
4
|
scope?: boolean;
|
|
3
5
|
}): void;
|
|
4
6
|
export declare function memo<T>(fn: () => T): () => T;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function setFlashSecret(secret: any): void;
|
|
1
2
|
/**
|
|
2
3
|
* The outcome of a call made without the client runtime, as it rides the
|
|
3
4
|
* flash cookie: what was submitted, where, and what came back. `result` and
|
|
@@ -7,7 +8,15 @@
|
|
|
7
8
|
export interface FlashSubmission {
|
|
8
9
|
/** The arguments the call was made with (files are dropped). */
|
|
9
10
|
input: any[];
|
|
10
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* The call's url: the UNBOUND function base — the server function
|
|
13
|
+
* request's pathname (`<endpoint>/<id>`), without the `?args=` query a
|
|
14
|
+
* `.with()`-bound form's action carries (or any other query decoration).
|
|
15
|
+
* Matches what the scripted road records as a submission's url, so
|
|
16
|
+
* integrations can match flash and scripted submissions with the same
|
|
17
|
+
* `s.url === fn.base` test; bound arguments arrive in `input` instead,
|
|
18
|
+
* prepended exactly like a scripted call's.
|
|
19
|
+
*/
|
|
11
20
|
url: string;
|
|
12
21
|
/** The returned value, when the call returned. */
|
|
13
22
|
result?: any;
|
|
@@ -23,5 +32,5 @@ export interface FlashSubmission {
|
|
|
23
32
|
*/
|
|
24
33
|
truncated?: boolean;
|
|
25
34
|
}
|
|
26
|
-
export declare function encodeFlashCookie(url: string, result: any, input: any[], thrown?: boolean): string
|
|
27
|
-
export declare function decodeFlashCookie(cookieHeader: string | null): FlashSubmission | undefined
|
|
35
|
+
export declare function encodeFlashCookie(url: string, result: any, input: any[], thrown?: boolean): Promise<string | null>;
|
|
36
|
+
export declare function decodeFlashCookie(cookieHeader: string | null): Promise<FlashSubmission | undefined>;
|
|
@@ -264,6 +264,25 @@ export interface ServerFunctionsServerConfig {
|
|
|
264
264
|
* @default 1000
|
|
265
265
|
*/
|
|
266
266
|
maxArguments?: number;
|
|
267
|
+
/**
|
|
268
|
+
* The DEPLOYMENT SECRET: one value per deployment, from which any feature
|
|
269
|
+
* that needs a key derives its own (domain-separated, so per-purpose keys
|
|
270
|
+
* share no material). Today one feature does — the no-JS flash cookie
|
|
271
|
+
* (#3239): the flash carries the submitted form input — whatever the user
|
|
272
|
+
* typed — so its payload is always AES-GCM encrypted; it never rides the
|
|
273
|
+
* wire or rests in the cookie jar as plaintext. Every instance that can
|
|
274
|
+
* serve the render after a form post must share the secret (behind a load
|
|
275
|
+
* balancer, a per-instance secret would silently lose outcomes), so there
|
|
276
|
+
* is no generated fallback here: when this is not set, the secret falls
|
|
277
|
+
* back to the one the Solid bundler plugin injects into the server build
|
|
278
|
+
* (a fresh value per build), and with neither present the outcome is
|
|
279
|
+
* simply not flashed — the form post still redirects cleanly, and dev
|
|
280
|
+
* builds warn once. Any non-empty string works; rotating it (or
|
|
281
|
+
* redeploying with the plugin's value) invalidates in-flight flashes,
|
|
282
|
+
* which are 60-second one-shot cookies — the next render reads "no
|
|
283
|
+
* flash".
|
|
284
|
+
*/
|
|
285
|
+
secret?: string;
|
|
267
286
|
}
|
|
268
287
|
/**
|
|
269
288
|
* A registered server function: its build-stable id paired with the
|
|
@@ -320,8 +339,13 @@ export interface HandleServerFunctionOptions {
|
|
|
320
339
|
/**
|
|
321
340
|
* Overrides the configured per-invocation wrap for this handler — same
|
|
322
341
|
* contract as the `wrapInvocation` config option (see
|
|
323
|
-
* `WrapInvocationHook`), except it
|
|
324
|
-
*
|
|
342
|
+
* `WrapInvocationHook`), except it is ENTRY-ONLY: it wraps exactly the
|
|
343
|
+
* invocation the request addressed. Nested direct server-function calls
|
|
344
|
+
* made by the dispatched body are not re-wrapped by it — they consult
|
|
345
|
+
* only the configured hook, which is ambient and wraps every direct call
|
|
346
|
+
* (a per-request option can't see direct SSR calls). Policy that must
|
|
347
|
+
* cover every hop belongs on `configureServerFunctionsServer`'s
|
|
348
|
+
* `wrapInvocation`, not here.
|
|
325
349
|
*/
|
|
326
350
|
wrapInvocation?: WrapInvocationHook;
|
|
327
351
|
/**
|
|
@@ -422,7 +446,7 @@ export declare function live<A extends readonly any[], R>(fn: (...args: A) => R)
|
|
|
422
446
|
export declare function getServerFunctionInvocation(): ServerFunctionInvocation | undefined;
|
|
423
447
|
export declare function getEventServerFunctionInvocation(event: RequestEvent | undefined): ServerFunctionInvocation | undefined;
|
|
424
448
|
export declare function foldSetCookies(headers: Headers, setCookies: readonly string[]): Headers;
|
|
425
|
-
export declare function createNoJSHandler(options?: NoJSHandlerOptions): (result: unknown, request: Request, args: unknown[], thrown?: boolean) => Response
|
|
449
|
+
export declare function createNoJSHandler(options?: NoJSHandlerOptions): (result: unknown, request: Request, args: unknown[], thrown?: boolean) => Promise<Response>;
|
|
426
450
|
/** @internal */
|
|
427
451
|
export declare function guardFailures(value: any, state: any): any;
|
|
428
452
|
/**
|
package/types/server-mock.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { RequestEvent, RequestEventLocals, ResponseStub } from "./client.js";
|
|
2
2
|
import type { JSX } from "./jsx.js";
|
|
3
|
-
|
|
4
|
-
export type PreloadLink = {
|
|
5
|
-
href: string;
|
|
6
|
-
as: JSX.HTMLPreloadAs;
|
|
3
|
+
type PreloadLinkAttributes = {
|
|
7
4
|
type?: string;
|
|
8
5
|
crossorigin?: JSX.HTMLCrossorigin;
|
|
9
6
|
integrity?: string;
|
|
@@ -11,7 +8,44 @@ export type PreloadLink = {
|
|
|
11
8
|
fetchpriority?: JSX.HTMLFetchPriority;
|
|
12
9
|
media?: string;
|
|
13
10
|
};
|
|
14
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* An explicit `<link rel="preload">` emitted by the SSR asset pipeline.
|
|
13
|
+
*
|
|
14
|
+
* `as` is the HTML Standard's set of preload destinations exactly — anything
|
|
15
|
+
* else translates to null and the browser does nothing with the link.
|
|
16
|
+
*
|
|
17
|
+
* `imagesrcset` candidates must already be resolved by the integration: they
|
|
18
|
+
* are carried verbatim (a relative candidate resolves against the DOCUMENT
|
|
19
|
+
* URL, not the manifest base). Pair it with `imagesizes` whenever a candidate
|
|
20
|
+
* uses a width descriptor, which the spec requires — without it the source
|
|
21
|
+
* size falls back to `100vw` and the preload can miss the image the `<img>`
|
|
22
|
+
* selects. Omitting `href` is the spec's own recommendation for the source-set
|
|
23
|
+
* form: it would only serve browsers without `imagesrcset` support, and there
|
|
24
|
+
* it would likely preload the wrong candidate.
|
|
25
|
+
*/
|
|
26
|
+
export type PreloadLink = PreloadLinkAttributes & ({
|
|
27
|
+
href: string;
|
|
28
|
+
as: Exclude<JSX.HTMLPreloadAs, "image">;
|
|
29
|
+
imagesrcset?: never;
|
|
30
|
+
imagesizes?: never;
|
|
31
|
+
} | {
|
|
32
|
+
href: string;
|
|
33
|
+
as: "image";
|
|
34
|
+
imagesrcset?: string;
|
|
35
|
+
imagesizes?: string;
|
|
36
|
+
} | {
|
|
37
|
+
href?: never;
|
|
38
|
+
as: "image";
|
|
39
|
+
imagesrcset: string;
|
|
40
|
+
imagesizes?: string;
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* Static asset graph consumed by the SSR pipeline. This is Solid's own
|
|
44
|
+
* contract — a parsed Vite client manifest satisfies it structurally
|
|
45
|
+
* (unknown fields pass through untyped), but any bundler integration can
|
|
46
|
+
* produce it. Only these fields are ever read: `preloads` is Solid's
|
|
47
|
+
* extension slot for explicit typed links the integration selects.
|
|
48
|
+
*/
|
|
15
49
|
export type AssetManifest = Record<string, {
|
|
16
50
|
file: string;
|
|
17
51
|
css?: string[];
|
|
@@ -195,8 +229,9 @@ export declare function getExpectedRedirectStatus(response: ResponseStub): numbe
|
|
|
195
229
|
* shell flush, a pre-flush `Location` becomes a real redirect
|
|
196
230
|
* (`getExpectedRedirectStatus`), and a post-flush one appends the
|
|
197
231
|
* nonce-aware `<script>window.location=...</script>` fallback. String
|
|
198
|
-
* results return a `Response` synchronously
|
|
199
|
-
*
|
|
232
|
+
* results return a `Response` synchronously (an awaited `renderToStream`
|
|
233
|
+
* result arrives already committed — its head froze at completion); stream
|
|
234
|
+
* results resolve at shell flush. Server-only.
|
|
200
235
|
*/
|
|
201
236
|
export declare function createSSRResponse(result: string, event: RequestEvent | undefined, options?: {
|
|
202
237
|
responseInit?: ResponseInit;
|
|
@@ -299,3 +334,4 @@ export declare function resolveSSRNode(node: any, result?: any, top?: boolean):
|
|
|
299
334
|
* @internal
|
|
300
335
|
*/
|
|
301
336
|
export declare function escape(s: any, attr?: boolean): any;
|
|
337
|
+
export {};
|
package/types/server.d.ts
CHANGED
|
@@ -5,10 +5,7 @@ export { clearFlashCookie, hasFlashCookie } from "./cookies.js";
|
|
|
5
5
|
export { getServerFunctionMetadata, getServerFunctionRPC, isServerFunction } from "./server-functions/registry.js";
|
|
6
6
|
import { JSX } from "./jsx.js";
|
|
7
7
|
import { SerializerPlugin } from "./serializer-decode.js";
|
|
8
|
-
|
|
9
|
-
export type PreloadLink = {
|
|
10
|
-
href: string;
|
|
11
|
-
as: JSX.HTMLPreloadAs;
|
|
8
|
+
type PreloadLinkAttributes = {
|
|
12
9
|
type?: string;
|
|
13
10
|
crossorigin?: JSX.HTMLCrossorigin;
|
|
14
11
|
integrity?: string;
|
|
@@ -16,7 +13,44 @@ export type PreloadLink = {
|
|
|
16
13
|
fetchpriority?: JSX.HTMLFetchPriority;
|
|
17
14
|
media?: string;
|
|
18
15
|
};
|
|
19
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* An explicit `<link rel="preload">` emitted by the SSR asset pipeline.
|
|
18
|
+
*
|
|
19
|
+
* `as` is the HTML Standard's set of preload destinations exactly — anything
|
|
20
|
+
* else translates to null and the browser does nothing with the link.
|
|
21
|
+
*
|
|
22
|
+
* `imagesrcset` candidates must already be resolved by the integration: they
|
|
23
|
+
* are carried verbatim (a relative candidate resolves against the DOCUMENT
|
|
24
|
+
* URL, not the manifest base). Pair it with `imagesizes` whenever a candidate
|
|
25
|
+
* uses a width descriptor, which the spec requires — without it the source
|
|
26
|
+
* size falls back to `100vw` and the preload can miss the image the `<img>`
|
|
27
|
+
* selects. Omitting `href` is the spec's own recommendation for the source-set
|
|
28
|
+
* form: it would only serve browsers without `imagesrcset` support, and there
|
|
29
|
+
* it would likely preload the wrong candidate.
|
|
30
|
+
*/
|
|
31
|
+
export type PreloadLink = PreloadLinkAttributes & ({
|
|
32
|
+
href: string;
|
|
33
|
+
as: Exclude<JSX.HTMLPreloadAs, "image">;
|
|
34
|
+
imagesrcset?: never;
|
|
35
|
+
imagesizes?: never;
|
|
36
|
+
} | {
|
|
37
|
+
href: string;
|
|
38
|
+
as: "image";
|
|
39
|
+
imagesrcset?: string;
|
|
40
|
+
imagesizes?: string;
|
|
41
|
+
} | {
|
|
42
|
+
href?: never;
|
|
43
|
+
as: "image";
|
|
44
|
+
imagesrcset: string;
|
|
45
|
+
imagesizes?: string;
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Static asset graph consumed by the SSR pipeline. This is Solid's own
|
|
49
|
+
* contract — a parsed Vite client manifest satisfies it structurally
|
|
50
|
+
* (unknown fields pass through untyped), but any bundler integration can
|
|
51
|
+
* produce it. Only these fields are ever read: `preloads` is Solid's
|
|
52
|
+
* extension slot for explicit typed links the integration selects.
|
|
53
|
+
*/
|
|
20
54
|
export type AssetManifest = Record<string, {
|
|
21
55
|
file: string;
|
|
22
56
|
css?: string[];
|
|
@@ -233,6 +267,14 @@ export declare function renderToStream<T>(fn: () => T, options?: {
|
|
|
233
267
|
* await renderToStream(...)`). Render errors route through `onError` and
|
|
234
268
|
* the promise resolves with whatever HTML the render produced; it never
|
|
235
269
|
* rejects.
|
|
270
|
+
*
|
|
271
|
+
* Completion is this path's head-freeze point: the request event's
|
|
272
|
+
* `response` head (the request scope the render was started in) is
|
|
273
|
+
* committed right before the render's final dispose, so
|
|
274
|
+
* `httpStatus`/`httpHeader` declarations still live at completion survive
|
|
275
|
+
* into `createSSRResponse(html, event)` — which sees the already-committed
|
|
276
|
+
* stub and passes it through. The piped forms freeze at shell flush
|
|
277
|
+
* instead.
|
|
236
278
|
*/
|
|
237
279
|
then<TResult1 = string, TResult2 = never>(onfulfilled?: ((html: string) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
238
280
|
pipe: (writable: {
|
package/types-cjs/client.d.cts
CHANGED
|
@@ -79,8 +79,6 @@ export interface RequestEvent {
|
|
|
79
79
|
export type { CookieOptions } from "./cookies.cjs";
|
|
80
80
|
export type { ServerFunction, ServerFunctionMetadata, ServerFunctionRPC } from "./server-functions/shared.cjs";
|
|
81
81
|
export declare const waitAsset: (promise: Promise<unknown>) => void;
|
|
82
|
-
export declare let listDriver: ((parent: Node, listFn: any, marker?: Node, lateClassic?: () => void) => boolean) | undefined;
|
|
83
|
-
export declare function installListDriver(driver: typeof listDriver): void;
|
|
84
82
|
export { DOMWithState, ChildProperties, DOMElements, SVGElements, MathMLElements, VoidElements, RawTextElements, Namespaces, DelegatedEvents } from "./constants.cjs";
|
|
85
83
|
/** Client stub — hydration bootstrap is a server-only emit. */
|
|
86
84
|
export declare function generateHydrationScript(_options?: {
|
|
@@ -149,7 +147,6 @@ export declare function applyRef<T extends Element = Element>(r: ((element: NoIn
|
|
|
149
147
|
export declare function ref(fn: () => ((element: Element) => void) | ((element: Element) => void)[], element: Element): void;
|
|
150
148
|
/** Compiler-emitted primitive; not for hand-written code. @internal */
|
|
151
149
|
export declare function scope<T extends () => any>(fn: T): T;
|
|
152
|
-
export declare function getInsertionParent(): Node | undefined;
|
|
153
150
|
export declare function installHydrationRuntime(): void;
|
|
154
151
|
/**
|
|
155
152
|
* Compiler-emitted primitive; not for hand-written code.
|
package/types-cjs/head.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const HEAD_ELIGIBLE_TAGS: Set<string>;
|
|
2
2
|
export declare const HEAD_ATTR_NAME: RegExp;
|
|
3
3
|
export declare const RESOURCE_LINK_RELS: Set<string>;
|
|
4
|
+
export declare const RESOURCE_QUALIFIERS: string[];
|
|
4
5
|
export declare const STYLESHEET_FETCH_META: Set<string>;
|
|
5
6
|
export declare function evalHeadValue(v: any): any;
|
|
6
7
|
export declare function evalHeadProps(props: any, presets: any): {};
|
|
@@ -11,6 +12,8 @@ export declare function classifyHeadTag(desc: any): {
|
|
|
11
12
|
resource: boolean;
|
|
12
13
|
rel?: undefined;
|
|
13
14
|
};
|
|
15
|
+
export declare function qualifierValue(name: any, value: any): any;
|
|
16
|
+
export declare function asciiLowerCase(value: any): any;
|
|
14
17
|
export declare function resourceIdentity(tag: any, props: any): string;
|
|
15
18
|
export declare function replaceableIdentity(tag: any, props: any, key: any, unique: any): any;
|
|
16
19
|
export declare function resolveHead(groups: any): Map<any, any>;
|
package/types-cjs/index.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Component } from "solid-js";
|
|
2
2
|
import type { JSX } from "./jsx.cjs";
|
|
3
3
|
export * from "./client.cjs";
|
|
4
|
-
export { patchDriver, rowProof, driveList } from "./patch-driver.cjs";
|
|
5
4
|
export * from "./server-mock.cjs";
|
|
6
5
|
export * from "./response.cjs";
|
|
7
6
|
export type { JSX } from "./jsx.cjs";
|
|
@@ -79,7 +78,16 @@ export declare function Portal(props: {
|
|
|
79
78
|
mount?: Element;
|
|
80
79
|
children: JSX.Element;
|
|
81
80
|
}): JSX.Element;
|
|
82
|
-
export
|
|
81
|
+
export interface DynamicOptions {
|
|
82
|
+
/**
|
|
83
|
+
* SSR only: hold the document's first flush until the source settles, so
|
|
84
|
+
* the resolved component renders into the shell instead of streaming in
|
|
85
|
+
* behind its boundary's fallback. Same meaning as `createMemo`'s
|
|
86
|
+
* `deferStream`. Ignored on the client.
|
|
87
|
+
*/
|
|
88
|
+
deferStream?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export declare function dynamic<T extends ValidComponent>(source: () => T | Promise<T> | null | undefined | false, _options?: DynamicOptions): Component<ComponentProps<T>>;
|
|
83
91
|
/**
|
|
84
92
|
* Renders an arbitrary custom or native component and forwards the other
|
|
85
93
|
* props. JSX form of `dynamic()` — same primitive, picked at the JSX site.
|
|
@@ -152,9 +160,10 @@ export declare function clientOnly<T extends Component<any>>(fn: () => Promise<{
|
|
|
152
160
|
* `event.response` status at write time and restores it when the owning
|
|
153
161
|
* scope is disposed — so a boundary that errored, declared a status, and
|
|
154
162
|
* then recovered retracts its write instead of stomping a status a
|
|
155
|
-
* surviving part of the tree legitimately set. Once the
|
|
156
|
-
*
|
|
157
|
-
*
|
|
163
|
+
* surviving part of the tree legitimately set. Once the response head is
|
|
164
|
+
* `committed` (head derived/sent — the shell flush of a piped
|
|
165
|
+
* `renderToStream`, the completion of an awaited one, `createSSRResponse`
|
|
166
|
+
* for a `renderToString` result), writes and retractions are no-ops.
|
|
158
167
|
*/
|
|
159
168
|
export declare function httpStatus(_code: number, _text?: string): void;
|
|
160
169
|
/**
|
|
@@ -172,8 +181,10 @@ export declare function httpStatus(_code: number, _text?: string): void;
|
|
|
172
181
|
* Retraction semantics (server): the header's prior value is snapshotted at
|
|
173
182
|
* write time and restored when the owning scope is disposed (deleted if
|
|
174
183
|
* there was none) — a boundary that errors or recovers retracts its writes.
|
|
175
|
-
* Once the
|
|
176
|
-
*
|
|
184
|
+
* Once the response head is `committed` (head derived/sent — the shell
|
|
185
|
+
* flush of a piped `renderToStream`, the completion of an awaited one,
|
|
186
|
+
* `createSSRResponse` for a `renderToString` result), writes and
|
|
187
|
+
* retractions are no-ops.
|
|
177
188
|
*/
|
|
178
189
|
export declare function httpHeader(_name: string, _value: string, _options?: {
|
|
179
190
|
append?: boolean;
|
|
@@ -13,14 +13,28 @@ export { For, Show, Loading, Reveal, Switch, Match, Repeat, Errored, NoHydration
|
|
|
13
13
|
export declare const isServer: boolean;
|
|
14
14
|
/**
|
|
15
15
|
* Build-time constant indicating whether code is running in a dev build.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* Set by `_SOLID_DEV_` substitution per artifact, exactly like the client
|
|
17
|
+
* entry: `dist/server.dev.*` (the `development` export condition) → `true`,
|
|
18
|
+
* `dist/server.*` → `false`. The server runtime's own `_SOLID_DEV_` gates are
|
|
19
|
+
* replaced by the same pass, so this flag and the bundle's internal behavior
|
|
20
|
+
* cannot disagree.
|
|
18
21
|
*/
|
|
19
22
|
export declare const isDev: boolean;
|
|
20
23
|
export type IntrinsicElement = Extract<keyof JSX.IntrinsicElements, string>;
|
|
21
24
|
export type ValidComponent = IntrinsicElement | Component<any> | (string & {});
|
|
22
25
|
export type ComponentProps<T extends ValidComponent> = T extends Component<infer P> ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : Record<string, unknown>;
|
|
23
|
-
export
|
|
26
|
+
export interface DynamicOptions {
|
|
27
|
+
/**
|
|
28
|
+
* SSR only: hold the document's first flush until the source settles, so
|
|
29
|
+
* the resolved component renders into the shell instead of streaming in
|
|
30
|
+
* behind its boundary's fallback. Same meaning as `createMemo`'s
|
|
31
|
+
* `deferStream`. Default `false` — a `dynamic()` source is data of unknown
|
|
32
|
+
* cost and streams by default (a code-split `lazy()` always holds the shell
|
|
33
|
+
* for its module load, since its code is a prerequisite to the render).
|
|
34
|
+
*/
|
|
35
|
+
deferStream?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function dynamic<T extends ValidComponent>(source: () => T | Promise<T> | null | undefined | false, options?: DynamicOptions): Component<ComponentProps<T>>;
|
|
24
38
|
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
25
39
|
[K in keyof P]: P[K];
|
|
26
40
|
} & {
|
|
@@ -90,9 +104,14 @@ export declare function clientOnly<T extends Component<any>>(fn: () => Promise<{
|
|
|
90
104
|
* write without stomping a status a surviving part of the tree legitimately
|
|
91
105
|
* set (e.g. a 404 page whose inner boundary recovers stays a 404), and
|
|
92
106
|
* sibling scopes may dispose in any order (#2984). Both the write and the
|
|
93
|
-
* cleanup are no-ops once the
|
|
94
|
-
*
|
|
95
|
-
*
|
|
107
|
+
* cleanup are no-ops once the response head is `committed` (head
|
|
108
|
+
* derived/sent — status can no longer change). The head commits when it
|
|
109
|
+
* freezes: at shell flush for a piped `renderToStream` (`createSSRResponse`
|
|
110
|
+
* commits on the first write), at completion for an awaited one (the render
|
|
111
|
+
* commits right before its final dispose, so the declarations still live at
|
|
112
|
+
* that point are the ones the consumer derives the head from), and when
|
|
113
|
+
* `createSSRResponse` receives a `renderToString` result. On the client this
|
|
114
|
+
* is a no-op.
|
|
96
115
|
*/
|
|
97
116
|
export declare function httpStatus(code: number, text?: string): void;
|
|
98
117
|
/**
|
|
@@ -116,9 +135,12 @@ export declare function httpStatus(code: number, text?: string): void;
|
|
|
116
135
|
* multiple values must survive as separate entries — the base is captured
|
|
117
136
|
* and replayed entry-exact (`getSetCookie()` + re-append; `get()`/`set()`
|
|
118
137
|
* would comma-join the entries and then collapse them into one corrupt
|
|
119
|
-
* header). Both the write and the cleanup are no-ops once the
|
|
120
|
-
*
|
|
121
|
-
*
|
|
138
|
+
* header). Both the write and the cleanup are no-ops once the response head
|
|
139
|
+
* is `committed` (head derived/sent — headers can no longer change); the
|
|
140
|
+
* head commits when it freezes — shell flush for a piped `renderToStream`,
|
|
141
|
+
* completion (right before the final dispose) for an awaited one,
|
|
142
|
+
* `createSSRResponse` for a `renderToString` result — see `httpStatus`. On
|
|
143
|
+
* the client this is a no-op.
|
|
122
144
|
*/
|
|
123
145
|
export declare function httpHeader(name: string, value: string, options?: {
|
|
124
146
|
append?: boolean;
|
package/types-cjs/render.d.cts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** Dev: remember the element the running binding effect writes (first one wins). */
|
|
2
|
+
export declare function tagElement(node: Node): void;
|
|
3
|
+
export declare function effect<T>(fn: (prev?: T) => T, effectFn: (value: T, prev?: T) => void | (() => void), options?: {
|
|
2
4
|
scope?: boolean;
|
|
3
5
|
}): void;
|
|
4
6
|
export declare function memo<T>(fn: () => T): () => T;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function setFlashSecret(secret: any): void;
|
|
1
2
|
/**
|
|
2
3
|
* The outcome of a call made without the client runtime, as it rides the
|
|
3
4
|
* flash cookie: what was submitted, where, and what came back. `result` and
|
|
@@ -7,7 +8,15 @@
|
|
|
7
8
|
export interface FlashSubmission {
|
|
8
9
|
/** The arguments the call was made with (files are dropped). */
|
|
9
10
|
input: any[];
|
|
10
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* The call's url: the UNBOUND function base — the server function
|
|
13
|
+
* request's pathname (`<endpoint>/<id>`), without the `?args=` query a
|
|
14
|
+
* `.with()`-bound form's action carries (or any other query decoration).
|
|
15
|
+
* Matches what the scripted road records as a submission's url, so
|
|
16
|
+
* integrations can match flash and scripted submissions with the same
|
|
17
|
+
* `s.url === fn.base` test; bound arguments arrive in `input` instead,
|
|
18
|
+
* prepended exactly like a scripted call's.
|
|
19
|
+
*/
|
|
11
20
|
url: string;
|
|
12
21
|
/** The returned value, when the call returned. */
|
|
13
22
|
result?: any;
|
|
@@ -23,5 +32,5 @@ export interface FlashSubmission {
|
|
|
23
32
|
*/
|
|
24
33
|
truncated?: boolean;
|
|
25
34
|
}
|
|
26
|
-
export declare function encodeFlashCookie(url: string, result: any, input: any[], thrown?: boolean): string
|
|
27
|
-
export declare function decodeFlashCookie(cookieHeader: string | null): FlashSubmission | undefined
|
|
35
|
+
export declare function encodeFlashCookie(url: string, result: any, input: any[], thrown?: boolean): Promise<string | null>;
|
|
36
|
+
export declare function decodeFlashCookie(cookieHeader: string | null): Promise<FlashSubmission | undefined>;
|