@solidjs/web 2.0.0-rc.1 → 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.
Files changed (107) hide show
  1. package/dist/server.dev.js +4472 -0
  2. package/dist/server.js +1301 -251
  3. package/dist/{server.cjs → server.observe.js} +1501 -452
  4. package/dist/{dev.cjs → web.dev.js} +699 -360
  5. package/dist/web.js +454 -139
  6. package/dist/{dev.js → web.observe.js} +505 -211
  7. package/frames/dist/client.dev.js +463 -71
  8. package/frames/dist/client.js +363 -70
  9. package/frames/dist/{client.dev.cjs → client.observe.js} +486 -133
  10. package/frames/dist/server.dev.js +1713 -0
  11. package/frames/dist/server.js +552 -2583
  12. package/frames/dist/server.observe.js +1713 -0
  13. package/frames/package.json +2 -25
  14. package/package.json +214 -255
  15. package/performance-tracks/dist/performance-tracks.dev.js +678 -0
  16. package/performance-tracks/dist/performance-tracks.js +6 -0
  17. package/performance-tracks/dist/performance-tracks.observe.js +666 -0
  18. package/performance-tracks/package.json +7 -0
  19. package/performance-tracks/types/index.d.ts +67 -0
  20. package/serialization/decode/package.json +2 -15
  21. package/serialization/dist/decode.js +92 -15
  22. package/serialization/dist/serialization.js +103 -23
  23. package/serialization/package.json +2 -15
  24. package/serialization/types/index.d.ts +76 -157
  25. package/serialization/types/serializer-decode.d.ts +149 -112
  26. package/serialization/types/serializer.d.ts +101 -0
  27. package/server-functions/dist/client.dev.js +1364 -0
  28. package/server-functions/dist/client.js +611 -97
  29. package/server-functions/dist/client.observe.js +1343 -0
  30. package/server-functions/dist/server.dev.js +2138 -202
  31. package/server-functions/dist/server.js +2042 -199
  32. package/server-functions/dist/server.observe.js +3043 -0
  33. package/server-functions/package.json +2 -35
  34. package/server-functions/rich-args/package.json +2 -15
  35. package/storage/package.json +2 -15
  36. package/types/client.d.ts +193 -288
  37. package/types/constants.d.ts +20 -0
  38. package/types/cookies.d.ts +32 -84
  39. package/types/diagnostics.d.ts +56 -0
  40. package/types/frames/client.d.ts +1 -1
  41. package/types/frames/frame-client.d.ts +323 -259
  42. package/types/frames/frame-container-plugin.d.ts +72 -0
  43. package/types/frames/frame-sink.d.ts +101 -158
  44. package/types/frames/frame-transport.d.ts +192 -190
  45. package/types/frames/serializer-decode.d.ts +219 -0
  46. package/types/frames/serializer.d.ts +76 -157
  47. package/types/frames/server.d.ts +1 -1
  48. package/types/head.d.ts +19 -0
  49. package/types/index.d.ts +52 -80
  50. package/types/index.server.d.ts +174 -0
  51. package/types/jsx.d.ts +33 -35
  52. package/types/observe.d.ts +358 -0
  53. package/types/reconcile.d.ts +1 -0
  54. package/types/render.d.ts +9 -0
  55. package/types/response.d.ts +75 -150
  56. package/types/serializer-decode.d.ts +149 -112
  57. package/types/serializer.d.ts +76 -157
  58. package/types/server-functions/client.d.ts +192 -194
  59. package/types/server-functions/flash.d.ts +28 -30
  60. package/types/server-functions/registry.d.ts +102 -0
  61. package/types/server-functions/rich-args.d.ts +1 -10
  62. package/types/server-functions/server.d.ts +511 -475
  63. package/types/server-functions/shared.d.ts +366 -425
  64. package/types/server-mock.d.ts +110 -13
  65. package/types/server-observe.d.ts +77 -0
  66. package/types/server.d.ts +425 -425
  67. package/types/trace.d.ts +127 -0
  68. package/LICENSE +0 -21
  69. package/dist/web.cjs +0 -2008
  70. package/frames/dist/client.cjs +0 -1916
  71. package/frames/dist/server.cjs +0 -3756
  72. package/serialization/dist/decode.cjs +0 -122
  73. package/serialization/dist/serialization.cjs +0 -244
  74. package/serialization/types-cjs/index.d.cts +0 -182
  75. package/serialization/types-cjs/package.json +0 -3
  76. package/serialization/types-cjs/serializer-decode.d.cts +0 -182
  77. package/server-functions/dist/client.cjs +0 -793
  78. package/server-functions/dist/rich-args.cjs +0 -11
  79. package/server-functions/dist/server.cjs +0 -1171
  80. package/server-functions/dist/server.dev.cjs +0 -1171
  81. package/storage/dist/storage.cjs +0 -12
  82. package/storage/types-cjs/index.d.cts +0 -28
  83. package/storage/types-cjs/package.json +0 -3
  84. package/types/core.d.ts +0 -6
  85. package/types-cjs/client.d.cts +0 -337
  86. package/types-cjs/cookies.d.cts +0 -93
  87. package/types-cjs/core.d.cts +0 -6
  88. package/types-cjs/frames/client.d.cts +0 -36
  89. package/types-cjs/frames/frame-client.d.cts +0 -338
  90. package/types-cjs/frames/frame-sink.d.cts +0 -194
  91. package/types-cjs/frames/frame-transport.d.cts +0 -222
  92. package/types-cjs/frames/serializer.d.cts +0 -182
  93. package/types-cjs/frames/server.d.cts +0 -52
  94. package/types-cjs/index.d.cts +0 -244
  95. package/types-cjs/jsx-properties.d.cts +0 -93
  96. package/types-cjs/jsx.d.cts +0 -4159
  97. package/types-cjs/package.json +0 -3
  98. package/types-cjs/response.d.cts +0 -174
  99. package/types-cjs/serializer-decode.d.cts +0 -182
  100. package/types-cjs/serializer.d.cts +0 -182
  101. package/types-cjs/server-functions/client.d.cts +0 -231
  102. package/types-cjs/server-functions/flash.d.cts +0 -38
  103. package/types-cjs/server-functions/rich-args.d.cts +0 -10
  104. package/types-cjs/server-functions/server.d.cts +0 -616
  105. package/types-cjs/server-functions/shared.d.cts +0 -523
  106. package/types-cjs/server-mock.d.cts +0 -277
  107. package/types-cjs/server.d.cts +0 -523
