@solidjs/web 2.0.0-rc.3 → 2.0.0-rc.5

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.
Files changed (65) hide show
  1. package/dist/dev.cjs +398 -17
  2. package/dist/dev.js +396 -19
  3. package/dist/server.cjs +166 -38
  4. package/dist/server.js +165 -39
  5. package/dist/web.cjs +369 -17
  6. package/dist/web.js +367 -19
  7. package/frames/dist/client.cjs +41 -8
  8. package/frames/dist/client.dev.cjs +41 -8
  9. package/frames/dist/client.dev.js +41 -8
  10. package/frames/dist/client.js +41 -8
  11. package/frames/dist/server.cjs +432 -44
  12. package/frames/dist/server.js +432 -44
  13. package/package.json +2 -2
  14. package/serialization/dist/decode.cjs +4 -2
  15. package/serialization/dist/decode.js +4 -2
  16. package/serialization/dist/serialization.cjs +12 -8
  17. package/serialization/dist/serialization.js +12 -8
  18. package/serialization/types/index.d.ts +7 -0
  19. package/serialization/types/serializer-decode.d.ts +14 -1
  20. package/serialization/types/serializer.d.ts +7 -0
  21. package/serialization/types-cjs/index.d.cts +7 -0
  22. package/serialization/types-cjs/serializer-decode.d.cts +14 -1
  23. package/serialization/types-cjs/serializer.d.cts +7 -0
  24. package/server-functions/dist/client.cjs +271 -47
  25. package/server-functions/dist/client.js +264 -47
  26. package/server-functions/dist/server.cjs +872 -131
  27. package/server-functions/dist/server.dev.cjs +892 -131
  28. package/server-functions/dist/server.dev.js +884 -131
  29. package/server-functions/dist/server.js +864 -131
  30. package/types/client.d.ts +4 -2
  31. package/types/cookies.d.ts +6 -14
  32. package/types/frames/frame-client.d.ts +4 -0
  33. package/types/frames/serializer-decode.d.ts +14 -1
  34. package/types/frames/serializer.d.ts +7 -0
  35. package/types/index.d.ts +1 -0
  36. package/types/jsx.d.ts +11 -16
  37. package/types/patch-driver.d.ts +3 -0
  38. package/types/response.d.ts +20 -1
  39. package/types/serializer-decode.d.ts +14 -1
  40. package/types/serializer.d.ts +7 -0
  41. package/types/server-functions/client.d.ts +58 -7
  42. package/types/server-functions/flash.d.ts +9 -0
  43. package/types/server-functions/registry.d.ts +38 -1
  44. package/types/server-functions/server.d.ts +66 -14
  45. package/types/server-functions/shared.d.ts +122 -16
  46. package/types/server-mock.d.ts +17 -2
  47. package/types/server.d.ts +16 -2
  48. package/types-cjs/client.d.cts +4 -2
  49. package/types-cjs/cookies.d.cts +6 -14
  50. package/types-cjs/frames/frame-client.d.cts +4 -0
  51. package/types-cjs/frames/serializer-decode.d.cts +14 -1
  52. package/types-cjs/frames/serializer.d.cts +7 -0
  53. package/types-cjs/index.d.cts +1 -0
  54. package/types-cjs/jsx.d.cts +11 -16
  55. package/types-cjs/patch-driver.d.cts +3 -0
  56. package/types-cjs/response.d.cts +20 -1
  57. package/types-cjs/serializer-decode.d.cts +14 -1
  58. package/types-cjs/serializer.d.cts +7 -0
  59. package/types-cjs/server-functions/client.d.cts +58 -7
  60. package/types-cjs/server-functions/flash.d.cts +9 -0
  61. package/types-cjs/server-functions/registry.d.cts +38 -1
  62. package/types-cjs/server-functions/server.d.cts +66 -14
  63. package/types-cjs/server-functions/shared.d.cts +122 -16
  64. package/types-cjs/server-mock.d.cts +17 -2
  65. package/types-cjs/server.d.cts +16 -2
@@ -1,4 +1,4 @@
1
- export { LIVE_SOURCE, SERVER_FUNCTION_METADATA, getServerFunctionMetadata, getServerFunctionRPC, isServerFunction, provideServerFunctionRPC, withMeta } from "./registry.js";
1
+ export { LIVE_SOURCE, SERVER_FUNCTION_INVOKE, SERVER_FUNCTION_METADATA, getServerFunctionMetadata, getServerFunctionRPC, invoke, isServerFunction, provideServerFunctionRPC, withMeta } from "./registry.js";
2
2
  export { FLASH_COOKIE, clearFlashCookie, hasFlashCookie, matchFlashCookie } from "../cookies.js";
