@solidjs/web 2.0.0-rc.6 → 2.0.0-rc.8
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 → server.dev.js} +274 -272
- package/dist/server.js +119 -36
- package/dist/{dev.js → web.dev.js} +131 -399
- package/dist/web.js +78 -388
- package/dist/{web.cjs → web.observe.js} +174 -622
- package/frames/dist/client.dev.js +11 -3
- package/frames/dist/client.js +11 -3
- package/frames/dist/{server.cjs → server.dev.js} +375 -125
- package/frames/dist/server.js +253 -32
- package/frames/package.json +7 -15
- package/package.json +88 -251
- package/serialization/decode/package.json +3 -9
- package/serialization/dist/decode.js +18 -4
- package/serialization/dist/serialization.js +18 -4
- package/serialization/package.json +3 -9
- package/serialization/types/serializer-decode.d.ts +49 -2
- package/server-functions/dist/client.js +13 -14
- package/server-functions/dist/server.dev.js +359 -85
- package/server-functions/dist/server.js +352 -86
- package/server-functions/package.json +6 -24
- package/server-functions/rich-args/package.json +3 -9
- package/storage/package.json +3 -9
- package/types/client.d.ts +17 -3
- package/types/frames/frame-client.d.ts +1 -1
- package/types/frames/serializer-decode.d.ts +49 -2
- 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/serializer-decode.d.ts +49 -2
- package/types/server-functions/flash.d.ts +12 -3
- package/types/server-functions/server.d.ts +50 -3
- package/types/server-mock.d.ts +43 -7
- package/types/server.d.ts +48 -6
- package/dist/dev.cjs +0 -2590
- package/frames/dist/client.cjs +0 -2035
- package/frames/dist/client.dev.cjs +0 -2055
- package/serialization/dist/decode.cjs +0 -141
- package/serialization/dist/serialization.cjs +0 -261
- package/serialization/types-cjs/index.d.cts +0 -101
- package/serialization/types-cjs/package.json +0 -3
- package/serialization/types-cjs/serializer-decode.d.cts +0 -172
- package/serialization/types-cjs/serializer.d.cts +0 -101
- package/server-functions/dist/client.cjs +0 -1070
- package/server-functions/dist/rich-args.cjs +0 -11
- package/server-functions/dist/server.cjs +0 -2133
- package/server-functions/dist/server.dev.cjs +0 -2153
- 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/patch-driver.d.ts +0 -3
- package/types-cjs/client.d.cts +0 -200
- package/types-cjs/constants.d.cts +0 -20
- package/types-cjs/cookies.d.cts +0 -41
- package/types-cjs/frames/client.d.cts +0 -36
- package/types-cjs/frames/frame-client.d.cts +0 -370
- package/types-cjs/frames/frame-container-plugin.d.cts +0 -71
- package/types-cjs/frames/frame-sink.d.cts +0 -92
- package/types-cjs/frames/frame-transport.d.cts +0 -189
- package/types-cjs/frames/serializer-decode.d.cts +0 -172
- package/types-cjs/frames/serializer.d.cts +0 -101
- package/types-cjs/frames/server.d.cts +0 -52
- package/types-cjs/head.d.cts +0 -16
- package/types-cjs/index.d.cts +0 -180
- package/types-cjs/index.server.d.cts +0 -125
- package/types-cjs/jsx-properties.d.cts +0 -93
- package/types-cjs/jsx.d.cts +0 -4146
- package/types-cjs/package.json +0 -3
- package/types-cjs/patch-driver.d.cts +0 -3
- package/types-cjs/reconcile.d.cts +0 -1
- package/types-cjs/render.d.cts +0 -4
- package/types-cjs/response.d.cts +0 -81
- package/types-cjs/serializer-decode.d.cts +0 -172
- package/types-cjs/serializer.d.cts +0 -101
- package/types-cjs/server-functions/client.d.cts +0 -184
- package/types-cjs/server-functions/flash.d.cts +0 -27
- package/types-cjs/server-functions/registry.d.cts +0 -100
- package/types-cjs/server-functions/rich-args.d.cts +0 -1
- package/types-cjs/server-functions/server.d.cts +0 -522
- package/types-cjs/server-functions/shared.d.cts +0 -283
- package/types-cjs/server-mock.d.cts +0 -301
- package/types-cjs/server.d.cts +0 -366
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/web/server-functions",
|
|
3
|
-
"main": "./dist/server.
|
|
3
|
+
"main": "./dist/server.js",
|
|
4
4
|
"module": "./dist/server.js",
|
|
5
5
|
"types": "../types/server-functions/server.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -8,33 +8,15 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"browser": {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"default": "./dist/client.js"
|
|
14
|
-
},
|
|
15
|
-
"require": {
|
|
16
|
-
"types": "../types-cjs/server-functions/client.d.cts",
|
|
17
|
-
"default": "./dist/client.cjs"
|
|
18
|
-
}
|
|
11
|
+
"types": "../types/server-functions/client.d.ts",
|
|
12
|
+
"default": "./dist/client.js"
|
|
19
13
|
},
|
|
20
14
|
"development": {
|
|
21
|
-
"import": {
|
|
22
|
-
"types": "../types/server-functions/server.d.ts",
|
|
23
|
-
"default": "./dist/server.dev.js"
|
|
24
|
-
},
|
|
25
|
-
"require": {
|
|
26
|
-
"types": "../types-cjs/server-functions/server.d.cts",
|
|
27
|
-
"default": "./dist/server.dev.cjs"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"import": {
|
|
31
15
|
"types": "../types/server-functions/server.d.ts",
|
|
32
|
-
"default": "./dist/server.js"
|
|
16
|
+
"default": "./dist/server.dev.js"
|
|
33
17
|
},
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
"default": "./dist/server.cjs"
|
|
37
|
-
}
|
|
18
|
+
"types": "../types/server-functions/server.d.ts",
|
|
19
|
+
"default": "./dist/server.js"
|
|
38
20
|
}
|
|
39
21
|
}
|
|
40
22
|
}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/web/server-functions/rich-args",
|
|
3
|
-
"main": "../dist/rich-args.
|
|
3
|
+
"main": "../dist/rich-args.js",
|
|
4
4
|
"module": "../dist/rich-args.js",
|
|
5
5
|
"types": "../../types/server-functions/rich-args.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"default": "../dist/rich-args.js"
|
|
13
|
-
},
|
|
14
|
-
"require": {
|
|
15
|
-
"types": "../../types-cjs/server-functions/rich-args.d.cts",
|
|
16
|
-
"default": "../dist/rich-args.cjs"
|
|
17
|
-
}
|
|
10
|
+
"types": "../../types/server-functions/rich-args.d.ts",
|
|
11
|
+
"default": "../dist/rich-args.js"
|
|
18
12
|
}
|
|
19
13
|
}
|
|
20
14
|
}
|
package/storage/package.json
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/web/storage",
|
|
3
|
-
"main": "./dist/storage.
|
|
3
|
+
"main": "./dist/storage.js",
|
|
4
4
|
"module": "./dist/storage.js",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"default": "./dist/storage.js"
|
|
13
|
-
},
|
|
14
|
-
"require": {
|
|
15
|
-
"types": "./types-cjs/index.d.cts",
|
|
16
|
-
"default": "./dist/storage.cjs"
|
|
17
|
-
}
|
|
10
|
+
"types": "./types/index.d.ts",
|
|
11
|
+
"default": "./dist/storage.js"
|
|
18
12
|
}
|
|
19
13
|
}
|
|
20
14
|
}
|
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?: {
|
|
@@ -142,6 +140,23 @@ export declare function style(node: Element, value: {
|
|
|
142
140
|
}, prev?: {
|
|
143
141
|
[k: string]: string;
|
|
144
142
|
}): void;
|
|
143
|
+
/** Compiler-emitted primitive; not for hand-written code. @internal
|
|
144
|
+
*
|
|
145
|
+
* Read an object-valued `style` / `class` binding ONE layer deep, TRACKED, in
|
|
146
|
+
* the compute half of its effect. (Not solid-js's `snapshot()`, which is a
|
|
147
|
+
* deep, untracked structural copy.) `style()` and `className()` enumerate their object in the
|
|
148
|
+
* effect's untracked commit phase, so a proxy-backed object (a store
|
|
149
|
+
* sub-object, merged props) was identity-reactive only: in-place key
|
|
150
|
+
* mutations never re-applied and every leaf read tripped
|
|
151
|
+
* STRICT_READ_UNTRACKED in dev. The compiler wraps the compute value of a
|
|
152
|
+
* non-inline `style={expr}` / `class={expr}` in this; spread() applies it to
|
|
153
|
+
* those two keys as it copies. Inline literals never get here — they compile
|
|
154
|
+
* per property. Identity passthrough for strings and plain objects (a fresh
|
|
155
|
+
* literal is already the compute's own); a proxy is copied with ONE
|
|
156
|
+
* `ownKeys` trap (its own trap keeps the key set tracked) plus one tracked
|
|
157
|
+
* read per key; a clsx-style class array is re-mapped element-wise (className
|
|
158
|
+
* allocates for an array anyway; measured at parity). */
|
|
159
|
+
export declare function readShallow(value: unknown): unknown;
|
|
145
160
|
export declare function setStyleProperty(node: Element, name: string, value: any): void;
|
|
146
161
|
export declare function spread<T>(node: Element, accessor: T, skipChildren?: Boolean): void;
|
|
147
162
|
export declare function dynamicProperty(props: unknown, key: string): unknown;
|
|
@@ -149,7 +164,6 @@ export declare function applyRef<T extends Element = Element>(r: ((element: NoIn
|
|
|
149
164
|
export declare function ref(fn: () => ((element: Element) => void) | ((element: Element) => void)[], element: Element): void;
|
|
150
165
|
/** Compiler-emitted primitive; not for hand-written code. @internal */
|
|
151
166
|
export declare function scope<T extends () => any>(fn: T): T;
|
|
152
|
-
export declare function getInsertionParent(): Node | undefined;
|
|
153
167
|
export declare function installHydrationRuntime(): void;
|
|
154
168
|
/**
|
|
155
169
|
* Compiler-emitted primitive; not for hand-written code.
|
|
@@ -145,7 +145,54 @@ export interface JSONDataTable {
|
|
|
145
145
|
* and deserialize halves, so the set lives on the decode side and the
|
|
146
146
|
* encode module composes over it.
|
|
147
147
|
*/
|
|
148
|
-
export declare const DEFAULT_WEB_PLUGINS:
|
|
148
|
+
export declare const DEFAULT_WEB_PLUGINS: readonly ({
|
|
149
|
+
tag: string;
|
|
150
|
+
test(value: any): boolean;
|
|
151
|
+
parse: {
|
|
152
|
+
sync(): never;
|
|
153
|
+
async(value: any, ctx: any): Promise<{
|
|
154
|
+
a: number;
|
|
155
|
+
i: any;
|
|
156
|
+
}>;
|
|
157
|
+
stream: (value: any, ctx: any) => {
|
|
158
|
+
a: number;
|
|
159
|
+
i: any;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
serialize(node: any, ctx: any): string;
|
|
163
|
+
deserialize(node: any, ctx: any): any;
|
|
164
|
+
} | import("seroval").Plugin<AbortSignal, {
|
|
165
|
+
reason?: import("seroval").SerovalNode;
|
|
166
|
+
controller?: import("seroval").SerovalNode;
|
|
167
|
+
factory?: import("seroval").SerovalNode;
|
|
168
|
+
}> | import("seroval").Plugin<CustomEvent<any>, {
|
|
169
|
+
type: import("seroval").SerovalNode;
|
|
170
|
+
options: import("seroval").SerovalNode;
|
|
171
|
+
}> | import("seroval").Plugin<DOMException, {
|
|
172
|
+
name: import("seroval").SerovalNode;
|
|
173
|
+
message: import("seroval").SerovalNode;
|
|
174
|
+
}> | import("seroval").Plugin<Event, {
|
|
175
|
+
type: import("seroval").SerovalNode;
|
|
176
|
+
options: import("seroval").SerovalNode;
|
|
177
|
+
}> | import("seroval").Plugin<FormData, {
|
|
178
|
+
factory: import("seroval").SerovalNode;
|
|
179
|
+
entries: import("seroval").SerovalNode;
|
|
180
|
+
}> | import("seroval").Plugin<Headers, {
|
|
181
|
+
value: import("seroval").SerovalNode;
|
|
182
|
+
}> | import("seroval").Plugin<ReadableStream<any>, {
|
|
183
|
+
factory: import("seroval").SerovalNode;
|
|
184
|
+
stream: import("seroval").SerovalNode;
|
|
185
|
+
}> | import("seroval").Plugin<Request, {
|
|
186
|
+
url: import("seroval").SerovalNode;
|
|
187
|
+
options: import("seroval").SerovalNode;
|
|
188
|
+
}> | import("seroval").Plugin<Response, {
|
|
189
|
+
body: import("seroval").SerovalNode;
|
|
190
|
+
options: import("seroval").SerovalNode;
|
|
191
|
+
}> | import("seroval").Plugin<URLSearchParams, {
|
|
192
|
+
value: import("seroval").SerovalNode;
|
|
193
|
+
}> | import("seroval").Plugin<URL, {
|
|
194
|
+
value: import("seroval").SerovalNode;
|
|
195
|
+
}>)[]; /**
|
|
149
196
|
* Composes custom plugins with `DEFAULT_WEB_PLUGINS`. Custom plugins come
|
|
150
197
|
* first so they can shadow a default for values both would match. Returns a
|
|
151
198
|
* fresh array; the defaults are never mutated. Useful when handing a full
|
|
@@ -156,7 +203,7 @@ export declare const DEFAULT_WEB_PLUGINS: any; /**
|
|
|
156
203
|
export declare function resolveSerializerPlugins(customPlugins?: SerializerPlugin[]): SerializerPlugin[];
|
|
157
204
|
export declare function resolveCodecOptions({ plugins, disabledFeatures, depthLimit, serializeErrorStacks }?: JSONCodecOptions): {
|
|
158
205
|
plugins: SerializerPlugin<any, any>[];
|
|
159
|
-
disabledFeatures:
|
|
206
|
+
disabledFeatures: number;
|
|
160
207
|
depthLimit: number;
|
|
161
208
|
serializeErrorStacks: boolean;
|
|
162
209
|
}; /**
|
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;
|
|
@@ -145,7 +145,54 @@ export interface JSONDataTable {
|
|
|
145
145
|
* and deserialize halves, so the set lives on the decode side and the
|
|
146
146
|
* encode module composes over it.
|
|
147
147
|
*/
|
|
148
|
-
export declare const DEFAULT_WEB_PLUGINS:
|
|
148
|
+
export declare const DEFAULT_WEB_PLUGINS: readonly ({
|
|
149
|
+
tag: string;
|
|
150
|
+
test(value: any): boolean;
|
|
151
|
+
parse: {
|
|
152
|
+
sync(): never;
|
|
153
|
+
async(value: any, ctx: any): Promise<{
|
|
154
|
+
a: number;
|
|
155
|
+
i: any;
|
|
156
|
+
}>;
|
|
157
|
+
stream: (value: any, ctx: any) => {
|
|
158
|
+
a: number;
|
|
159
|
+
i: any;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
serialize(node: any, ctx: any): string;
|
|
163
|
+
deserialize(node: any, ctx: any): any;
|
|
164
|
+
} | import("seroval").Plugin<AbortSignal, {
|
|
165
|
+
reason?: import("seroval").SerovalNode;
|
|
166
|
+
controller?: import("seroval").SerovalNode;
|
|
167
|
+
factory?: import("seroval").SerovalNode;
|
|
168
|
+
}> | import("seroval").Plugin<CustomEvent<any>, {
|
|
169
|
+
type: import("seroval").SerovalNode;
|
|
170
|
+
options: import("seroval").SerovalNode;
|
|
171
|
+
}> | import("seroval").Plugin<DOMException, {
|
|
172
|
+
name: import("seroval").SerovalNode;
|
|
173
|
+
message: import("seroval").SerovalNode;
|
|
174
|
+
}> | import("seroval").Plugin<Event, {
|
|
175
|
+
type: import("seroval").SerovalNode;
|
|
176
|
+
options: import("seroval").SerovalNode;
|
|
177
|
+
}> | import("seroval").Plugin<FormData, {
|
|
178
|
+
factory: import("seroval").SerovalNode;
|
|
179
|
+
entries: import("seroval").SerovalNode;
|
|
180
|
+
}> | import("seroval").Plugin<Headers, {
|
|
181
|
+
value: import("seroval").SerovalNode;
|
|
182
|
+
}> | import("seroval").Plugin<ReadableStream<any>, {
|
|
183
|
+
factory: import("seroval").SerovalNode;
|
|
184
|
+
stream: import("seroval").SerovalNode;
|
|
185
|
+
}> | import("seroval").Plugin<Request, {
|
|
186
|
+
url: import("seroval").SerovalNode;
|
|
187
|
+
options: import("seroval").SerovalNode;
|
|
188
|
+
}> | import("seroval").Plugin<Response, {
|
|
189
|
+
body: import("seroval").SerovalNode;
|
|
190
|
+
options: import("seroval").SerovalNode;
|
|
191
|
+
}> | import("seroval").Plugin<URLSearchParams, {
|
|
192
|
+
value: import("seroval").SerovalNode;
|
|
193
|
+
}> | import("seroval").Plugin<URL, {
|
|
194
|
+
value: import("seroval").SerovalNode;
|
|
195
|
+
}>)[]; /**
|
|
149
196
|
* Composes custom plugins with `DEFAULT_WEB_PLUGINS`. Custom plugins come
|
|
150
197
|
* first so they can shadow a default for values both would match. Returns a
|
|
151
198
|
* fresh array; the defaults are never mutated. Useful when handing a full
|
|
@@ -156,7 +203,7 @@ export declare const DEFAULT_WEB_PLUGINS: any; /**
|
|
|
156
203
|
export declare function resolveSerializerPlugins(customPlugins?: SerializerPlugin[]): SerializerPlugin[];
|
|
157
204
|
export declare function resolveCodecOptions({ plugins, disabledFeatures, depthLimit, serializeErrorStacks }?: JSONCodecOptions): {
|
|
158
205
|
plugins: SerializerPlugin<any, any>[];
|
|
159
|
-
disabledFeatures:
|
|
206
|
+
disabledFeatures: number;
|
|
160
207
|
depthLimit: number;
|
|
161
208
|
serializeErrorStacks: boolean;
|
|
162
209
|
}; /**
|
|
@@ -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,39 @@ 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.
|
|
281
|
+
*
|
|
282
|
+
* Use a HIGH-ENTROPY value, 32 bytes or more, and keep it out of source
|
|
283
|
+
* control:
|
|
284
|
+
*
|
|
285
|
+
* ```sh
|
|
286
|
+
* node -e "console.log(crypto.randomBytes(32).toString('base64url'))"
|
|
287
|
+
* ```
|
|
288
|
+
*
|
|
289
|
+
* A captured cookie is an offline oracle for this value. Key derivation
|
|
290
|
+
* stretches it (PBKDF2-HMAC-SHA-256), which raises the price of a guess
|
|
291
|
+
* but does not make a guessable secret safe, and recovering it means
|
|
292
|
+
* reading every flash payload and forging new ones. A passphrase, an app
|
|
293
|
+
* name, or anything else a person would think up is not enough.
|
|
294
|
+
*
|
|
295
|
+
* Rotating it (or redeploying with the plugin's value) invalidates
|
|
296
|
+
* in-flight flashes. They are 60-second one-shot cookies, so the next
|
|
297
|
+
* render reads "no flash".
|
|
298
|
+
*/
|
|
299
|
+
secret?: string;
|
|
267
300
|
}
|
|
268
301
|
/**
|
|
269
302
|
* A registered server function: its build-stable id paired with the
|
|
@@ -310,6 +343,15 @@ export interface HandleServerFunctionOptions {
|
|
|
310
343
|
* Builds the request event a call runs under (default: bare
|
|
311
344
|
* `{ request, locals: {} }`). Integrations supply their richer event
|
|
312
345
|
* (cookies, response helpers, platform handles).
|
|
346
|
+
*
|
|
347
|
+
* `request` is a standards-shaped `Request` — url, method, headers,
|
|
348
|
+
* signal, readable body — and nothing more. Enforcing `bodySizeLimit`
|
|
349
|
+
* puts the runtime between the host's stream and the decoder, so the
|
|
350
|
+
* object handed here may be one the runtime rebuilt; host-specific
|
|
351
|
+
* fields on the inbound object (`request.cf`, srvx's `runtime`, `ip`,
|
|
352
|
+
* `waitUntil`) are not carried. The host has its own request in closure
|
|
353
|
+
* when it calls the handler: read platform handles there and put them on
|
|
354
|
+
* the event (`locals`) rather than through `request`.
|
|
313
355
|
*/
|
|
314
356
|
createEvent?(request: Request): ServerFunctionEvent;
|
|
315
357
|
/**
|
|
@@ -320,8 +362,13 @@ export interface HandleServerFunctionOptions {
|
|
|
320
362
|
/**
|
|
321
363
|
* Overrides the configured per-invocation wrap for this handler — same
|
|
322
364
|
* contract as the `wrapInvocation` config option (see
|
|
323
|
-
* `WrapInvocationHook`), except it
|
|
324
|
-
*
|
|
365
|
+
* `WrapInvocationHook`), except it is ENTRY-ONLY: it wraps exactly the
|
|
366
|
+
* invocation the request addressed. Nested direct server-function calls
|
|
367
|
+
* made by the dispatched body are not re-wrapped by it — they consult
|
|
368
|
+
* only the configured hook, which is ambient and wraps every direct call
|
|
369
|
+
* (a per-request option can't see direct SSR calls). Policy that must
|
|
370
|
+
* cover every hop belongs on `configureServerFunctionsServer`'s
|
|
371
|
+
* `wrapInvocation`, not here.
|
|
325
372
|
*/
|
|
326
373
|
wrapInvocation?: WrapInvocationHook;
|
|
327
374
|
/**
|
|
@@ -422,7 +469,7 @@ export declare function live<A extends readonly any[], R>(fn: (...args: A) => R)
|
|
|
422
469
|
export declare function getServerFunctionInvocation(): ServerFunctionInvocation | undefined;
|
|
423
470
|
export declare function getEventServerFunctionInvocation(event: RequestEvent | undefined): ServerFunctionInvocation | undefined;
|
|
424
471
|
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
|
|
472
|
+
export declare function createNoJSHandler(options?: NoJSHandlerOptions): (result: unknown, request: Request, args: unknown[], thrown?: boolean) => Promise<Response>;
|
|
426
473
|
/** @internal */
|
|
427
474
|
export declare function guardFailures(value: any, state: any): any;
|
|
428
475
|
/**
|
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 {};
|