@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.
Files changed (78) hide show
  1. package/dist/dev.cjs +86 -61
  2. package/dist/dev.js +81 -60
  3. package/dist/server.cjs +34 -17
  4. package/dist/server.js +35 -19
  5. package/dist/web.cjs +83 -59
  6. package/dist/web.js +78 -58
  7. package/frames/dist/client.cjs +8 -8
  8. package/frames/dist/client.dev.cjs +8 -8
  9. package/frames/dist/client.dev.js +8 -8
  10. package/frames/dist/client.js +8 -8
  11. package/frames/dist/server.cjs +28 -18
  12. package/frames/dist/server.js +29 -19
  13. package/package.json +20 -22
  14. package/serialization/dist/decode.cjs +3 -3
  15. package/serialization/dist/decode.js +3 -3
  16. package/serialization/dist/serialization.cjs +7 -11
  17. package/serialization/dist/serialization.js +7 -6
  18. package/serialization/types/index.d.ts +69 -157
  19. package/serialization/types/serializer-decode.d.ts +89 -112
  20. package/serialization/types/serializer.d.ts +94 -0
  21. package/serialization/types-cjs/index.d.cts +69 -157
  22. package/serialization/types-cjs/serializer-decode.d.cts +89 -112
  23. package/serialization/types-cjs/serializer.d.cts +94 -0
  24. package/types/client.d.ts +150 -290
  25. package/types/constants.d.ts +18 -0
  26. package/types/cookies.d.ts +31 -75
  27. package/types/frames/frame-client.d.ts +287 -277
  28. package/types/frames/frame-container-plugin.d.ts +71 -0
  29. package/types/frames/frame-sink.d.ts +58 -160
  30. package/types/frames/frame-transport.d.ts +161 -194
  31. package/types/frames/serializer-decode.d.ts +159 -0
  32. package/types/frames/serializer.d.ts +69 -157
  33. package/types/head.d.ts +16 -0
  34. package/types/index.d.ts +0 -65
  35. package/types/index.server.d.ts +125 -0
  36. package/types/jsx.d.ts +5 -13
  37. package/types/reconcile.d.ts +1 -0
  38. package/types/render.d.ts +4 -0
  39. package/types/response.d.ts +41 -153
  40. package/types/serializer-decode.d.ts +89 -112
  41. package/types/serializer.d.ts +69 -157
  42. package/types/server-functions/client.d.ts +93 -222
  43. package/types/server-functions/flash.d.ts +10 -30
  44. package/types/server-functions/registry.d.ts +63 -0
  45. package/types/server-functions/rich-args.d.ts +1 -10
  46. package/types/server-functions/server.d.ts +292 -574
  47. package/types/server-functions/shared.d.ts +112 -458
  48. package/types/server-mock.d.ts +2 -2
  49. package/types/server.d.ts +242 -434
  50. package/types-cjs/client.d.cts +150 -290
  51. package/types-cjs/constants.d.cts +18 -0
  52. package/types-cjs/cookies.d.cts +31 -75
  53. package/types-cjs/frames/frame-client.d.cts +287 -277
  54. package/types-cjs/frames/frame-container-plugin.d.cts +71 -0
  55. package/types-cjs/frames/frame-sink.d.cts +58 -160
  56. package/types-cjs/frames/frame-transport.d.cts +161 -194
  57. package/types-cjs/frames/serializer-decode.d.cts +159 -0
  58. package/types-cjs/frames/serializer.d.cts +69 -157
  59. package/types-cjs/head.d.cts +16 -0
  60. package/types-cjs/index.d.cts +0 -65
  61. package/types-cjs/index.server.d.cts +125 -0
  62. package/types-cjs/jsx.d.cts +5 -13
  63. package/types-cjs/reconcile.d.cts +1 -0
  64. package/types-cjs/render.d.cts +4 -0
  65. package/types-cjs/response.d.cts +41 -153
  66. package/types-cjs/serializer-decode.d.cts +89 -112
  67. package/types-cjs/serializer.d.cts +69 -157
  68. package/types-cjs/server-functions/client.d.cts +93 -222
  69. package/types-cjs/server-functions/flash.d.cts +10 -30
  70. package/types-cjs/server-functions/registry.d.cts +63 -0
  71. package/types-cjs/server-functions/rich-args.d.cts +1 -10
  72. package/types-cjs/server-functions/server.d.cts +292 -574
  73. package/types-cjs/server-functions/shared.d.cts +112 -458
  74. package/types-cjs/server-mock.d.cts +2 -2
  75. package/types-cjs/server.d.cts +242 -434
  76. package/LICENSE +0 -21
  77. package/types/core.d.ts +0 -9
  78. package/types-cjs/core.d.cts +0 -9
@@ -0,0 +1,63 @@
1
+ export type { ServerFunction, ServerFunctionMetadata, ServerFunctionRPC } from "./shared.cjs";
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;