@@ -1,40 +1,7 @@
1
1
  {
2
- "name": "@solidjs/web/server-functions",
3
- "main": "./dist/server.cjs",
2
+ "main": "./dist/server.js",
4
3
  "module": "./dist/server.js",
5
4
  "types": "../types/server-functions/server.d.ts",
6
5
  "type": "module",
7
- "sideEffects": false,
8
- "exports": {
9
- ".": {
10
- "browser": {
11
- "import": {
12
- "types": "../types/server-functions/client.d.ts",
13
- "default": "./dist/client.js"
14
- },
15
- "require": {
16
- "types": "../types-cjs/server-functions/client.d.cts",
17
- "default": "./dist/client.cjs"
18
- }
19
- },
20
- "development": {
21
- "import": {
22
- "types": "../types/server-functions/server.d.ts",
23
- "default": "./dist/server.dev.js"
24
- },
25
- "require": {
26
- "types": "../types-cjs/server-functions/server.d.cts",
27
- "default": "./dist/server.dev.cjs"
28
- }
29
- },
30
- "import": {
31
- "types": "../types/server-functions/server.d.ts",
32
- "default": "./dist/server.js"
33
- },
34
- "require": {
35
- "types": "../types-cjs/server-functions/server.d.cts",
36
- "default": "./dist/server.cjs"
37
- }
38
- }
39
- }
6
+ "sideEffects": false
40
7
  }
@@ -1,20 +1,7 @@
1
1
  {
2
- "name": "@solidjs/web/server-functions/rich-args",
3
- "main": "../dist/rich-args.cjs",
2
+ "main": "../dist/rich-args.js",
4
3
  "module": "../dist/rich-args.js",
5
4
  "types": "../../types/server-functions/rich-args.d.ts",
6
5
  "type": "module",
7
- "sideEffects": false,
8
- "exports": {
9
- ".": {
10
- "import": {
11
- "types": "../../types/server-functions/rich-args.d.ts",
12
- "default": "../dist/rich-args.js"
13
- },
14
- "require": {
15
- "types": "../../types-cjs/server-functions/rich-args.d.cts",
16
- "default": "../dist/rich-args.cjs"
17
- }
18
- }
19
- }
6
+ "sideEffects": false
20
7
  }
@@ -1,20 +1,7 @@
1
1
  {
2
- "name": "@solidjs/web/storage",
3
- "main": "./dist/storage.cjs",
2
+ "main": "./dist/storage.js",
4
3
  "module": "./dist/storage.js",
5
4
  "types": "./types/index.d.ts",
6
5
  "type": "module",
7
- "sideEffects": false,
8
- "exports": {
9
- ".": {
10
- "import": {
11
- "types": "./types/index.d.ts",
12
- "default": "./dist/storage.js"
13
- },
14
- "require": {
15
- "types": "./types-cjs/index.d.cts",
16
- "default": "./dist/storage.cjs"
17
- }
18
- }
19
- }
6
+ "sideEffects": false
20
7
  }
package/types/client.d.ts CHANGED
@@ -1,199 +1,10 @@
1
+ import { getOwner, createComponent, untrack, merge as mergeProps } from "solid-js";
2
+ import type { ClientErrorHook } from "solid-js";
3
+ import { effect, memo } from "./render.js";
1
4
  import { JSX } from "./jsx.js";