3
3
  import { JSONCodecOptions } from "../serializer-decode.js";
4
4
  /**
@@ -8,19 +8,22 @@ import { JSONCodecOptions } from "../serializer-decode.js";
8
8
  * HTTP handler. Integrations decoding passthrough responses themselves (no
9
9
  * registered consumer) see this shape from `decodeResponse`. The top level
10
10
  * is reserved for the protocol — integration payload lives entirely under
11
- * `data`, which can be any codec-serializable value.
11
+ * `data`, the envelope keyed by source id (the unnamed registration's
12
+ * slice rides under the reserved id "true"); each slice can be any
13
+ * codec-serializable value.
12
14
  */
13
15
  export interface SingleFlightPayload<T = unknown, D = unknown> {
14
16
  /** The server function's return (or thrown) value. */
15
17
  value: T;
16
- /** The integration-produced data payload. */
18
+ /** The integration-produced data payload, keyed by source id. */
17
19
  data: D;
18
20
  }
19
21
  /**
20
22
  * Envelope context delivered alongside single-flight data: the transport
21
- * response, whose headers carry the integration metadata (`Location` for
22
- * redirect-with-data, `X-Revalidate` keys) and status. The body is already
23
- * consumed — read `data` and `value` from the delivery, not from here.
23
+ * response, whose headers carry the integration metadata (the redirect
24
+ * carrier for redirect-with-data, `X-Revalidate` keys) and status. The
25
+ * body is already consumed — read `data` and `value` from the delivery,
26
+ * not from here.
24
27
  */
