@solidjs/web 2.0.0-rc.7 → 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.dev.js +15 -2
- package/dist/server.js +15 -2
- package/dist/web.dev.js +41 -9
- package/dist/web.js +39 -8
- package/dist/{web.cjs → web.observe.js} +137 -239
- package/frames/dist/server.dev.js +19 -0
- package/frames/dist/server.js +19 -0
- package/frames/package.json +6 -24
- package/package.json +81 -314
- package/serialization/decode/package.json +3 -9
- package/serialization/package.json +3 -9
- package/serialization/types/serializer-decode.d.ts +49 -2
- package/server-functions/dist/server.dev.js +28 -10
- package/server-functions/dist/server.js +28 -10
- 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 -0
- package/types/frames/serializer-decode.d.ts +49 -2
- package/types/serializer-decode.d.ts +49 -2
- package/types/server-functions/server.d.ts +27 -4
- package/types/server.d.ts +1 -1
- package/dist/server.cjs +0 -3708
- package/dist/server.dev.cjs +0 -3794
- package/dist/web.dev.cjs +0 -2285
- package/frames/dist/client.cjs +0 -2043
- package/frames/dist/client.dev.cjs +0 -2063
- package/frames/dist/server.cjs +0 -4542
- package/frames/dist/server.dev.cjs +0 -4584
- package/serialization/dist/decode.cjs +0 -155
- package/serialization/dist/serialization.cjs +0 -275
- 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 -1069
- package/server-functions/dist/rich-args.cjs +0 -11
- package/server-functions/dist/server.cjs +0 -2381
- package/server-functions/dist/server.dev.cjs +0 -2409
- 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-cjs/client.d.cts +0 -197
- 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 -19
- package/types-cjs/index.d.cts +0 -191
- package/types-cjs/index.server.d.cts +0 -147
- 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/reconcile.d.cts +0 -1
- package/types-cjs/render.d.cts +0 -6
- 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 -36
- 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 -546
- package/types-cjs/server-functions/shared.d.cts +0 -283
- package/types-cjs/server-mock.d.cts +0 -337
- package/types-cjs/server.d.cts +0 -408
|
@@ -600,6 +600,7 @@ function resolveSecret() {
|
|
|
600
600
|
return configuredSecret !== undefined ? configuredSecret : globalThis.__SOLID_SECRET__;
|
|
601
601
|
}
|
|
602
602
|
const FLASH_KEY_DOMAIN = "solid.flash.v1\0";
|
|
603
|
+
const FLASH_KEY_ITERATIONS = 100_000;
|
|
603
604
|
let cachedSecret;
|
|
604
605
|
let cachedKey;
|
|
605
606
|
function resolveFlashKey() {
|
|
@@ -607,8 +608,15 @@ function resolveFlashKey() {
|
|
|
607
608
|
if (typeof secret !== "string" || secret.length === 0) return null;
|
|
608
609
|
if (secret !== cachedSecret) {
|
|
609
610
|
cachedSecret = secret;
|
|
610
|
-
|
|
611
|
-
|
|
611
|
+
const encoder = new TextEncoder();
|
|
612
|
+
cachedKey = crypto.subtle.importKey("raw", encoder.encode(secret), "PBKDF2", false, ["deriveKey"]).then(material => crypto.subtle.deriveKey({
|
|
613
|
+
name: "PBKDF2",
|
|
614
|
+
salt: encoder.encode(FLASH_KEY_DOMAIN),
|
|
615
|
+
iterations: FLASH_KEY_ITERATIONS,
|
|
616
|
+
hash: "SHA-256"
|
|
617
|
+
}, material, {
|
|
618
|
+
name: "AES-GCM",
|
|
619
|
+
length: 256
|
|
612
620
|
}, false, ["encrypt", "decrypt"]));
|
|
613
621
|
}
|
|
614
622
|
return cachedKey;
|
|
@@ -983,9 +991,13 @@ function bindDeferredBody(value, scope) {
|
|
|
983
991
|
}
|
|
984
992
|
return value;
|
|
985
993
|
}
|
|
986
|
-
|
|
987
|
-
const
|
|
988
|
-
|
|
994
|
+
function processState(key, create) {
|
|
995
|
+
const slot = Symbol.for(key);
|
|
996
|
+
return globalThis[slot] || (globalThis[slot] = create());
|
|
997
|
+
}
|
|
998
|
+
const REGISTRATIONS = processState("solid.ServerFunctionRegistrations", () => new Map());
|
|
999
|
+
const METHODS = processState("solid.ServerFunctionMethods", () => new Map());
|
|
1000
|
+
const REFERENCE_BINDINGS = processState("solid.ServerFunctionReferenceBindings", () => new WeakMap());
|
|
989
1001
|
function declaresRead(id) {
|
|
990
1002
|
const granted = METHODS.get(id);
|
|
991
1003
|
return granted !== undefined && granted === REGISTRATIONS.get(id);
|
|
@@ -1263,7 +1275,13 @@ async function bufferBodyWithin(request, limit) {
|
|
|
1263
1275
|
body.set(chunk, offset);
|
|
1264
1276
|
offset += chunk.byteLength;
|
|
1265
1277
|
}
|
|
1266
|
-
return
|
|
1278
|
+
return body;
|
|
1279
|
+
}
|
|
1280
|
+
function withBufferedBody(request, body) {
|
|
1281
|
+
return new Request(request.url, {
|
|
1282
|
+
method: request.method,
|
|
1283
|
+
headers: request.headers,
|
|
1284
|
+
signal: request.signal,
|
|
1267
1285
|
body
|
|
1268
1286
|
});
|
|
1269
1287
|
}
|
|
@@ -2078,22 +2096,22 @@ async function handleServerFunctionRequest(request, options = {}) {
|
|
|
2078
2096
|
});
|
|
2079
2097
|
return finalizeTransportResponse(protectsRequest ? withCSRFVary(response) : response, method);
|
|
2080
2098
|
}
|
|
2081
|
-
let
|
|
2099
|
+
let buffered;
|
|
2082
2100
|
try {
|
|
2083
|
-
|
|
2101
|
+
buffered = await bufferBodyWithin(request, bodySizeLimit);
|
|
2084
2102
|
} catch {
|
|
2085
2103
|
const response = new Response(DEV ? "Malformed server function arguments" : null, {
|
|
2086
2104
|
status: 400
|
|
2087
2105
|
});
|
|
2088
2106
|
return finalizeTransportResponse(protectsRequest ? withCSRFVary(response) : response, method);
|
|
2089
2107
|
}
|
|
2090
|
-
if (
|
|
2108
|
+
if (buffered === null) {
|
|
2091
2109
|
const response = new Response(DEV ? "Server function request body exceeds the configured bodySizeLimit" : null, {
|
|
2092
2110
|
status: 413
|
|
2093
2111
|
});
|
|
2094
2112
|
return finalizeTransportResponse(protectsRequest ? withCSRFVary(response) : response, method);
|
|
2095
2113
|
}
|
|
2096
|
-
request =
|
|
2114
|
+
request = withBufferedBody(request, buffered);
|
|
2097
2115
|
}
|
|
2098
2116
|
let event;
|
|
2099
2117
|
try {
|
|
@@ -580,6 +580,7 @@ function resolveSecret() {
|
|
|
580
580
|
return configuredSecret !== undefined ? configuredSecret : globalThis.__SOLID_SECRET__;
|
|
581
581
|
}
|
|
582
582
|
const FLASH_KEY_DOMAIN = "solid.flash.v1\0";
|
|
583
|
+
const FLASH_KEY_ITERATIONS = 100_000;
|
|
583
584
|
let cachedSecret;
|
|
584
585
|
let cachedKey;
|
|
585
586
|
function resolveFlashKey() {
|
|
@@ -587,8 +588,15 @@ function resolveFlashKey() {
|
|
|
587
588
|
if (typeof secret !== "string" || secret.length === 0) return null;
|
|
588
589
|
if (secret !== cachedSecret) {
|
|
589
590
|
cachedSecret = secret;
|
|
590
|
-
|
|
591
|
-
|
|
591
|
+
const encoder = new TextEncoder();
|
|
592
|
+
cachedKey = crypto.subtle.importKey("raw", encoder.encode(secret), "PBKDF2", false, ["deriveKey"]).then(material => crypto.subtle.deriveKey({
|
|
593
|
+
name: "PBKDF2",
|
|
594
|
+
salt: encoder.encode(FLASH_KEY_DOMAIN),
|
|
595
|
+
iterations: FLASH_KEY_ITERATIONS,
|
|
596
|
+
hash: "SHA-256"
|
|
597
|
+
}, material, {
|
|
598
|
+
name: "AES-GCM",
|
|
599
|
+
length: 256
|
|
592
600
|
}, false, ["encrypt", "decrypt"]));
|
|
593
601
|
}
|
|
594
602
|
return cachedKey;
|
|
@@ -955,9 +963,13 @@ function bindDeferredBody(value, scope) {
|
|
|
955
963
|
}
|
|
956
964
|
return value;
|
|
957
965
|
}
|
|
958
|
-
|
|
959
|
-
const
|
|
960
|
-
|
|
966
|
+
function processState(key, create) {
|
|
967
|
+
const slot = Symbol.for(key);
|
|
968
|
+
return globalThis[slot] || (globalThis[slot] = create());
|
|
969
|
+
}
|
|
970
|
+
const REGISTRATIONS = processState("solid.ServerFunctionRegistrations", () => new Map());
|
|
971
|
+
const METHODS = processState("solid.ServerFunctionMethods", () => new Map());
|
|
972
|
+
const REFERENCE_BINDINGS = processState("solid.ServerFunctionReferenceBindings", () => new WeakMap());
|
|
961
973
|
function declaresRead(id) {
|
|
962
974
|
const granted = METHODS.get(id);
|
|
963
975
|
return granted !== undefined && granted === REGISTRATIONS.get(id);
|
|
@@ -1235,7 +1247,13 @@ async function bufferBodyWithin(request, limit) {
|
|
|
1235
1247
|
body.set(chunk, offset);
|
|
1236
1248
|
offset += chunk.byteLength;
|
|
1237
1249
|
}
|
|
1238
|
-
return
|
|
1250
|
+
return body;
|
|
1251
|
+
}
|
|
1252
|
+
function withBufferedBody(request, body) {
|
|
1253
|
+
return new Request(request.url, {
|
|
1254
|
+
method: request.method,
|
|
1255
|
+
headers: request.headers,
|
|
1256
|
+
signal: request.signal,
|
|
1239
1257
|
body
|
|
1240
1258
|
});
|
|
1241
1259
|
}
|
|
@@ -2050,22 +2068,22 @@ async function handleServerFunctionRequest(request, options = {}) {
|
|
|
2050
2068
|
});
|
|
2051
2069
|
return finalizeTransportResponse(protectsRequest ? withCSRFVary(response) : response, method);
|
|
2052
2070
|
}
|
|
2053
|
-
let
|
|
2071
|
+
let buffered;
|
|
2054
2072
|
try {
|
|
2055
|
-
|
|
2073
|
+
buffered = await bufferBodyWithin(request, bodySizeLimit);
|
|
2056
2074
|
} catch {
|
|
2057
2075
|
const response = new Response(DEV ? "Malformed server function arguments" : null, {
|
|
2058
2076
|
status: 400
|
|
2059
2077
|
});
|
|
2060
2078
|
return finalizeTransportResponse(protectsRequest ? withCSRFVary(response) : response, method);
|
|
2061
2079
|
}
|
|
2062
|
-
if (
|
|
2080
|
+
if (buffered === null) {
|
|
2063
2081
|
const response = new Response(DEV ? "Server function request body exceeds the configured bodySizeLimit" : null, {
|
|
2064
2082
|
status: 413
|
|
2065
2083
|
});
|
|
2066
2084
|
return finalizeTransportResponse(protectsRequest ? withCSRFVary(response) : response, method);
|
|
2067
2085
|
}
|
|
2068
|
-
request =
|
|
2086
|
+
request = withBufferedBody(request, buffered);
|
|
2069
2087
|
}
|
|
2070
2088
|
let event;
|
|
2071
2089
|
try {
|
|
@@ -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
|
@@ -140,6 +140,23 @@ export declare function style(node: Element, value: {
|
|
|
140
140
|
}, prev?: {
|
|
141
141
|
[k: string]: string;
|
|
142
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;
|
|
143
160
|
export declare function setStyleProperty(node: Element, name: string, value: any): void;
|
|
144
161
|
export declare function spread<T>(node: Element, accessor: T, skipChildren?: Boolean): void;
|
|
145
162
|
export declare function dynamicProperty(props: unknown, key: string): unknown;
|
|
@@ -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
|
}; /**
|
|
@@ -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
|
}; /**
|
|
@@ -277,10 +277,24 @@ export interface ServerFunctionsServerConfig {
|
|
|
277
277
|
* back to the one the Solid bundler plugin injects into the server build
|
|
278
278
|
* (a fresh value per build), and with neither present the outcome is
|
|
279
279
|
* simply not flashed — the form post still redirects cleanly, and dev
|
|
280
|
-
* builds warn once.
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
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".
|
|
284
298
|
*/
|
|
285
299
|
secret?: string;
|
|
286
300
|
}
|
|
@@ -329,6 +343,15 @@ export interface HandleServerFunctionOptions {
|
|
|
329
343
|
* Builds the request event a call runs under (default: bare
|
|
330
344
|
* `{ request, locals: {} }`). Integrations supply their richer event
|
|
331
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`.
|
|
332
355
|
*/
|
|
333
356
|
createEvent?(request: Request): ServerFunctionEvent;
|
|
334
357
|
/**
|
package/types/server.d.ts
CHANGED
|
@@ -404,5 +404,5 @@ export declare function composeMiddleware(middlewares: FetchMiddleware[]): (requ
|
|
|
404
404
|
export declare function registerElementClaim(handler: (element: Element) => void): () => void;
|
|
405
405
|
export declare function claimElement<T extends Element>(node: T): T;
|
|
406
406
|
export declare function claimElementTree<T extends Node>(root: T): T;
|
|
407
|
-
export { notSup as style, notSup as insert, notSup as spread, notSup as delegateEvents, notSup as registerDelegatedRoot, notSup as unregisterDelegatedRoot, notSup as registerDelegatedContainer, notSup as unregisterDelegatedContainer, notSup as getDelegatedRoot, notSup as dynamicProperty, notSup as setAttribute, notSup as setAttributeNS, notSup as addEvent, notSup as render, notSup as template, notSup as setProperty, notSup as className, notSup as assign, notSup as hydrate, notSup as getNextElement, notSup as getNextMatch, notSup as getNextMarker, notSup as runHydrationEvents, notSup as ref, notSup as setStyleProperty, notSup as acquireAsset };
|
|
407
|
+
export { notSup as style, notSup as insert, notSup as spread, notSup as delegateEvents, notSup as registerDelegatedRoot, notSup as unregisterDelegatedRoot, notSup as registerDelegatedContainer, notSup as unregisterDelegatedContainer, notSup as getDelegatedRoot, notSup as dynamicProperty, notSup as setAttribute, notSup as setAttributeNS, notSup as addEvent, notSup as render, notSup as template, notSup as setProperty, notSup as className, notSup as assign, notSup as hydrate, notSup as getNextElement, notSup as getNextMatch, notSup as getNextMarker, notSup as runHydrationEvents, notSup as ref, notSup as setStyleProperty, notSup as readShallow, notSup as acquireAsset };
|
|
408
408
|
declare function notSup(): void;
|