2
5
  import type { RequestEventLocals } from "./server.js";
3
- // Element/property classification tables consumed by the JSX compiler and
4
- // custom renderers. Compiler/tooling surface; not for hand-written code.
5
- /** Compiler/tooling table; not for hand-written code. @internal */
6
- export const DOMWithState: Record<string, Record<string, 1 | 2>>;
7
- /** Compiler/tooling table; not for hand-written code. @internal */
8
- export const ChildProperties: Set<string>;
9
- /** Compiler/tooling table; not for hand-written code. @internal */
10
- export const DelegatedEvents: Set<string>;
11
- /** Compiler/tooling table; not for hand-written code. @internal */
12
- export const DOMElements: Set<string>;
13
- /** Compiler/tooling table; not for hand-written code. @internal */
14
- export const SVGElements: Set<string>;
15
- /** Compiler/tooling table; not for hand-written code. @internal */
16
- export const MathMLElements: Set<string>;
17
- /** Compiler/tooling table; not for hand-written code. @internal */
18
- export const VoidElements: Set<string>;
19
- /** Compiler/tooling table; not for hand-written code. @internal */
20
- export const RawTextElements: Set<string>;
21
- /** Compiler/tooling table; not for hand-written code. @internal */
22
- export const Namespaces: Record<string, string>;
23
-
6
+ import type { TraceContext } from "./trace.js";
24
7
  type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