25
28
  export interface FlightDataContext {
26
29
  /** The HTTP response the data arrived on (metadata only). */
@@ -45,6 +48,42 @@ export interface ServerFunction<A extends readonly any[] = any[], T = any> {
45
48
  /** URL invoking this function directly over HTTP (form `action`s, raw fetches). */
46
49
  readonly url: string;
47
50
  }
51
+ /**
52
+ * Per-call, invocation-scoped options for `invoke` — things that vary
53
+ * between calls of the SAME function and cannot be declared (`GET`,
54
+ * `withMeta`) or configured (`prepareRequest`). On the server the call is
55
+ * in-process: `signal` still rejects the caller, the transport hints are
56
+ * no-ops (they describe a wire that does not exist).
57
+ */
58
+ export interface InvokeOptions {
59
+ /**
60
+ * The call's lifecycle. Aborting rejects the call with the signal's
61
+ * reason and cancels the request (firing `request.signal` server-side);
62
+ * a live source's iteration ends across reconnects. When provided, the
63
+ * signal owns the wire — timeouts compose through it
64
+ * (`AbortSignal.timeout`, `AbortSignal.any`).
65
+ */
66
+ signal?: AbortSignal;
67
+ /**
68
+ * Lets the request outlive the page — fire-and-forget calls during
69
+ * unload (`pagehide`). Maps to fetch's `keepalive`, body-size caps
70
+ * included.
71
+ */
72
+ keepalive?: boolean;
73
+ /** Fetch priority hint — speculative prefetch vs. interaction fetch. */
74
+ priority?: "high" | "low" | "auto";
75
+ }
76
+ /**
77
+ * A reference's invocation channel, carried under `SERVER_FUNCTION_INVOKE`:
78
+ * applies one call with per-call options. Declaration wrappers (`GET`,
79
+ * `live`) forward it mechanically — they keep the call mapping 1:1. A
80
+ * wrapper that shares calls (a deduping cache, a multicast channel) opts
81
+ * in deliberately, deciding first what a caller's abort means for shared
82
+ * work — or declines, leaving `invoke` to answer with a directed error.
83
+ * Options arrive already validated — `invoke` admits only
84
+ * invocation-scoped keys.
85
+ */
86
+ export type ServerFunctionInvoker<A extends readonly any[] = any[], R = any> = (args: A, options?: InvokeOptions) => R;
48
87
  /**
49
88
  * Declaration-static metadata attached to a server function reference
50
89
  * through declaration wrappers (`GET`, `withMeta`). Read it with
@@ -95,11 +134,27 @@ export interface ServerFunctionRPC {
95
134
  export type BodyFormatValue = (typeof BodyFormat)[keyof typeof BodyFormat];
96
135
  export declare function configureServerFunctionsCodec(codec: JSONCodecOptions | undefined): void;
97
136
  export declare function getServerFunctionsCodec(): JSONCodecOptions | undefined;
137
+ /**
138
+ * Validates a flight data source id (both registration halves share the
139
+ * rule): ids travel the `SINGLE_FLIGHT_HEADER` as a comma-separated list,
140
+ * so they cannot be empty or contain commas, and "true" is reserved for
141
+ * the unnamed registration.
142
+ *
143
+ * Transport building block; not meant for hand-written code.
144
+ * @internal
145
+ */
146
+ export declare function assertFlightSource(source: string): void;
98
147
  export declare function subscribeFlightData<D = unknown>(consumer: FlightDataConsumer<D>): () => void;
99
- export declare function getFlightDataConsumer(): FlightDataConsumer | undefined;
148
+ export declare function subscribeFlightData<D = unknown>(source: string, consumer: FlightDataConsumer<D>): () => void;
149
+ export declare function getFlightDataConsumer(source?: string): FlightDataConsumer | undefined;
150
+ export declare function getFlightDataSourceIds(): string[];
100
151
  export declare function frameAddress(id: string, args?: readonly unknown[]): string;
101
- /** Header carrying the server function id. */
102
- export declare const FUNCTION_HEADER = "X-Server-Function-Id";
152
+ export declare function serverFunctionAddress(endpoint: string, id: string): string;
153
+ export declare function serverFunctionDataAddress(endpoint: string, id: string): string;
154
+ export declare function parseServerFunctionAddress(pathname: string, endpoint: string): {
155
+ id: string;
156
+ data: boolean;
157
+ } | null;
103
158
  /**
104
159
  * Response header marking a thrown server-function error. The value is the
105
160
  * error's message (the structured error itself travels in the body); `"true"`
@@ -115,6 +170,51 @@ export declare function decodeErrorHeaderValue(value: string): string;
115
170
  export declare const INSTANCE_HEADER = "X-Server-Function-Instance";
116
171
  /** Header carrying the body format tag (a `BodyFormat` value). */
117
172
  export declare const BODY_FORMAT_HEADER = "X-Server-Function-Format";
173
+ /**
174
+ * Header labelling the unknown-id 404: the address was well-formed but its
175
+ * id is not registered in the deployment that answered (#3110). This is the
176
+ * ordinary shape of version skew — a tab holding the previous build's ids
177
+ * across a deploy — and the label is what lets an integration recover
178
+ * (e.g. reload the document) instead of surfacing a generic failed call.
179
+ * Nothing distinguishes it otherwise: a CDN 404 and a skew 404 look alike.
180
+ */
181
+ export declare const UNKNOWN_HEADER = "X-Server-Function-Unknown";
182
+ /**
183
+ * Header carrying a redirect to scripted callers. fetch FOLLOWS redirect
184
+ * statuses before the transport can read them, so a scripted answer masks
185
+ * the 3xx to 200 and this header carries what the mask erases: the author's
186
+ * status and the target RESOLVED against the request url — exactly the
187
+ * meaning HTTP assigns the `Location` a form post would have received.
188
+ * Value: `<status> <absolute-url>`, decode with `decodeRedirectHeaderValue`.
189
+ *
190
+ * Carrying the resolved absolute form is the point (#3102, #3107): the
191
+ * reader never guesses navigation strategy from how the author spelled the
192
+ * target — `redirect("/")` and `redirect(new URL("/", url).href)` arrive
193
+ * identical by construction, and same-origin vs cross-origin is a real URL
194
+ * comparison, not a `startsWith("http")` coin toss. `Location` itself never
195
+ * rides a masked answer: on a 200 it has no HTTP meaning, and it collided
196
+ * with authored Locations on statuses that forward (a 201's created-at is
197
+ * data, not navigation).
198
+ */
199
+ export declare const REDIRECT_HEADER = "X-Server-Function-Redirect";
200
+ /**
201
+ * Decodes a `REDIRECT_HEADER` value into the author's status and the
202
+ * resolved absolute target. Integration plumbing for readers of the header
203
+ * (routers); the wire format is the runtime's own, not a contract to parse
204
+ * by hand.
205
+ *
206
+ * The documented output — a resolved ABSOLUTE http(s) target and a redirect
207
+ * status — is enforced, not assumed (#3175): the absoluteness used to be a
208
+ * property of the server having resolved it, and a hostile or buggy peer
209
+ * could ride a `javascript:` target straight into the `location.href =
210
+ * decoded.url` an integration reasonably writes. A value that does not
211
+ * parse as an absolute http(s) url, or whose status is not one the runtime
212
+ * masks, decodes to `undefined` — the same answer a missing header gives.
213
+ */
214
+ export declare function decodeRedirectHeaderValue(value: string | null | undefined): {
215
+ status: number;
216
+ url: string;
217
+ } | undefined;
118
218
  /**
119
219
  * Header driving the single-flight protocol on both legs: on the request it
120
220
  * opts the call into flight-data collection (the integration sends it on
@@ -141,6 +241,13 @@ export declare const BodyFormat: {
141
241
  * included) on the response.
142
242
  */
143
243
  Json: string;
244
+ /**
245
+ * No body at all — a function that returned nothing. It marks the response
246
+ * as one the runtime encoded, which separates a void result with a status
247
+ * on it from a refusal answered by something else. Decoding falls through
248
+ * to `undefined`, which is what a peer predating the tag reads too.
249
+ */
250
+ Void: string;
144
251
  };
