@solidjs/web 2.0.0-rc.2 → 2.0.0-rc.3
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/dev.cjs +86 -61
- package/dist/dev.js +81 -60
- package/dist/server.cjs +34 -17
- package/dist/server.js +35 -19
- package/dist/web.cjs +83 -59
- package/dist/web.js +78 -58
- package/frames/dist/client.cjs +8 -8
- package/frames/dist/client.dev.cjs +8 -8
- package/frames/dist/client.dev.js +8 -8
- package/frames/dist/client.js +8 -8
- package/frames/dist/server.cjs +28 -18
- package/frames/dist/server.js +29 -19
- package/package.json +20 -22
- package/serialization/dist/decode.cjs +3 -3
- package/serialization/dist/decode.js +3 -3
- package/serialization/dist/serialization.cjs +7 -11
- package/serialization/dist/serialization.js +7 -6
- package/serialization/types/index.d.ts +69 -157
- package/serialization/types/serializer-decode.d.ts +89 -112
- package/serialization/types/serializer.d.ts +94 -0
- package/serialization/types-cjs/index.d.cts +69 -157
- package/serialization/types-cjs/serializer-decode.d.cts +89 -112
- package/serialization/types-cjs/serializer.d.cts +94 -0
- package/types/client.d.ts +150 -290
- package/types/constants.d.ts +18 -0
- package/types/cookies.d.ts +31 -75
- package/types/frames/frame-client.d.ts +287 -277
- package/types/frames/frame-container-plugin.d.ts +71 -0
- package/types/frames/frame-sink.d.ts +58 -160
- package/types/frames/frame-transport.d.ts +161 -194
- package/types/frames/serializer-decode.d.ts +159 -0
- package/types/frames/serializer.d.ts +69 -157
- package/types/head.d.ts +16 -0
- package/types/index.d.ts +0 -65
- package/types/index.server.d.ts +125 -0
- package/types/jsx.d.ts +5 -13
- package/types/reconcile.d.ts +1 -0
- package/types/render.d.ts +4 -0
- package/types/response.d.ts +41 -153
- package/types/serializer-decode.d.ts +89 -112
- package/types/serializer.d.ts +69 -157
- package/types/server-functions/client.d.ts +93 -222
- package/types/server-functions/flash.d.ts +10 -30
- package/types/server-functions/registry.d.ts +63 -0
- package/types/server-functions/rich-args.d.ts +1 -10
- package/types/server-functions/server.d.ts +292 -574
- package/types/server-functions/shared.d.ts +112 -458
- package/types/server-mock.d.ts +2 -2
- package/types/server.d.ts +242 -434
- package/types-cjs/client.d.cts +150 -290
- package/types-cjs/constants.d.cts +18 -0
- package/types-cjs/cookies.d.cts +31 -75
- package/types-cjs/frames/frame-client.d.cts +287 -277
- package/types-cjs/frames/frame-container-plugin.d.cts +71 -0
- package/types-cjs/frames/frame-sink.d.cts +58 -160
- package/types-cjs/frames/frame-transport.d.cts +161 -194
- package/types-cjs/frames/serializer-decode.d.cts +159 -0
- package/types-cjs/frames/serializer.d.cts +69 -157
- package/types-cjs/head.d.cts +16 -0
- package/types-cjs/index.d.cts +0 -65
- package/types-cjs/index.server.d.cts +125 -0
- package/types-cjs/jsx.d.cts +5 -13
- package/types-cjs/reconcile.d.cts +1 -0
- package/types-cjs/render.d.cts +4 -0
- package/types-cjs/response.d.cts +41 -153
- package/types-cjs/serializer-decode.d.cts +89 -112
- package/types-cjs/serializer.d.cts +69 -157
- package/types-cjs/server-functions/client.d.cts +93 -222
- package/types-cjs/server-functions/flash.d.cts +10 -30
- package/types-cjs/server-functions/registry.d.cts +63 -0
- package/types-cjs/server-functions/rich-args.d.cts +1 -10
- package/types-cjs/server-functions/server.d.cts +292 -574
- package/types-cjs/server-functions/shared.d.cts +112 -458
- package/types-cjs/server-mock.d.cts +2 -2
- package/types-cjs/server.d.cts +242 -434
- package/LICENSE +0 -21
- package/types/core.d.ts +0 -9
- package/types-cjs/core.d.cts +0 -9
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export type { ServerFunction, ServerFunctionMetadata, ServerFunctionRPC } from "./shared.js";
|
|
2
|
+
export declare const SERVER_FUNCTION_METADATA: unique symbol;
|
|
3
|
+
/**
|
|
4
|
+
* Reads a server function reference's declaration metadata (e.g.
|
|
5
|
+
* `method: "GET"` for `GET(fn)` references). Returns undefined when `fn`
|
|
6
|
+
* is not a server function reference; plain references carry an empty
|
|
7
|
+
* metadata object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getServerFunctionMetadata(fn: any): any;
|
|
10
|
+
/**
|
|
11
|
+
* Whether `fn` is a server function reference (a client proxy or a
|
|
12
|
+
* server-side registered callable). Detection is by the registered-symbol
|
|
13
|
+
* metadata brand, so it holds across duplicated module instances.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isServerFunction(fn: any): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Attaches user-declared transport metadata to a server function reference
|
|
18
|
+
* (client proxy or server-registered callable) and returns the reference.
|
|
19
|
+
* Writes ride the same channel `GET` uses: later writes shallow-merge over
|
|
20
|
+
* earlier ones, and `getServerFunctionMetadata(fn)` reads the merged bag —
|
|
21
|
+
* so `withMeta` composes with `GET` in either order.
|
|
22
|
+
*
|
|
23
|
+
* The pattern is declare-on-function, react-in-hook: metadata declared
|
|
24
|
+
* here is what `prepareRequest` receives as `context.meta`, letting
|
|
25
|
+
* session-dynamic transport policy key on declarations instead of
|
|
26
|
+
* comparing function ids:
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* export const chargeCard = withMeta(async (amount: number) => {
|
|
30
|
+
* "use server";
|
|
31
|
+
* // ...
|
|
32
|
+
* }, { requiresAuth: true });
|
|
33
|
+
*
|
|
34
|
+
* configureServerFunctionsClient({
|
|
35
|
+
* prepareRequest(init, { meta }) {
|
|
36
|
+
* if (meta?.requiresAuth) {
|
|
37
|
+
* return {
|
|
38
|
+
* ...init,
|
|
39
|
+
* headers: { ...init.headers, Authorization: `Bearer ${session.token()}` }
|
|
40
|
+
* };
|
|
41
|
+
* }
|
|
42
|
+
* return init;
|
|
43
|
+
* }
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function withMeta(fn: any, meta: any): any;
|
|
48
|
+
export declare const LIVE_SOURCE: unique symbol;
|
|
49
|
+
/**
|
|
50
|
+
* Fills the RPC seam. Called by the transport halves (client fetch RPC,
|
|
51
|
+
* server in-process dispatch) when the first server function reference is
|
|
52
|
+
* created; first write wins — both halves register equivalent surfaces, and
|
|
53
|
+
* a per-build half never coexists with the other build's.
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
export declare function provideServerFunctionRPC(rpc: any): void;
|
|
57
|
+
/**
|
|
58
|
+
* The registered RPC surface, or undefined when no server function exists
|
|
59
|
+
* in this build's graph. Integration plumbing (routers): gate every use of
|
|
60
|
+
* the transport/codec behind this read instead of importing it.
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export declare function getServerFunctionRPC(): any;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Opt-in codec encoding for server-function ARGUMENTS. By default the client
|
|
3
|
-
* sends argument lists as plain JSON (no serializer in the bundle) and
|
|
4
|
-
* throws on values JSON can't carry faithfully. Call once at startup to
|
|
5
|
-
* send Dates, Maps, Sets, typed arrays, cyclic structures, etc. through the
|
|
6
|
-
* codec — at the cost of the serializer's write half (~5 KB gz on top of
|
|
7
|
-
* the decode half responses already need). The handler accepts both
|
|
8
|
-
* encodings unconditionally.
|
|
9
|
-
*/
|
|
10
|
-
export function enableRichArguments(): void;
|
|
1
|
+
export declare function enableRichArguments(): void;
|