25
- export function render(
26
- code: () => JSX.Element,
27
- element: MountableElement,
28
- init?: JSX.Element,
29
- options?: { owner?: unknown }
30
- ): () => void;
31
- /**
32
- * Compiler-emitted primitive; not for hand-written code.
33
- * @param flag
34
- * - `undefined` — clone the template as-is (uses `cloneNode`).
35
- * - `1` — use `document.importNode` instead of `cloneNode`.
36
- * - `2` — the template html is wrapped; the outer tag is stripped at clone time.
37
- * @internal
38
- */
39
- export function template(html: string, flag?: 1 | 2): () => Element;
40
- /** Compiler-emitted primitive; not for hand-written code. @internal */
41
- export function scope<T extends () => any>(fn: T): T;
42
- /** Compiler-emitted primitive; not for hand-written code. @internal */
43
- export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void): void;
44
- /** Compiler-emitted primitive; not for hand-written code. @internal */
45
- export function memo<T>(fn: () => T, equal: boolean): () => T;
46
- /**
47
- * Compiler-emitted primitive; not for hand-written code — import `untrack`
48
- * from `solid-js` instead.
49
- * @internal
50
- */
51
- export function untrack<T>(fn: () => T): T;
52
- /**
53
- * Compiler-emitted primitive; not for hand-written code.
54
- * @internal
55
- */
56
- export function insert<T>(
57
- parent: MountableElement,
58
- accessor: (() => T) | T,
59
- marker?: Node | null,
60
- init?: JSX.Element,
61
- options?: {
62
- /**
63
- * Live accessor for the slot's logical host in the source tree (portals).
64
- * Each top-level node the slot manages is tagged with a `_$host` getter
65
- * backed by this accessor so delegated events retarget correctly.
66
- */
67
- host?: () => Node | null;
68
- /** Defer the insert effect to the queue instead of running it inline. */
69
- schedule?: boolean;
70
- }
71
- ): JSX.Element;
72
- /** Compiler-emitted primitive; not for hand-written code. @internal */
73
- export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): JSX.Element;
74
- /** Compiler-emitted primitive; not for hand-written code. @internal */
75
- export function delegateEvents(eventNames: string[]): void;
76
- /** Event-delegation plumbing (Portal/custom-root wiring). Integration plumbing. @internal */
77
- export function registerDelegatedRoot(root: MountableElement): void;
78
- /** Event-delegation plumbing (Portal/custom-root wiring). Integration plumbing. @internal */
79
- export function unregisterDelegatedRoot(root: MountableElement): void;
80
- /** Event-delegation plumbing (Portal/custom-root wiring). Integration plumbing. @internal */
81
- export function registerDelegatedContainer(
82
- container: MountableElement,
83
- owner?: MountableElement
84
- ): void;
85
- /** Event-delegation plumbing (Portal/custom-root wiring). Integration plumbing. @internal */
86
- export function unregisterDelegatedContainer(
87
- container: MountableElement,
88
- owner?: MountableElement
89
- ): void;
90
- /** Event-delegation plumbing (Portal/custom-root wiring). Integration plumbing. @internal */
91
- export function getDelegatedRoot(node: MountableElement): MountableElement | undefined;
92
- /** Compiler-emitted primitive; not for hand-written code. @internal */
93
- export function spread<T>(node: Element, accessor: T, skipChildren?: Boolean): void;
94
- /** Compiler-emitted primitive; not for hand-written code. @internal */
95
- export function assign(
96
- node: Element,
97
- props: any,
98
- skipChildren?: Boolean,
99
- prevProps?: any,
100
- skipRef?: Boolean
101
- ): void;
102
- /** Compiler-emitted primitive; not for hand-written code. @internal */
103
- export function setAttribute(node: Element, name: string, value: string): void;
104
- /** Compiler-emitted primitive; not for hand-written code. @internal */
105
- export function setAttributeNS(node: Element, namespace: string, name: string, value: string): void;
106
- /**
107
- * Register a consumer for compiler-emitted element claims. Compiled DOM
108
- * output claims navigation-relevant elements (`a[href]`, `form[action]`) at
109
- * creation, and compiler-owned writes to `href`/`action` re-invoke the same
110
- * handlers — so handlers must be idempotent and must check the element's
111
- * relevance themselves (rechecks can fire for any element whose
112
- * `href`/`action` is written, e.g. `<link href>`). Handlers run under the
113
- * reactive owner current at element creation; scope per-element state and
114
- * cleanup through your own reactive system. Dormant until registered —
115
- * without a handler the emitted claims are null checks. Returns an
116
- * unregister function.
117
- *
118
- * Integration plumbing (routers register the consumer); not meant for
119
- * application code.
120
- * @internal
121
- */
122
- export function registerElementClaim(handler: (element: Element) => void): () => void;
123
- /**
124
- * Claim `node` for registered consumers (see `registerElementClaim`).
125
- * Emitted by the compiler at element creation; idempotent by contract.
126
- * @internal
127
- */
128
- export function claimElement<T extends Element>(node: T): T;
129
- /**
130
- * Sweep-claim every navigation-relevant element (`a[href]`, `form[action]`)
131
- * in `root` — the subtree equivalent of the per-element `claimElement`
132
- * compiled output emits, for content that becomes live DOM without compiled
133
- * creation code (frame streams, adopted SSR ranges). Dormant without a
134
- * registered consumer.
135
- *
136
- * Integration plumbing; not meant for application code.
137
- * @internal
138
- */
139
- export function claimElementTree<T extends Node>(root: T): T;
140
- /** Compiler-emitted primitive; not for hand-written code. @internal */
141
- export function className(node: Element, value: JSX.ClassValue, prev?: JSX.ClassValue): void;
142
- /** Compiler-emitted primitive; not for hand-written code. @internal */
143
- export function setProperty(node: Element, name: string, value: any): void;
144
- /** Compiler-emitted primitive; not for hand-written code. @internal */
145
- export function setStyleProperty(node: Element, name: string, value: any): void;
146
- /** Compiler-emitted primitive; not for hand-written code. @internal */
147
- export function addEvent(
148
- node: Element,
149
- name: string,
150
- handler: EventListener | EventListenerObject | (EventListenerObject & AddEventListenerOptions),
151
- delegate: boolean
152
- ): void;
153
- /** Compiler-emitted primitive; not for hand-written code. @internal */
154
- export function style(
155
- node: Element,
156
- value: { [k: string]: string },
157
- prev?: { [k: string]: string }
158
- ): void;
159
- /**
160
- * Compiler-emitted primitive; not for hand-written code — import `getOwner`
161
- * from `solid-js` instead.
162
- * @internal
163
- */
164
- export function getOwner(): unknown;
165
- /**
166
- * Compiler-emitted prop-spread helper; not for hand-written code — import
167
- * `merge` from `solid-js` instead.
168
- * @internal
169
- */
170
- export function mergeProps(...sources: unknown[]): unknown;
171
- /** Compiler-emitted primitive; not for hand-written code. @internal */
172
- export function dynamicProperty(props: unknown, key: string): unknown;
173
- /** Compiler-emitted primitive; not for hand-written code. @internal */
174
- export function applyRef<T extends Element = Element>(
175
- r: ((element: NoInfer<T>) => void) | ((element: NoInfer<T>) => void)[],
176
- element: T
177
- ): void;
178
- /** Compiler-emitted primitive; not for hand-written code. @internal */
179
- export function ref(
180
- fn: () => ((element: Element) => void) | ((element: Element) => void)[],
181
- element: Element
182
- ): void;
183
-
184
- export function hydrate(
185
- fn: () => JSX.Element,
186
- node: MountableElement,
187
- options?: { renderId?: string; owner?: unknown }
188
- ): () => void;
189
- /** Hydration-walk primitive; not for hand-written code. @internal */
190
- export function getHydrationKey(): string | undefined;
191
- /** Hydration-walk primitive; not for hand-written code. @internal */
192
- export function getNextElement(template?: () => Element): Element;
193
- /** Hydration-walk primitive; not for hand-written code. @internal */
194
- export function getNextMatch(start: Node, elementName: string): Element;
195
- /** Hydration-walk primitive; not for hand-written code. @internal */
196
- export function getNextMarker(start: Node): [Node, Array<Node>];
197
8
  /**
198
9
  * A head tag descriptor. Props values may be getters (reactive on the
199
10
  * client); `children` is the text body. `key` overrides the built-in dedupe
@@ -207,42 +18,30 @@ export function getNextMarker(start: Node): [Node, Array<Node>];
207
18
  * read them from the getter. See docs/head-management-rfc.md.
208
19
  */