145
252
  export declare function isJSONSafe(value: unknown): boolean;
146
253
  export declare function getHeadersAndBody(body: unknown): {
@@ -157,15 +264,14 @@ export declare class ChunkReader {
157
264
  value: string;
158
265
  }>;
159
266
  drain(interpret: any): Promise<void>;
160
- } /**
161
- * Serializes a value as a stream of length-prefixed SerovalNode chunks.
162
- * Async values (promises, streams) keep the stream open until they settle,
163
- * so one connection carries incremental results. Codec options must match
164
- * the deserializing peer.
165
- *
166
- * Transport building block; not meant for hand-written code.
267
+ }
268
+ /**
269
+ * Encodes a terminal error-trailer frame payload. The value is expected to
270
+ * be already sanitized by the caller; only `name` and `message` travel.
271
+ * Transport wire detail; not meant for hand-written code.
167
272
  * @internal
168
273
  */
274
+ export declare function encodeErrorTrailer(error: unknown): string;
169
275
  export declare function serializeStream(value: unknown, codecOptions?: JSONCodecOptions): ReadableStream<Uint8Array>;
170
276
  export declare function serializeString(value: unknown, codecOptions?: JSONCodecOptions): Promise<string>;
171
277
  export declare function deserializeStream<T = unknown>(source: Request | Response, codecOptions?: JSONCodecOptions): Promise<T>;
@@ -1,10 +1,23 @@
1
1
  import type { RequestEvent, RequestEventLocals, ResponseStub } from "./client.js";
2
+ import type { JSX } from "./jsx.js";
3
+ /** An explicit `<link rel="preload">` emitted by the SSR asset pipeline. */
4
+ export type PreloadLink = {
5
+ href: string;
6
+ as: JSX.HTMLPreloadAs;
7
+ type?: string;
8
+ crossorigin?: JSX.HTMLCrossorigin;
9
+ integrity?: string;
10
+ referrerpolicy?: JSX.HTMLReferrerPolicy;
11
+ fetchpriority?: JSX.HTMLFetchPriority;
12
+ media?: string;
13
+ };
2
14
  /** Static asset manifest produced by a build (e.g. parsed Vite manifest.json). */
3
15
  export type AssetManifest = Record<string, {
4
16
  file: string;
5
17
  css?: string[];
6
18
  isEntry?: boolean;
7
19
  imports?: string[];
20
+ preloads?: PreloadLink[];
8
21
  }> & {
9
22
  _base?: string;
10
23
  };
