@solidjs/web 2.0.0-experimental.8 → 2.0.0-rc.0
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 +22 -4
- package/dist/dev.cjs +1585 -225
- package/dist/dev.js +1510 -201
- package/dist/server.cjs +2642 -264
- package/dist/server.js +2542 -217
- package/dist/web.cjs +1523 -218
- package/dist/web.js +1448 -194
- package/frames/dist/client.cjs +1916 -0
- package/frames/dist/client.dev.cjs +1933 -0
- package/frames/dist/client.dev.js +1921 -0
- package/frames/dist/client.js +1904 -0
- package/frames/dist/server.cjs +3667 -0
- package/frames/dist/server.js +3654 -0
- package/frames/package.json +30 -0
- package/package.json +349 -37
- package/serialization/decode/package.json +20 -0
- package/serialization/dist/decode.cjs +110 -0
- package/serialization/dist/decode.js +104 -0
- package/serialization/dist/serialization.cjs +232 -0
- package/serialization/dist/serialization.js +215 -0
- package/serialization/package.json +20 -0
- package/serialization/types/index.d.ts +182 -0
- package/serialization/types/serializer-decode.d.ts +182 -0
- package/serialization/types-cjs/index.d.cts +182 -0
- package/serialization/types-cjs/package.json +3 -0
- package/serialization/types-cjs/serializer-decode.d.cts +182 -0
- package/server-functions/dist/client.cjs +646 -0
- package/server-functions/dist/client.js +617 -0
- package/server-functions/dist/rich-args.cjs +11 -0
- package/server-functions/dist/rich-args.js +9 -0
- package/server-functions/dist/server.cjs +1077 -0
- package/server-functions/dist/server.dev.cjs +1077 -0
- package/server-functions/dist/server.dev.js +1045 -0
- package/server-functions/dist/server.js +1045 -0
- package/server-functions/package.json +40 -0
- package/server-functions/rich-args/package.json +20 -0
- package/storage/package.json +8 -3
- package/storage/types/index.d.ts +26 -0
- package/storage/types-cjs/index.d.cts +28 -0
- package/storage/types-cjs/package.json +3 -0
- package/types/client.d.ts +290 -27
- package/types/cookies.d.ts +93 -0
- package/types/core.d.ts +6 -2
- package/types/frames/client.d.ts +36 -0
- package/types/frames/frame-client.d.ts +338 -0
- package/types/frames/frame-sink.d.ts +194 -0
- package/types/frames/frame-transport.d.ts +222 -0
- package/types/frames/serializer.d.ts +182 -0
- package/types/frames/server.d.ts +52 -0
- package/types/index.d.ts +209 -24
- package/types/jsx-properties.d.ts +93 -0
- package/types/jsx.d.ts +4150 -1
- package/types/response.d.ts +174 -0
- package/types/serializer-decode.d.ts +182 -0
- package/types/serializer.d.ts +182 -0
- package/types/server-functions/client.d.ts +201 -0
- package/types/server-functions/flash.d.ts +38 -0
- package/types/server-functions/rich-args.d.ts +10 -0
- package/types/server-functions/server.d.ts +588 -0
- package/types/server-functions/shared.d.ts +523 -0
- package/types/server-mock.d.ts +249 -12
- package/types/server.d.ts +424 -51
- package/types-cjs/client.d.cts +337 -0
- package/types-cjs/cookies.d.cts +93 -0
- package/types-cjs/core.d.cts +6 -0
- package/types-cjs/frames/client.d.cts +36 -0
- package/types-cjs/frames/frame-client.d.cts +338 -0
- package/types-cjs/frames/frame-sink.d.cts +194 -0
- package/types-cjs/frames/frame-transport.d.cts +222 -0
- package/types-cjs/frames/serializer.d.cts +182 -0
- package/types-cjs/frames/server.d.cts +52 -0
- package/types-cjs/index.d.cts +230 -0
- package/types-cjs/jsx-properties.d.cts +93 -0
- package/types-cjs/jsx.d.cts +4150 -0
- package/types-cjs/package.json +3 -0
- package/types-cjs/response.d.cts +174 -0
- package/types-cjs/serializer-decode.d.cts +182 -0
- package/types-cjs/serializer.d.cts +182 -0
- package/types-cjs/server-functions/client.d.cts +201 -0
- package/types-cjs/server-functions/flash.d.cts +38 -0
- package/types-cjs/server-functions/rich-args.d.cts +10 -0
- package/types-cjs/server-functions/server.d.cts +588 -0
- package/types-cjs/server-functions/shared.d.cts +523 -0
- package/types-cjs/server-mock.d.cts +277 -0
- package/types-cjs/server.d.cts +523 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { JSX } from "./jsx.cjs";
|
|
2
|
+
import type { RequestEventLocals } from "./server.cjs";
|
|
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
|
+
|
|
24
|
+
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
|
+
/**
|
|
198
|
+
* A head tag descriptor. Props values may be getters (reactive on the
|
|
199
|
+
* client); `children` is the text body. `key` overrides the built-in dedupe
|
|
200
|
+
* identity (`title` is a hard singleton that `key` cannot fork).
|
|
201
|
+
*
|
|
202
|
+
* Getters must be plain reads: they evaluate inside registry-owned
|
|
203
|
+
* computations here and at flush time on the server, so a getter that
|
|
204
|
+
* allocates a reactive owner (`createMemo`, a `children()` helper) consumes
|
|
205
|
+
* a hydration id slot on one side only and desyncs every id allocated after
|
|
206
|
+
* the `useHead` call. Create such helpers eagerly at component position and
|
|
207
|
+
* read them from the getter. See docs/head-management-rfc.md.
|
|
208
|
+
*/
|
|
209
|
+
export type HeadTag = {
|
|
210
|
+
tag: "title" | "meta" | "link" | "style" | "script" | "base";
|
|
211
|
+
props: Record<string, any>;
|
|
212
|
+
key?: string | (() => string);
|
|
213
|
+
};
|
|
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>;
|
|
229
|
+
export interface ExclusiveAssetDescriptor<T> {
|
|
230
|
+
policy: "exclusive";
|
|
231
|
+
key: string;
|
|
232
|
+
value: T;
|
|
233
|
+
get(): T;
|
|
234
|
+
set(value: T): void;
|
|
235
|
+
}
|
|
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
|
+
/**
|
|
247
|
+
* Registry entry returned by `warmAsset`. Stylesheet entries carry load
|
|
248
|
+
* tracking for the client reveal gate (docs/client-css-reveal-gating.md):
|
|
249
|
+
* `loadPromise` resolves on load OR error (never rejects) — an errored
|
|
250
|
+
* sheet releases the gate, parity with the server gate.
|
|
251
|
+
*/
|
|
252
|
+
export interface AssetEntry {
|
|
253
|
+
loadState?: "pending" | "loaded" | "errored";
|
|
254
|
+
loadPromise?: Promise<void>;
|
|
255
|
+
}
|
|
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
|
+
/**
|
|
272
|
+
* See the server entry's `ResponseStub` — the shape of the mutable response
|
|
273
|
+
* head integrations expose as `event.response` via module augmentation.
|
|
274
|
+
*/
|
|
275
|
+
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;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* See the server entry's `RequestEventLocals` — the augmentable type of
|
|
288
|
+
* `RequestEvent.locals`. Re-exported (not re-declared) so both entries
|
|
289
|
+
* share ONE interface identity and a single augmentation reaches every
|
|
290
|
+
* `locals`, whichever entry typed the event.
|
|
291
|
+
*/
|
|
292
|
+
export { RequestEventLocals } from "./server.cjs";
|
|
293
|
+
export interface RequestEvent {
|
|
294
|
+
request: Request;
|
|
295
|
+
locals: RequestEventLocals;
|
|
296
|
+
}
|
|
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.
|
|
302
|
+
* @internal
|
|
303
|
+
*/
|
|
304
|
+
export declare const RequestContext: unique symbol;
|
|
305
|
+
export function getRequestEvent(): RequestEvent | undefined;
|
|
306
|
+
/**
|
|
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.
|
|
311
|
+
*/
|
|
312
|
+
export { parseCookieHeader, serializeCookie } from "./cookies.cjs";
|
|
313
|
+
export type { CookieOptions } from "./cookies.cjs";
|
|
314
|
+
/**
|
|
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.
|
|
323
|
+
*/
|
|
324
|
+
export {
|
|
325
|
+
clearFlashCookie,
|
|
326
|
+
getServerFunctionMetadata,
|
|
327
|
+
getServerFunctionRPC,
|
|
328
|
+
hasFlashCookie,
|
|
329
|
+
isServerFunction
|
|
330
|
+
} from "./server-functions/shared.cjs";
|
|
331
|
+
export type {
|
|
332
|
+
ServerFunction,
|
|
333
|
+
ServerFunctionMetadata,
|
|
334
|
+
ServerFunctionRPC
|
|
335
|
+
} from "./server-functions/shared.cjs";
|
|
336
|
+
/** Hydration-walk primitive; not for hand-written code. @internal */
|
|
337
|
+
export function runHydrationEvents(): void;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Cookie wire format: the platform-gap primitives, and ALL of core's
|
|
2
|
+
// cookie surface — core owns the exchange (the request's headers in, the
|
|
3
|
+
// response stub's headers out) and the codec, nothing ambient. Blessed
|
|
4
|
+
// patterns:
|
|
5
|
+
//
|
|
6
|
+
// parseCookieHeader(event.request.headers.get("cookie"))
|
|
7
|
+
// event.response.headers.append("set-cookie", serializeCookie(name, value, options))
|
|
8
|
+
//
|
|
9
|
+
// Dependency-free and isomorphic (exported from both entries — real
|
|
10
|
+
// implementation, never a stub); integrity/confidentiality layers
|
|
11
|
+
// (sessions) belong to the caller, on top of these primitives.
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Attributes for a `Set-Cookie` header, mirroring RFC 6265. `path`
|
|
15
|
+
* defaults to `/`; nothing else is defaulted.
|
|
16
|
+
*/
|
|
17
|
+
export interface CookieOptions {
|
|
18
|
+
/** Cookie `Path` attribute. Defaults to `/`. */
|
|
19
|
+
path?: string;
|
|
20
|
+
/** Cookie `Domain` attribute. Emitted only when provided. */
|
|
21
|
+
domain?: string;
|
|
22
|
+
/** Cookie `Max-Age` attribute, in seconds (truncated to an integer). */
|
|
23
|
+
maxAge?: number;
|
|
24
|
+
/** Cookie `Expires` attribute. */
|
|
25
|
+
expires?: Date;
|
|
26
|
+
/** Emit the `HttpOnly` attribute. */
|
|
27
|
+
httpOnly?: boolean;
|
|
28
|
+
/** Emit the `Secure` attribute. */
|
|
29
|
+
secure?: boolean;
|
|
30
|
+
/** Cookie `SameSite` attribute, any case. */
|
|
31
|
+
sameSite?: "lax" | "strict" | "none" | "Lax" | "Strict" | "None";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Parses a `Cookie` request header into a name → value map. Names and
|
|
36
|
+
* values are `decodeURIComponent`-decoded (falling back to the raw text
|
|
37
|
+
* when decoding throws); a quoted value keeps its content. `null`/empty
|
|
38
|
+
* input parses to an empty map.
|
|
39
|
+
*
|
|
40
|
+
* The read half of the platform gap — the blessed request-cookie read is
|
|
41
|
+
* `parseCookieHeader(event.request.headers.get("cookie"))`.
|
|
42
|
+
*/
|
|
43
|
+
export function parseCookieHeader(header: string | null | undefined): Record<string, string>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Serializes a cookie to a `Set-Cookie` header value. The name and value
|
|
47
|
+
* are `encodeURIComponent`-encoded (the parser decodes symmetrically);
|
|
48
|
+
* `path` defaults to `/` and every other attribute is emitted exactly
|
|
49
|
+
* when the caller asked for it.
|
|
50
|
+
*
|
|
51
|
+
* The write half of the platform gap — the blessed response-cookie write
|
|
52
|
+
* is `event.response.headers.append("set-cookie", serializeCookie(name,
|
|
53
|
+
* value, options))`, which every head materialization path carries to the
|
|
54
|
+
* wire entry-by-entry.
|
|
55
|
+
*/
|
|
56
|
+
export function serializeCookie(name: string, value: string, options?: CookieOptions): string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Name of the cookie carrying the outcome of a server function call made
|
|
60
|
+
* without the client runtime (`"flash"`). A no-JS form post has no way to
|
|
61
|
+
* receive a value — the browser follows the redirect and renders the next
|
|
62
|
+
* page — so the handler stashes the outcome here for the render after it
|
|
63
|
+
* to pick up, which is how a form submitted without JavaScript still shows
|
|
64
|
+
* its result.
|
|
65
|
+
*
|
|
66
|
+
* The name, detection and clearing are cookie utilities and isomorphic
|
|
67
|
+
* (integrations read the cookie from code that also ships to the browser);
|
|
68
|
+
* the codec that fills and decodes it is server-only and lives behind the
|
|
69
|
+
* server-functions server entry.
|
|
70
|
+
*/
|
|
71
|
+
export const FLASH_COOKIE: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Whether a Cookie header carries a flash cookie, readable or not. Cheap
|
|
75
|
+
* enough to call on every render so the clear can be queued before the
|
|
76
|
+
* response headers flush.
|
|
77
|
+
*/
|
|
78
|
+
export function hasFlashCookie(cookieHeader: string | null): boolean;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The `Set-Cookie` value clearing the flash cookie. The outcome is
|
|
82
|
+
* one-shot: append this as soon as the cookie is detected, whether or not
|
|
83
|
+
* it decodes, so a stale outcome cannot resurface on a later request.
|
|
84
|
+
*/
|
|
85
|
+
export function clearFlashCookie(): string;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The raw encoded flash payload out of a Cookie header, if present — the
|
|
89
|
+
* codec's own accessor.
|
|
90
|
+
*
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
export function matchFlashCookie(cookieHeader: string | null): string | undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { getOwner, runWithOwner, createComponent, createRoot as root, sharedConfig, untrack, merge as mergeProps, flatten, ssrHandleError, ssrScope, NoHydration, Hydration, runInServerComponentScope, creationStamp, inServerComponentScope } from "solid-js";
|
|
2
|
+
export declare const effect: (fn: any, effectFn: any, options?: any) => void;
|
|
3
|
+
export declare const memo: (fn: any) => import("solid-js").SourceAccessor<any>;
|
|
4
|
+
export declare const runWithHydrationScope: (id: any, fn: any) => unknown;
|
|
5
|
+
export declare const ssrAsyncValue: (value: any) => import("solid-js").SourceAccessor<any>;
|
|
6
|
+
export declare const waitAsset: (promise: any) => void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export { createFrame, createFrameHost, createFrameElement, FRAME_APPLIED_EVENT } from "./frame-client.cjs";
|
|
2
|
+
export { FRAME_STREAM_HEADER, applyFrameResponse, isFrameStreamResponse, createServerComponentHandler } from "./frame-transport.cjs";
|
|
3
|
+
export type { Slot } from "./server.cjs";
|
|
4
|
+
/**
|
|
5
|
+
* Client-condition twin of the server face's `asyncArg` (DR-2 value tier):
|
|
6
|
+
* the identity that types an async value crossing the slot border as its
|
|
7
|
+
* settled value. Server component modules are authored in universal code and
|
|
8
|
+
* may resolve under the browser condition at typecheck/bundle time — the
|
|
9
|
+
* call never runs here (the `"use server"` body executes server-side), but
|
|
10
|
+
* the symbol must exist.
|
|
11
|
+
*/
|
|
12
|
+
export declare function asyncArg<T>(value: PromiseLike<T> | AsyncIterable<T>): T;
|
|
13
|
+
/**
|
|
14
|
+
* The app-wide shared frame host (created lazily): one chunk router with
|
|
15
|
+
* per-response codec data tables.
|
|
16
|
+
* @experimental
|
|
17
|
+
*/
|
|
18
|
+
export declare function getFrameHost(): any;
|
|
19
|
+
/**
|
|
20
|
+
* Installs the server-component transport policy on the server-function
|
|
21
|
+
* client — the identity split (DR-1): CONTENT is keyed by the call's
|
|
22
|
+
* intrinsic (function, arguments) address — per-args, exactly like the
|
|
23
|
+
* query cache, so a cached resolution always names the content it was
|
|
24
|
+
* cached for — while the MOUNT belongs to the call site. Every call of a
|
|
25
|
+
* function resolves a binding wrapping the same per-function component
|
|
26
|
+
* (the document placeholder), so `dynamic` keeps its instance across both
|
|
27
|
+
* refetches AND argument changes; the instance follows delivered addresses
|
|
28
|
+
* by re-binding its frame's pull, and a preload for unshown args only ever
|
|
29
|
+
* warms that address's resident store.
|
|
30
|
+
*
|
|
31
|
+
* Call once in the client entry (an explicit call — the package is
|
|
32
|
+
* `sideEffects: false`, so a bare import would be tree-shaken away);
|
|
33
|
+
* call again to rebind to a custom host.
|
|
34
|
+
* @experimental
|
|
35
|
+
*/
|
|
36
|
+
export declare function installServerComponents(host?: any): void;
|