209
20
  export type HeadTag = {
210
- tag: "title" | "meta" | "link" | "style" | "script" | "base";
211
- props: Record<string, any>;
212
- key?: string | (() => string);
21
+ tag: "title" | "meta" | "link" | "style" | "script" | "base";
22
+ props: Record<string, any>;
23
+ key?: string | (() => string);
213
24
  };
214
- /**
215
- * Registers head tags with the ambient head registry under the current
216
- * owner. An array is a group — one replacement set; a function is a
217
- * reactive group whose membership is tracked and re-read on change.
218
- * Resolution is last-committed group per identity (reactive updates keep
219
- * the registration's original commit position); disposal restores the
220
- * previous winner. During hydration the server-flushed head state stays
221
- * authoritative until hydration completes. See docs/head-management-rfc.md.
222
- */
223
- export function useHead(tag: HeadTag | HeadTag[] | (() => HeadTag | HeadTag[])): void;
224
- export type AssetDescriptor =
225
- | { type: "style"; href: string; attrs?: Record<string, string> }
226
- | { type: "inline-style"; id: string; content?: string; attrs?: Record<string, string> }
227
- | { type: "module"; href: string }
228
- | ExclusiveAssetDescriptor<any>;
25
+ export type AssetDescriptor = {
26
+ type: "style";
27
+ href: string;
28
+ attrs?: Record<string, string>;
29
+ } | {
30
+ type: "inline-style";
31
+ id: string;
32
+ content?: string;
33
+ attrs?: Record<string, string>;
34
+ } | {
35
+ type: "module";
36
+ href: string;
37
+ } | ExclusiveAssetDescriptor<any>;
229
38
  export interface ExclusiveAssetDescriptor<T> {
230
- policy: "exclusive";
231
- key: string;
232
- value: T;
233
- get(): T;
234
- set(value: T): void;
39
+ policy: "exclusive";
40
+ key: string;
41
+ value: T;
42
+ get(): T;
43
+ set(value: T): void;
235
44
  }
236
- /**
237
- * @internal Ref-counted client asset ownership: acquire adopts or mounts the
238
- * asset, the returned release follows the owner (with a grace period for
239
- * back-and-forth navigation). Internal machinery, not a public CSS-lifecycle
240
- * API — per the head-management RFC (docs/head-management-rfc.md), ambient
241
- * bundler-injected CSS is never lifecycle-managed, and the head registry
242
- * owns the lifecycle of directly-mounted stylesheets outright. This keeps
243
- * its non-head roles (exclusive slots, owner-following DOM ownership).
244
- */
245
- export function acquireAsset(descriptor: AssetDescriptor): () => void;
246
45
  /**
247
46
  * Registry entry returned by `warmAsset`. Stylesheet entries carry load
248
47
  * tracking for the client reveal gate (docs/client-css-reveal-gating.md):
@@ -250,38 +49,23 @@ export function acquireAsset(descriptor: AssetDescriptor): () => void;
250
49
  * sheet releases the gate, parity with the server gate.
251
50
  */
252
51
  export interface AssetEntry {
253
- loadState?: "pending" | "loaded" | "errored";
254
- loadPromise?: Promise<void>;
52
+ loadState?: "pending" | "loaded" | "errored";
53
+ loadPromise?: Promise<void>;
255
54
  }
256
- /**
257
- * @internal Warm half of `acquireAsset`: idempotent and refcount-free,
258
- * callable from a compute phase so the fetch starts at discovery and
259
- * overlaps a transition's data wait. Stylesheets warm as
260
- * `rel="preload" as="style"` and are flipped live by `acquireAsset` at
261
- * commit — a branch superseded before it commits leaks only an inert
262
- * preload, never an applied sheet. Only link-backed descriptors warm;
263
- * inline styles and exclusive slots return `undefined`.
264
- */
265
- export function warmAsset(descriptor: AssetDescriptor): AssetEntry | undefined;
266
- export function HydrationScript(props?: { nonce?: string; eventNames?: string[] }): JSX.Element;
267
- export function generateHydrationScript(options?: {
268
- nonce?: string;
269
- eventNames?: string[];
270
- }): string;
271
55
  /**
272
56
  * See the server entry's `ResponseStub` — the shape of the mutable response
273
57
  * head integrations expose as `event.response` via module augmentation.
274
58
  */
