@solidjs/web 2.0.0-rc.6 → 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.
Files changed (82) hide show
  1. package/dist/{server.cjs → server.dev.js} +274 -272
  2. package/dist/server.js +119 -36
  3. package/dist/{dev.js → web.dev.js} +131 -399
  4. package/dist/web.js +78 -388
  5. package/dist/{web.cjs → web.observe.js} +174 -622
  6. package/frames/dist/client.dev.js +11 -3
  7. package/frames/dist/client.js +11 -3
  8. package/frames/dist/{server.cjs → server.dev.js} +375 -125
  9. package/frames/dist/server.js +253 -32
  10. package/frames/package.json +7 -15
  11. package/package.json +88 -251
  12. package/serialization/decode/package.json +3 -9
  13. package/serialization/dist/decode.js +18 -4
  14. package/serialization/dist/serialization.js +18 -4
  15. package/serialization/package.json +3 -9
  16. package/serialization/types/serializer-decode.d.ts +49 -2
  17. package/server-functions/dist/client.js +13 -14
  18. package/server-functions/dist/server.dev.js +359 -85
  19. package/server-functions/dist/server.js +352 -86
  20. package/server-functions/package.json +6 -24
  21. package/server-functions/rich-args/package.json +3 -9
  22. package/storage/package.json +3 -9
  23. package/types/client.d.ts +17 -3
  24. package/types/frames/frame-client.d.ts +1 -1
  25. package/types/frames/serializer-decode.d.ts +49 -2
  26. package/types/head.d.ts +3 -0
  27. package/types/index.d.ts +18 -7
  28. package/types/index.server.d.ts +31 -9
  29. package/types/render.d.ts +3 -1
  30. package/types/serializer-decode.d.ts +49 -2
  31. package/types/server-functions/flash.d.ts +12 -3
  32. package/types/server-functions/server.d.ts +50 -3
  33. package/types/server-mock.d.ts +43 -7
  34. package/types/server.d.ts +48 -6
  35. package/dist/dev.cjs +0 -2590
  36. package/frames/dist/client.cjs +0 -2035
  37. package/frames/dist/client.dev.cjs +0 -2055
  38. package/serialization/dist/decode.cjs +0 -141
  39. package/serialization/dist/serialization.cjs +0 -261
  40. package/serialization/types-cjs/index.d.cts +0 -101
  41. package/serialization/types-cjs/package.json +0 -3
  42. package/serialization/types-cjs/serializer-decode.d.cts +0 -172
  43. package/serialization/types-cjs/serializer.d.cts +0 -101
  44. package/server-functions/dist/client.cjs +0 -1070
  45. package/server-functions/dist/rich-args.cjs +0 -11
  46. package/server-functions/dist/server.cjs +0 -2133
  47. package/server-functions/dist/server.dev.cjs +0 -2153
  48. package/storage/dist/storage.cjs +0 -12
  49. package/storage/types-cjs/index.d.cts +0 -28
  50. package/storage/types-cjs/package.json +0 -3
  51. package/types/patch-driver.d.ts +0 -3
  52. package/types-cjs/client.d.cts +0 -200
  53. package/types-cjs/constants.d.cts +0 -20
  54. package/types-cjs/cookies.d.cts +0 -41
  55. package/types-cjs/frames/client.d.cts +0 -36
  56. package/types-cjs/frames/frame-client.d.cts +0 -370
  57. package/types-cjs/frames/frame-container-plugin.d.cts +0 -71
  58. package/types-cjs/frames/frame-sink.d.cts +0 -92
  59. package/types-cjs/frames/frame-transport.d.cts +0 -189
  60. package/types-cjs/frames/serializer-decode.d.cts +0 -172
  61. package/types-cjs/frames/serializer.d.cts +0 -101
  62. package/types-cjs/frames/server.d.cts +0 -52
  63. package/types-cjs/head.d.cts +0 -16
  64. package/types-cjs/index.d.cts +0 -180
  65. package/types-cjs/index.server.d.cts +0 -125
  66. package/types-cjs/jsx-properties.d.cts +0 -93
  67. package/types-cjs/jsx.d.cts +0 -4146
  68. package/types-cjs/package.json +0 -3
  69. package/types-cjs/patch-driver.d.cts +0 -3
  70. package/types-cjs/reconcile.d.cts +0 -1
  71. package/types-cjs/render.d.cts +0 -4
  72. package/types-cjs/response.d.cts +0 -81
  73. package/types-cjs/serializer-decode.d.cts +0 -172
  74. package/types-cjs/serializer.d.cts +0 -101
  75. package/types-cjs/server-functions/client.d.cts +0 -184
  76. package/types-cjs/server-functions/flash.d.cts +0 -27
  77. package/types-cjs/server-functions/registry.d.cts +0 -100
  78. package/types-cjs/server-functions/rich-args.d.cts +0 -1
  79. package/types-cjs/server-functions/server.d.cts +0 -522
  80. package/types-cjs/server-functions/shared.d.cts +0 -283
  81. package/types-cjs/server-mock.d.cts +0 -301
  82. package/types-cjs/server.d.cts +0 -366
@@ -1,101 +0,0 @@
1
- import { Serializer } from "seroval";
2
- import type { JSONCodecOptions, PluginInfo, SerializerPlugin, SerovalNode } from "./serializer-decode.cjs";
3
- export { DEFAULT_WEB_PLUGINS, createJSONDataTable, createJSONDeserializer, resolveSerializerPlugins } from "./serializer-decode.cjs";
4
- export type * from "./serializer-decode.cjs";
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
- };