@solidjs/web 2.0.0-rc.0 → 2.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/server.dev.js +4472 -0
- package/dist/server.js +1363 -224
- package/dist/{server.cjs → server.observe.js} +1563 -424
- package/dist/{dev.cjs → web.dev.js} +708 -365
- package/dist/web.js +460 -144
- package/dist/{dev.js → web.observe.js} +511 -213
- package/frames/dist/client.dev.js +464 -72
- package/frames/dist/client.js +364 -71
- package/frames/dist/{client.dev.cjs → client.observe.js} +487 -134
- package/frames/dist/server.dev.js +1713 -0
- package/frames/dist/server.js +553 -2495
- package/frames/dist/server.observe.js +1713 -0
- package/frames/package.json +2 -25
- package/package.json +214 -254
- package/performance-tracks/dist/performance-tracks.dev.js +678 -0
- package/performance-tracks/dist/performance-tracks.js +6 -0
- package/performance-tracks/dist/performance-tracks.observe.js +666 -0
- package/performance-tracks/package.json +7 -0
- package/performance-tracks/types/index.d.ts +67 -0
- package/serialization/decode/package.json +2 -15
- package/serialization/dist/decode.js +101 -12
- package/serialization/dist/serialization.js +112 -20
- package/serialization/package.json +2 -15
- package/serialization/types/index.d.ts +76 -157
- package/serialization/types/serializer-decode.d.ts +149 -112
- package/serialization/types/serializer.d.ts +101 -0
- package/server-functions/dist/client.dev.js +1364 -0
- package/server-functions/dist/client.js +745 -85
- package/server-functions/dist/client.observe.js +1343 -0
- package/server-functions/dist/server.dev.js +2203 -175
- package/server-functions/dist/server.js +2111 -176
- package/server-functions/dist/server.observe.js +3043 -0
- package/server-functions/package.json +2 -35
- package/server-functions/rich-args/package.json +2 -15
- package/storage/package.json +2 -15
- package/types/client.d.ts +193 -288
- package/types/constants.d.ts +20 -0
- package/types/cookies.d.ts +32 -84
- package/types/diagnostics.d.ts +56 -0
- package/types/frames/client.d.ts +1 -1
- package/types/frames/frame-client.d.ts +323 -259
- package/types/frames/frame-container-plugin.d.ts +72 -0
- package/types/frames/frame-sink.d.ts +101 -158
- package/types/frames/frame-transport.d.ts +192 -190
- package/types/frames/serializer-decode.d.ts +219 -0
- package/types/frames/serializer.d.ts +76 -157
- package/types/frames/server.d.ts +1 -1
- package/types/head.d.ts +19 -0
- package/types/index.d.ts +62 -76
- package/types/index.server.d.ts +174 -0
- package/types/jsx.d.ts +33 -26
- package/types/observe.d.ts +358 -0
- package/types/reconcile.d.ts +1 -0
- package/types/render.d.ts +9 -0
- package/types/response.d.ts +75 -150
- package/types/serializer-decode.d.ts +149 -112
- package/types/serializer.d.ts +76 -157
- package/types/server-functions/client.d.ts +202 -174
- package/types/server-functions/flash.d.ts +28 -30
- package/types/server-functions/registry.d.ts +102 -0
- package/types/server-functions/rich-args.d.ts +1 -10
- package/types/server-functions/server.d.ts +518 -454
- package/types/server-functions/shared.d.ts +366 -425
- package/types/server-mock.d.ts +110 -13
- package/types/server-observe.d.ts +77 -0
- package/types/server.d.ts +425 -425
- package/types/trace.d.ts +127 -0
- package/LICENSE +0 -21
- package/dist/web.cjs +0 -2007
- package/frames/dist/client.cjs +0 -1916
- package/frames/dist/server.cjs +0 -3667
- package/serialization/dist/decode.cjs +0 -110
- package/serialization/dist/serialization.cjs +0 -232
- package/serialization/types-cjs/index.d.cts +0 -182
- package/serialization/types-cjs/package.json +0 -3
- package/serialization/types-cjs/serializer-decode.d.cts +0 -182
- package/server-functions/dist/client.cjs +0 -646
- package/server-functions/dist/rich-args.cjs +0 -11
- package/server-functions/dist/server.cjs +0 -1077
- package/server-functions/dist/server.dev.cjs +0 -1077
- package/storage/dist/storage.cjs +0 -12
- package/storage/types-cjs/index.d.cts +0 -28
- package/storage/types-cjs/package.json +0 -3
- package/types/core.d.ts +0 -6
- package/types-cjs/client.d.cts +0 -337
- package/types-cjs/cookies.d.cts +0 -93
- package/types-cjs/core.d.cts +0 -6
- package/types-cjs/frames/client.d.cts +0 -36
- package/types-cjs/frames/frame-client.d.cts +0 -338
- package/types-cjs/frames/frame-sink.d.cts +0 -194
- package/types-cjs/frames/frame-transport.d.cts +0 -222
- package/types-cjs/frames/serializer.d.cts +0 -182
- package/types-cjs/frames/server.d.cts +0 -52
- package/types-cjs/index.d.cts +0 -230
- package/types-cjs/jsx-properties.d.cts +0 -93
- package/types-cjs/jsx.d.cts +0 -4150
- package/types-cjs/package.json +0 -3
- package/types-cjs/response.d.cts +0 -174
- package/types-cjs/serializer-decode.d.cts +0 -182
- package/types-cjs/serializer.d.cts +0 -182
- package/types-cjs/server-functions/client.d.cts +0 -201
- package/types-cjs/server-functions/flash.d.cts +0 -38
- package/types-cjs/server-functions/rich-args.d.cts +0 -10
- package/types-cjs/server-functions/server.d.cts +0 -588
- package/types-cjs/server-functions/shared.d.cts +0 -523
- package/types-cjs/server-mock.d.cts +0 -277
- package/types-cjs/server.d.cts +0 -523
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Serializer } from "seroval";
|
|
2
|
+
import type { JSONCodecOptions, PluginInfo, SerializerPlugin, SerovalNode } from "./serializer-decode.js";
|
|
3
|
+
export { DEFAULT_WEB_PLUGINS, createJSONDataTable, createJSONDeserializer, resolveSerializerPlugins } from "./serializer-decode.js";
|
|
4
|
+
export type * from "./serializer-decode.js";
|
|
5
|
+
/**
|
|
6
|
+
* Options for `createSerializer`.
|
|
7
|
+
*
|
|
8
|
+
* Integration-facing; may change (see the entry banner).
|
|
9
|
+
*/
|
|
10
|
+
export interface WebSerializerOptions {
|
|
11
|
+
/** Name of the global object the emitted scripts write resolved values into. */
|
|
12
|
+
globalIdentifier: string;
|
|
13
|
+
/** Cross-reference scope id, for isolating multiple streams on one page. */
|
|
14
|
+
scopeId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Seroval feature bitflags to exclude from output. Defaults to disabling
|
|
17
|
+
* post-ES2017 features (AggregateError, BigInt typed arrays). Outside
|
|
18
|
+
* development, `Error.prototype.stack` is additionally stripped on top of
|
|
19
|
+
* any override — serialized stacks leak server paths to the client.
|
|
20
|
+
*/
|
|
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;
|
|
29
|
+
/** Extra plugins, composed ahead of `DEFAULT_WEB_PLUGINS`. */
|
|
30
|
+
plugins?: SerializerPlugin[];
|
|
31
|
+
/** Receives each emitted script chunk. */
|
|
32
|
+
onData: (result: string) => void;
|
|
33
|
+
onError?: (error: unknown) => void;
|
|
34
|
+
/** Fires once all async values have settled. */
|
|
35
|
+
onDone?: () => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Options for `createHydrationSerializer` — `WebSerializerOptions` minus
|
|
39
|
+
* the knobs hydration pins (`globalIdentifier`, `disabledFeatures`).
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export type HydrationSerializerOptions = Omit<WebSerializerOptions, "globalIdentifier" | "disabledFeatures">;
|
|
43
|
+
/**
|
|
44
|
+
* Options for `serializeJSON`.
|
|
45
|
+
*
|
|
46
|
+
* Integration-facing; may change (see the entry banner).
|
|
47
|
+
*/
|
|
48
|
+
export interface JSONSerializeOptions extends JSONCodecOptions {
|
|
49
|
+
/**
|
|
50
|
+
* Receives each serialized node; `initial` is true for the first chunk
|
|
51
|
+
* (the source value itself). Async values produce additional chunks as
|
|
52
|
+
* they resolve.
|
|
53
|
+
*/
|
|
54
|
+
onParse: (node: SerovalNode, initial: boolean) => void;
|
|
55
|
+
onError?: (error: unknown) => void;
|
|
56
|
+
/** Fires once all async values have settled. */
|
|
57
|
+
onDone?: () => void;
|
|
58
|
+
}
|
|
59
|
+
/** Options for `createJSONSerializer`. */
|
|
60
|
+
export interface JSONSerializerOptions extends JSONCodecOptions {
|
|
61
|
+
/**
|
|
62
|
+
* Receives each keyed record — `initial` is true for a key's first node
|
|
63
|
+
* (the written value itself); async values patch through later records
|
|
64
|
+
* under the same key. The decoding peer is `createJSONDataTable`.
|
|
65
|
+
*/
|
|
66
|
+
onData: (record: {
|
|
67
|
+
key: string;
|
|
68
|
+
node: SerovalNode;
|
|
69
|
+
initial: boolean;
|
|
70
|
+
}) => void;
|
|
71
|
+
onError?: (error: unknown) => void;
|
|
72
|
+
/** Fires once `flush()` has been called and every pending value settled. */
|
|
73
|
+
onDone?: () => void;
|
|
74
|
+
}
|
|
75
|
+
export declare const createPlugin: <Value, Info extends PluginInfo>(plugin: SerializerPlugin<Value, Info>) => SerializerPlugin<Value, Info>;
|
|
76
|
+
export interface OpaqueReference<V = unknown, R = undefined> {
|
|
77
|
+
readonly value: V;
|
|
78
|
+
readonly replacement?: R;
|
|
79
|
+
}
|
|
80
|
+
export declare const OpaqueReference: {
|
|
81
|
+
new <V, R = undefined>(value: V, replacement?: R): OpaqueReference<V, R>;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Creates a streaming Seroval serializer preconfigured with the web plugin
|
|
85
|
+
* set and the default feature policy. Emits JavaScript chunks (through
|
|
86
|
+
* `onData`) that reconstruct the values under `globalIdentifier` when
|
|
87
|
+
* evaluated — the script-injection form of serialization renderers build
|
|
88
|
+
* on. For a JSON-based wire codec (no eval on the receiving side), use
|
|
89
|
+
* `serializeJSON` / `createJSONDeserializer` instead.
|
|
90
|
+
*
|
|
91
|
+
* Integration-facing; may change (see the entry banner).
|
|
92
|
+
*/
|
|
93
|
+
export declare function createSerializer(options: WebSerializerOptions): Serializer;
|
|
94
|
+
export declare function createHydrationSerializer(options: HydrationSerializerOptions): Serializer;
|
|
95
|
+
export declare function getLocalHeaderScript(id?: string): string;
|
|
96
|
+
export declare function serializeJSON(value: unknown, options: JSONSerializeOptions): () => void;
|
|
97
|
+
export declare function createJSONSerializer(options: JSONSerializerOptions): {
|
|
98
|
+
write(key: string, value: unknown): void;
|
|
99
|
+
flush(): void;
|
|
100
|
+
close(): void;
|
|
101
|
+
};
|