275
59
  export interface ResponseStub {
276
- status?: number;
277
- statusText?: string;
278
- headers: Headers;
279
- /**
280
- * Set by the integration once the response head has been derived/sent
281
- * from this stub (status/headers can no longer change); consumers must
282
- * treat later writes and cleanup-time retractions as no-ops.
283
- */
284
- committed?: boolean;
60
+ status?: number;
61
+ statusText?: string;
62
+ headers: Headers;
63
+ /**
64
+ * Set by the integration once the response head has been derived/sent
65
+ * from this stub (status/headers can no longer change); consumers must
66
+ * treat later writes and cleanup-time retractions as no-ops.
67
+ */
68
+ committed?: boolean;
285
69
  }
286
70
  /**
287
71
  * See the server entry's `RequestEventLocals` — the augmentable type of
@@ -291,47 +75,168 @@ export interface ResponseStub {
291
75
  */
292
76
  export { RequestEventLocals } from "./server.js";
293
77
  export interface RequestEvent {
294
- request: Request;
295
- locals: RequestEventLocals;
78
+ request: Request;
79
+ locals: RequestEventLocals;
296
80
  }
297
- /**
298
- * Registered symbol (`Symbol.for("solid.RequestContext")`) naming the global
299
- * slot where `provideRequestEvent` parks the AsyncLocalStorage scoping
300
- * request events. Integration plumbing — read the event through
301
- * `getRequestEvent()` instead.
81
+ export type { CookieOptions } from "./cookies.js";
82
+ export type { CallEvent, CallListener, CallLive, FrameAppliedEvent, FrameEvent, FrameListener, FrameLive, FrameProducedEvent, InvocationEvent, InvocationListener, InvocationLive, RenderEvent, RenderListener, RenderLive } from "./observe.js";
83
+ export type { TraceContext, TraceProvider } from "./trace.js";
84
+ export type { ServerFunction, ServerFunctionMetadata, ServerFunctionRPC } from "./server-functions/shared.js";
85
+ export declare const waitAsset: (promise: Promise<unknown>) => void;
86
+ export { DOMWithState, ChildProperties, DOMElements, SVGElements, MathMLElements, VoidElements, RawTextElements, Namespaces, DelegatedEvents } from "./constants.js";
87
+ /** Client stub — hydration bootstrap is a server-only emit. */
88
+ export declare function generateHydrationScript(_options?: {
89
+ eventNames?: string[];
90
+ nonce?: string;
91
+ }): string;
92
+ /** Client stub — valid JSX component, renders nothing. */
93
+ export declare function HydrationScript(_props?: {
94
+ nonce?: string;
95
+ eventNames?: string[];
96
+ }): null;
97
+ export { effect, memo, untrack, getOwner, createComponent };
98
+ /**
99
+ * Compiler-emitted prop-spread helper. The JSX transform emits
100
+ * `mergeProps(...)` when compiling prop spreads on components — not a
101
+ * user-facing API. Application code should import `merge` from `solid-js`.
302
102
  * @internal
303
103
  */
304
- export declare const RequestContext: unique symbol;
305
- export function getRequestEvent(): RequestEvent | undefined;
104
+ export { mergeProps };
105
+ export declare const getRequestEvent: () => RequestEvent | undefined;
306
106
  /**
307
- * The cookie codec (the platform-gap primitives — see cookies.d.ts for the
308
- * blessed patterns): the real implementation on both entries, never a
309
- * stub — a pure value transformer has legitimate browser uses
310
- * (`document.cookie`). Tree-shakes away when unused.
107
+ * Client stub — the trace a request belongs to is a server-side reading
108
+ * (the incoming `traceparent`, the render's origination); the browser SDK
109
+ * that continues it reads the document's `<meta>`/`Server-Timing` instead.
311
110
  */
111
+ export declare const getTraceContext: () => TraceContext | undefined;
312
112
  export { parseCookieHeader, serializeCookie } from "./cookies.js";