@@ -17,6 +30,7 @@ export type InlineStyleAsset = {
17
30
  export type ResolvedAssets = {
18
31
  js: string[];
19
32
  css: (string | InlineStyleAsset)[];
33
+ preloads?: PreloadLink[];
20
34
  };
21
35
  /**
22
36
  * Resolver form of the manifest option — the primitive a dev server
@@ -24,8 +38,9 @@ export type ResolvedAssets = {
24
38
  * normalized into a sync resolver internally). `resolve` may return a
25
39
  * promise (async resolvers require streaming rendering); CSS entries may be
26
40
  * URL strings (emitted as load-gated `<link>` tags) or inline-style
27
- * descriptors (emitted as `<style>` tags). A bare `resolve`-shaped function
28
- * is accepted as shorthand for `{ resolve }`.
41
+ * descriptors (emitted as `<style>` tags), and `preloads` carries explicit
42
+ * preload links selected by the integration. A bare `resolve`-shaped
43
+ * function is accepted as shorthand for `{ resolve }`.
29
44
  */
30
45
  export type AssetResolver = {
31
46
  resolve(key: string): ResolvedAssets | null | undefined | Promise<ResolvedAssets | null | undefined>;
package/types/server.d.ts CHANGED
@@ -5,12 +5,24 @@ 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
+ /** An explicit `<link rel="preload">` emitted by the SSR asset pipeline. */
9
+ export type PreloadLink = {
10
+ href: string;
11
+ as: JSX.HTMLPreloadAs;
12
+ type?: string;
13
+ crossorigin?: JSX.HTMLCrossorigin;
14
+ integrity?: string;
15
+ referrerpolicy?: JSX.HTMLReferrerPolicy;
16
+ fetchpriority?: JSX.HTMLFetchPriority;
17
+ media?: string;
18
+ };
8
19
  /** Static asset manifest produced by a build (e.g. parsed Vite manifest.json). */
9
20
  export type AssetManifest = Record<string, {
10
21
  file: string;
11
22
  css?: string[];
12
23
  isEntry?: boolean;
13
24
  imports?: string[];
25
+ preloads?: PreloadLink[];
14
26
  }> & {
15
27
  _base?: string;
16
28
  };
@@ -23,6 +35,7 @@ export type InlineStyleAsset = {
23
35
  export type ResolvedAssets = {
24
36
  js: string[];
25
37
  css: (string | InlineStyleAsset)[];
38
+ preloads?: PreloadLink[];
26
39
  };
27
40
  /**
28
41
  * Resolver form of the manifest option — the primitive a dev server
@@ -30,8 +43,9 @@ export type ResolvedAssets = {
30
43
  * normalized into a sync resolver internally). `resolve` may return a
31
44
  * promise (async resolvers require streaming rendering); CSS entries may be
32
45
  * URL strings (emitted as load-gated `<link>` tags) or inline-style
33
- * descriptors (emitted as `<style>` tags). A bare `resolve`-shaped function
34
- * is accepted as shorthand for `{ resolve }`.
46
+ * descriptors (emitted as `<style>` tags), and `preloads` carries explicit
47
+ * preload links selected by the integration. A bare `resolve`-shaped
48
+ * function is accepted as shorthand for `{ resolve }`.
35
49
  */
36
50
  export type AssetResolver = {
37
51
  resolve(key: string): ResolvedAssets | null | undefined | Promise<ResolvedAssets | null | undefined>;
@@ -79,6 +79,8 @@ 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;
82
84
  export { DOMWithState, ChildProperties, DOMElements, SVGElements, MathMLElements, VoidElements, RawTextElements, Namespaces, DelegatedEvents } from "./constants.cjs";
83
85
  /** Client stub — hydration bootstrap is a server-only emit. */
84
86
  export declare function generateHydrationScript(_options?: {
@@ -145,10 +147,10 @@ export declare function spread<T>(node: Element, accessor: T, skipChildren?: Boo
145
147
  export declare function dynamicProperty(props: unknown, key: string): unknown;
146
148
  export declare function applyRef<T extends Element = Element>(r: ((element: NoInfer<T>) => void) | ((element: NoInfer<T>) => void)[], element: T): void;
147
149
  export declare function ref(fn: () => ((element: Element) => void) | ((element: Element) => void)[], element: Element): void;
148
- export declare function rowProof(fn: any): any; /** Compiler-emitted primitive; not for hand-written code. @internal */
150
+ /** Compiler-emitted primitive; not for hand-written code. @internal */
149
151
  export declare function scope<T extends () => any>(fn: T): T;
150
152
  export declare function installHydrationRuntime(): void;
151
- export declare function patchDriver(subject: any, body: any): void; /**
153
+ /**
152
154
  * Compiler-emitted primitive; not for hand-written code.
153
155
  * @internal
154
156
  */
@@ -13,6 +13,12 @@ export interface CookieOptions {
13
13
  secure?: boolean;
14
14
  /** Cookie `SameSite` attribute, any case. */
15
15
  sameSite?: "lax" | "strict" | "none" | "Lax" | "Strict" | "None";
16
+ /**
17
+ * Emit the `Partitioned` attribute (CHIPS): a third-party cookie keyed to
18
+ * the top-level site it was set under — the only third-party cookie that
19
+ * keeps working as browsers finish removing the rest. Requires `secure`.
20
+ */
21
+ partitioned?: boolean;
16
22
  }
17
23
  /**
18
24
  * Parses a `Cookie` request header into a name → value map. Names and
@@ -25,20 +31,6 @@ export interface CookieOptions {
25
31
  * `parseCookieHeader(event.request.headers.get("cookie"))`.
26
32
  */
27
33
  export declare function parseCookieHeader(header: string | null | undefined): Record<string, string>;
28
- /**
29
- * Serializes a cookie to a `Set-Cookie` header value. The name and value
30
- * are `encodeURIComponent`-encoded (the parser decodes symmetrically);
31
- * `path` defaults to `/` — the only defaulted attribute — and every other
32
- * attribute is emitted exactly when the caller asked for it: `domain`,
33
- * `maxAge` (seconds, truncated to an integer), `expires` (a `Date`),
34
- * `httpOnly`, `secure`, `sameSite` (`"lax" | "strict" | "none"`, any
35
- * case).
36
- *
37
- * The write half of the platform gap — the blessed response-cookie write
38
- * is `event.response.headers.append("set-cookie", serializeCookie(name,
39
- * value, options))`, which every head materialization path carries to the
40
- * wire entry-by-entry.
41
- */
42
34
  export declare function serializeCookie(name: string, value: string, options?: CookieOptions): string;
43
35
  export declare const FLASH_COOKIE = "flash";
44
36
  /** Whether a Cookie header carries a flash cookie (readable or not). */
@@ -59,6 +59,10 @@ export type FrameChunk = {
59
59
  content?: string;
60
60
  attrs?: Record<string, string>;
61
61
  }[];
62
+ preloads?: {
63
+ href: string;
64
+ attrs: Record<string, string>;
65
+ }[];
62
66
  } | {
63
67
  type: "slot";
64
68
  id: string;
@@ -105,6 +105,18 @@ export interface JSONCodecOptions {
105
105
  disabledFeatures?: number;
106
106
  /** Maximum parse/deserialize depth. Defaults to 64. Must match on both peers. */
107
107
  depthLimit?: number;
108
+ /**
109
+ * Whether serialized `Error`s carry their `.stack` — server file paths,
110
+ * internal function names, the shape of the deployment — to the peer.
111
+ * Defaults to `NODE_ENV === "development"`, but that signal describes the
112
+ * PROCESS, not the artifact: a production build running with
113
+ * `NODE_ENV=development` (a base image, a stray dotenv) ships stacks to
114
+ * the wire — including for errors marked safe with `markSafeError`, whose
115
+ * stacks traverse application code (#3152). Set `false` to pin production
116
+ * disclosure regardless of the ambient variable. Encode-side only; the
117
+ * decode side is always permissive, so it need not match peers.
118
+ */
119
+ serializeErrorStacks?: boolean;
108
120
  }
109
121
  /**
110
122
  * A resident, response-scoped decode table over the keyed JSON codec: apply
@@ -142,10 +154,11 @@ export declare const DEFAULT_WEB_PLUGINS: any; /**
142
154
  * Integration-facing; may change (see the entry banner).
143
155
  */
144
156
  export declare function resolveSerializerPlugins(customPlugins?: SerializerPlugin[]): SerializerPlugin[];
145
- export declare function resolveCodecOptions({ plugins, disabledFeatures, depthLimit }?: JSONCodecOptions): {
157
+ export declare function resolveCodecOptions({ plugins, disabledFeatures, depthLimit, serializeErrorStacks }?: JSONCodecOptions): {
146
158
  plugins: SerializerPlugin<any, any>[];
147
159
  disabledFeatures: any;
148
160
  depthLimit: number;
161
+ serializeErrorStacks: boolean;
149
162
  }; /**
150
163
  * Creates the decoding counterpart of `serializeJSON`. Cross-references
151
164
  * between chunks resolve through state shared across calls, so all chunks
@@ -19,6 +19,13 @@ export interface WebSerializerOptions {
19
19
  * any override — serialized stacks leak server paths to the client.
20
20
  */
21
21
  disabledFeatures?: number;
22
+ /**
23
+ * Whether serialized `Error`s carry their `.stack`. Defaults to
24
+ * `NODE_ENV === "development"`; set `false` to pin production disclosure
25
+ * to the deployment rather than the ambient variable (#3152 — see
26
+ * `JSONCodecOptions.serializeErrorStacks`).
27
+ */
28
+ serializeErrorStacks?: boolean;
22
29
  /** Extra plugins, composed ahead of `DEFAULT_WEB_PLUGINS`. */
23
30
  plugins?: SerializerPlugin[];
24
31
  /** Receives each emitted script chunk. */
@@ -1,6 +1,7 @@
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";
4
5
  export * from "./server-mock.cjs";
5
6
  export * from "./response.cjs";
6
7
  export type { JSX } from "./jsx.cjs";
@@ -1080,6 +1080,7 @@ export namespace JSX {
1080
1080
  type HTMLFormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain";
1081
1081
  type HTMLFormMethod = "post" | "get" | "dialog";
1082
1082
  type HTMLCrossorigin = "anonymous" | "use-credentials" | EnumeratedAcceptsEmpty;
1083
+ type HTMLFetchPriority = "high" | "low" | "auto";
1083
1084
  type HTMLReferrerPolicy =
1084
1085
  | "no-referrer"
1085
1086
  | "no-referrer-when-downgrade"
@@ -1105,19 +1106,8 @@ export namespace JSX {
1105
1106
  | "allow-top-navigation"
1106
1107
  | "allow-top-navigation-by-user-activation"
1107
1108
  | "allow-top-navigation-to-custom-protocols";
1108
- type HTMLLinkAs =
1109
- | "audio"
1110
- | "document"
1111
- | "embed"
1112
- | "fetch"
1113
- | "font"
1114
- | "image"
1115
- | "object"
1116
- | "script"
1117
- | "style"
1118
- | "track"
1119
- | "video"
1120
- | "worker";
1109
+ type HTMLPreloadAs = "fetch" | "font" | "image" | "script" | "style" | "track";
1110
+ type HTMLLinkAs = HTMLPreloadAs | "audio" | "document" | "embed" | "object" | "video" | "worker";
1121
1111
 
1122
1112
  interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
1123
1113
  download?: string | EnumeratedAcceptsEmpty | RemoveAttribute;
@@ -1367,7 +1357,7 @@ export namespace JSX {
1367
1357
  browsingtopics?: string | RemoveAttribute;
1368
1358
  crossorigin?: HTMLCrossorigin | RemoveAttribute;
1369
1359
  decoding?: "sync" | "async" | "auto" | RemoveAttribute;
1370
- fetchpriority?: "high" | "low" | "auto" | RemoveAttribute;
1360
+ fetchpriority?: HTMLFetchPriority | RemoveAttribute;
1371
1361
  height?: number | string | RemoveAttribute;
1372
1362
  ismap?: BooleanAttribute | RemoveAttribute;
1373
1363
  loading?: "eager" | "lazy" | RemoveAttribute;
@@ -1522,7 +1512,7 @@ export namespace JSX {
1522
1512
  color?: string | RemoveAttribute;
1523
1513
  crossorigin?: HTMLCrossorigin | RemoveAttribute;
1524
1514
  disabled?: BooleanAttribute | RemoveAttribute;
1525
- fetchpriority?: "high" | "low" | "auto" | RemoveAttribute;
1515
+ fetchpriority?: HTMLFetchPriority | RemoveAttribute;
1526
1516
  href?: string | RemoveAttribute;
1527
1517
  hreflang?: string | RemoveAttribute;
1528
1518
  imagesizes?: string | RemoveAttribute;
@@ -1713,7 +1703,7 @@ export namespace JSX {
1713
1703
  blocking?: "render" | RemoveAttribute;
1714
1704
  crossorigin?: HTMLCrossorigin | RemoveAttribute;
1715
1705
  defer?: BooleanAttribute | RemoveAttribute;
1716
- fetchpriority?: "high" | "low" | "auto" | RemoveAttribute;
1706
+ fetchpriority?: HTMLFetchPriority | RemoveAttribute;
1717
1707
  for?: string | RemoveAttribute;
1718
1708
  integrity?: string | RemoveAttribute;
1719
1709
  nomodule?: BooleanAttribute | RemoveAttribute;
@@ -3500,6 +3490,11 @@ export namespace JSX {
3500
3490
  * @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement
3501
3491
  */
3502
3492
  select: SelectHTMLAttributes<HTMLSelectElement> & Properties<HTMLSelectElement>;
3493
+ /**
3494
+ * @url https://developer.mozilla.org/en-US/docs/Web/HTML/Element/selectedcontent
3495
+ * @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectedContentElement
3496
+ */
3497
+ selectedcontent: HTMLAttributes<HTMLElement> & Properties<HTMLElement>;
3503
3498
  /**
3504
3499
  * @url https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot
3505
3500
  * @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLSlotElement
@@ -0,0 +1,3 @@
1
+ export declare function rowProof<T extends Function>(fn: T): T;
2
+ export declare const driveList: (parent: Node, listFn: any, marker?: Node, lateClassic?: () => void) => boolean;
3
+ export declare const patchDriver: (subject: any, body: any) => void;
@@ -16,7 +16,15 @@ export declare const ResponseEnvelope: {
16
16
  export declare function isResponseEnvelope(value: unknown): value is ResponseEnvelope;
17
17
  export declare const HREF: unique symbol;
18
18
  export interface Href {
19
- [HREF]: true;
19
+ /**
20
+ * The brand doubles as a channel: when the slot holds a string it is the
21
+ * value's *logical* path — the routable pathname before an integration's
22
+ * display rendering (eg. a hash router's `#` prefix). `redirect()` prefers
23
+ * it over coercion so Location headers carry routable paths; `toString()`
24
+ * remains the display href for the DOM. `true` brands a value whose
25
+ * string form is already logical.
26
+ */
27
+ [HREF]: true | string;
20
28
  toString(): string;
21
29
  }
22
30
  /** Whether `value` is an `Href`-branded URL-bearing value. */
@@ -42,6 +50,8 @@ export declare const REVALIDATE_HEADER = "X-Revalidate";
42
50
  export interface ResponseHelperInit extends ResponseInit {
43
51
  revalidate?: string | string[];
44
52
  }
53
+ /** @internal */
54
+ export declare const RESPONSE_HEADER_VALUE_LIMIT = 4096;
45
55
  /**
46
56
  * Response redirecting to `url` (default 302). `revalidate` names the
47
57
  * cache keys the mutation invalidated.
@@ -52,6 +62,15 @@ export declare function redirect(url: string | Href, init?: number | ResponseHel
52
62
  * them when omitted).
53
63
  */
54
64
  export declare function reload(init?: ResponseHelperInit): Response;
65
+ /**
66
+ * Statuses HTTP forbids a body on — the `Response` constructor enforces it
67
+ * by throwing on ANY body, `JSON.stringify(undefined)`'s `"undefined"`
68
+ * included. Shared with the server-function encoder, which answers void
69
+ * results on these statuses with a real null-body response and reports
70
+ * value-carrying ones as authoring errors (#3095).
71
+ * @internal
72
+ */
73
+ export declare const NULL_BODY_STATUSES: ReadonlySet<number>;
55
74
  /**
56
75
  * A value paired with response metadata (status, headers, `revalidate`) —
57
76
  * for the things a naked return can't express. Progressive enhancement
@@ -105,6 +105,18 @@ export interface JSONCodecOptions {
105
105
  disabledFeatures?: number;
106
106
  /** Maximum parse/deserialize depth. Defaults to 64. Must match on both peers. */
107
107
  depthLimit?: number;
108
+ /**
109
+ * Whether serialized `Error`s carry their `.stack` — server file paths,
110
+ * internal function names, the shape of the deployment — to the peer.
111
+ * Defaults to `NODE_ENV === "development"`, but that signal describes the
112
+ * PROCESS, not the artifact: a production build running with
113
+ * `NODE_ENV=development` (a base image, a stray dotenv) ships stacks to
114
+ * the wire — including for errors marked safe with `markSafeError`, whose
115
+ * stacks traverse application code (#3152). Set `false` to pin production
116
+ * disclosure regardless of the ambient variable. Encode-side only; the
117
+ * decode side is always permissive, so it need not match peers.
118
+ */
119
+ serializeErrorStacks?: boolean;
108
120
  }
109
121
  /**
110
122
  * A resident, response-scoped decode table over the keyed JSON codec: apply
@@ -142,10 +154,11 @@ export declare const DEFAULT_WEB_PLUGINS: any; /**
142
154
  * Integration-facing; may change (see the entry banner).
143
155
  */
144
156
  export declare function resolveSerializerPlugins(customPlugins?: SerializerPlugin[]): SerializerPlugin[];
145
- export declare function resolveCodecOptions({ plugins, disabledFeatures, depthLimit }?: JSONCodecOptions): {
157
+ export declare function resolveCodecOptions({ plugins, disabledFeatures, depthLimit, serializeErrorStacks }?: JSONCodecOptions): {
146
158
  plugins: SerializerPlugin<any, any>[];
147
159
  disabledFeatures: any;
148
160
  depthLimit: number;
161
+ serializeErrorStacks: boolean;
149
162
  }; /**
150
163
  * Creates the decoding counterpart of `serializeJSON`. Cross-references
151
164
  * between chunks resolve through state shared across calls, so all chunks
@@ -19,6 +19,13 @@ export interface WebSerializerOptions {
19
19
  * any override — serialized stacks leak server paths to the client.
20
20
  */
21
21
  disabledFeatures?: number;
22
+ /**
23
+ * Whether serialized `Error`s carry their `.stack`. Defaults to
24
+ * `NODE_ENV === "development"`; set `false` to pin production disclosure
25
+ * to the deployment rather than the ambient variable (#3152 — see
26
+ * `JSONCodecOptions.serializeErrorStacks`).
27
+ */
28
+ serializeErrorStacks?: boolean;
22
29
  /** Extra plugins, composed ahead of `DEFAULT_WEB_PLUGINS`. */
23
30
  plugins?: SerializerPlugin[];
24
31
  /** Receives each emitted script chunk. */