313
- export type { CookieOptions } from "./cookies.js";
113
+ export { clearFlashCookie, hasFlashCookie } from "./cookies.js";
114
+ export { getServerFunctionMetadata, getServerFunctionRPC, isServerFunction } from "./server-functions/registry.js";
115
+ /**
116
+ * Renders a component tree into a DOM element. Returns a dispose function
117
+ * that tears the tree down and cleans up reactive scopes when called.
118
+ *
119
+ * The top-level insert is queued via `{ schedule: true }` so its initial
120
+ * DOM attach goes through the effect queue rather than executing inline.
121
+ * This lets the mount participate in transitions: if an uncaught async
122
+ * read surfaces during the initial render (no `Loading` ancestor absorbs
123
+ * it), the mount is held by the transition and attaches atomically once
124
+ * all pending settles. On the no-async happy path the tail `flush()`
125
+ * drains the queued callback so the attach is synchronous by the time
126
+ * `render()` returns. The dev enforcement window scopes
127
+ * `ASYNC_OUTSIDE_LOADING_BOUNDARY` to the initial mount only.
128
+ */
129
+ export declare function render(code: () => JSX.Element, element: MountableElement, init?: JSX.Element, options?: {
130
+ owner?: unknown;
131
+ renderId?: string;
132
+ /**
133
+ * This root's client error hook, ahead of `configureClientErrors`':
134
+ * every failure an error boundary under it renders a fallback for —
135
+ * the one event no global handler sees (an uncaught error halts the
136
+ * reactive system and reaches `reportError` / `window.onerror`). Once
137
+ * per error object; no return — the client has no wire to map for.
138
+ */
139
+ onError?: ClientErrorHook;
140
+ }): () => void;
141
+ export declare function template(html: string, flag?: 1 | 2): () => Element;
142
+ export declare function delegateEvents(eventNames: string[]): void;
143
+ export declare function registerDelegatedRoot(root: MountableElement): void;
144
+ export declare function unregisterDelegatedRoot(root: MountableElement): void;
145
+ export declare function registerDelegatedContainer(container: MountableElement, owner?: MountableElement): void;
146
+ export declare function unregisterDelegatedContainer(container: MountableElement, owner?: MountableElement): void;
147
+ export declare function getDelegatedRoot(node: MountableElement): MountableElement | undefined;
148
+ export declare function setProperty(node: Element, name: string, value: any): void;
149
+ export declare function registerElementClaim(handler: (element: Element) => void): () => void;
150
+ export declare function claimElementTree<T extends Node>(root: T): T;
151
+ export declare function claimElement<T extends Element>(node: T): T;
152
+ export declare function setAttribute(node: Element, name: string, value: string): void;
153
+ export declare function setAttributeNS(node: Element, namespace: string, name: string, value: string): void;
154
+ export declare function className(node: Element, value: JSX.ClassValue, prev?: JSX.ClassValue): void;
155
+ export declare function addEvent(node: Element, name: string, handler: EventListener | EventListenerObject | (EventListenerObject & AddEventListenerOptions), delegate: boolean): EventListener | EventListenerObject | void;
156
+ export declare function style(node: Element, value: {
157
+ [k: string]: string;
158
+ }, prev?: {
159
+ [k: string]: string;
160
+ }): void;
161
+ /** Compiler-emitted primitive; not for hand-written code. @internal
162
+ *
163
+ * Read an object-valued `style` / `class` binding ONE layer deep, TRACKED, in
164
+ * the compute half of its effect. (Not solid-js's `snapshot()`, which is a
165
+ * deep, untracked structural copy.) `style()` and `className()` enumerate their object in the
166
+ * effect's untracked commit phase, so a proxy-backed object (a store
167
+ * sub-object, merged props) was identity-reactive only: in-place key
168
+ * mutations never re-applied and every leaf read tripped
169
+ * STRICT_READ_UNTRACKED in dev. The compiler wraps the compute value of a
170
+ * non-inline `style={expr}` / `class={expr}` in this; spread() applies it to
171
+ * those two keys as it copies. Inline literals never get here — they compile
172
+ * per property. Identity passthrough for strings and plain objects (a fresh
173
+ * literal is already the compute's own); a proxy is copied with ONE
174
+ * `ownKeys` trap (its own trap keeps the key set tracked) plus one tracked
175
+ * read per key; a clsx-style class array is re-mapped element-wise (className
176
+ * allocates for an array anyway; measured at parity). */
177
+ export declare function readShallow(value: unknown): unknown;
178
+ /** Compiler-emitted primitive; not for hand-written code. @internal */
179
+ export declare function setStyleProperty(node: Element, name: string, value: any): void;
180
+ export declare function spread(node: Element, sources: unknown[], skipChildren?: Boolean, skip?: (key: string) => boolean, name?: string): void;
181
+ export declare function spread<T>(node: Element, accessor: T, skipChildren?: Boolean, skip?: (key: string) => boolean, name?: string): void;
182
+ export declare function dynamicProperty(props: unknown, key: string): unknown;
183
+ export declare function applyRef<T extends Element = Element>(r: ((element: NoInfer<T>) => void) | ((element: NoInfer<T>) => void)[], element: T): void;
184
+ export declare function ref(fn: () => ((element: Element) => void) | ((element: Element) => void)[], element: Element): void;
185
+ /** Compiler-emitted primitive; not for hand-written code. @internal */
186
+ export declare function scope<T extends () => any>(fn: T): T;
187
+ export declare function installHydrationRuntime(): void;
314
188
  /**
315
- * The flash cookie's isomorphic half (name/detection/clearing — cookie
316
- * utilities living beside the cookie codec) and the codec-free
317
- * server-function layer (reference detection + the late-bound RPC seam).
318
- * On the core entries so integrations consuming them eagerly (routers)
319
- * never import the server-functions entry — whose client half is the
320
- * transport + codec — from their eager graph. Declared through
321
- * server-functions/shared.d.ts, the declaration home published-types
322
- * layouts ship.
189
+ * Compiler-emitted primitive; not for hand-written code.
190
+ * @internal
323
191
  */
324
- export {
325
- clearFlashCookie,
326
- getServerFunctionMetadata,
327
- getServerFunctionRPC,
328
- hasFlashCookie,
329
- isServerFunction
330
- } from "./server-functions/shared.js";
331
- export type {
332
- ServerFunction,
333
- ServerFunctionMetadata,
334
- ServerFunctionRPC
335
- } from "./server-functions/shared.js";
336
- /** Hydration-walk primitive; not for hand-written code. @internal */
337
- export function runHydrationEvents(): void;
192
+ export declare function insert<T>(parent: MountableElement, accessor: (() => T) | T, marker?: Node | null, init?: JSX.Element, options?: {
193
+ /**
194
+ * Live accessor for the slot's logical host in the source tree (portals).
195
+ * Each top-level node the slot manages is tagged with a `_$host` getter
196
+ * backed by this accessor so delegated events retarget correctly.
197
+ */
198
+ host?: () => Node | null;
199
+ /** Defer the insert effect to the queue instead of running it inline. */
200
+ schedule?: boolean;
201
+ /**
202
+ * Label for the hole's render effects (the outer and, for a nested
203
+ * accessor, the inner unwrapping effect) — the compiler emits the parent
204
+ * tag as written under `sourceNames.bindings` (`div.children`). Dev and
205
+ * observe runtimes carry it on the node; production ignores it.
206
+ */
207
+ name?: string;
208
+ }): JSX.Element;
209
+ export declare function assign(node: Element, props: any, skipChildren?: Boolean, prevProps?: any, skipRef?: Boolean): void;
210
+ export declare function warmAsset(descriptor: AssetDescriptor): AssetEntry | undefined;
211
+ export declare function acquireAsset(descriptor: AssetDescriptor): () => void;
212
+ export declare function useHead(tag: HeadTag | HeadTag[] | (() => HeadTag | HeadTag[])): void;
213
+ /**
214
+ * Resumes a server-rendered tree on the client, attaching event listeners
215
+ * and reactive bindings without reconstructing the DOM. Returns a `dispose`
216
+ * function that tears down reactive scopes (DOM nodes are left in place).
217
+ *
218
+ * Use this when the page HTML was produced by `renderToString` or
219
+ * `renderToStream`. For client-only apps, use `render` instead.
220
+ *
221
+ * Pass `options.renderId` to hydrate one of multiple roots emitted by a
222
+ * server render that used the same id.
223
+ *
224
+ * When the server renders a full document but the client hydrates only the
225
+ * app subtree, the server must give that subtree its own id namespace: wrap
226
+ * the document shell in `<NoHydration>` and re-enter with `<Hydration>`
227
+ * around the app. Otherwise the app's hydration ids are allocated under the
228
+ * document component's owner tree and this walk can never claim them.
229
+ */
230
+ export declare function hydrate(fn: () => JSX.Element, node: MountableElement, options?: {
231
+ renderId?: string;
232
+ owner?: unknown;
233
+ onError?: ClientErrorHook;
234
+ }): () => void;
235
+ export declare function getNextElement(template?: () => Element): Element;
236
+ export declare function getNextMatch(start: Node, elementName: string): Element;
237
+ export declare function getNextMarker(start: Node): [Node, Array<Node>];
238
+ export declare function getFirstChild(node: any, expectedTag: any): any;
239
+ export declare function getNextSibling(node: any, expectedTag: any): any;
240
+ export declare function runHydrationEvents(): void;
241
+ export declare function getHydrationKey(): string | undefined;
242
+ export declare const RequestContext: unique symbol;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Flags
3
+ *
4
+ * - 1 - Stateful property - value derives from reactive state
5
+ * - 2 - Locked to property - value not specially treated
6
+ */
7
+ declare const DOMWithState: Record<string, Record<string, 1 | 2>>;
8
+ declare const ChildProperties: Set<string>;
9
+ declare const $$SLOT: unique symbol;
10
+ declare const $$HOST: unique symbol;
11
+ declare const DelegatedEvents: Set<string>;
12
+ declare const SVGElements: Set<string>;
13
+ declare const MathMLElements: Set<string>;
14
+ declare const Namespaces: Record<string, string>;
15
+ declare const VoidElements: Set<string>;
16
+ declare const RawTextElements: Set<string>;
17
+ declare const DOMElements: Set<string>;
18
+ declare const COMPOSED_BODY_FRAMING: ReadonlySet<string>;
19
+ declare function isHttpNavigationTarget(target: string): boolean;
20
+ export { DOMWithState, ChildProperties, DelegatedEvents, SVGElements, MathMLElements, VoidElements, RawTextElements, Namespaces, DOMElements, $$SLOT, $$HOST, COMPOSED_BODY_FRAMING, isHttpNavigationTarget };