@solidjs/web 2.0.0-beta.30 → 2.0.0-beta.31
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 +52 -39
- package/dist/dev.js +53 -40
- package/dist/server.cjs +99 -12
- package/dist/server.js +99 -12
- package/dist/web.cjs +49 -36
- package/dist/web.js +50 -37
- package/frames/dist/client.cjs +208 -260
- package/frames/dist/client.dev.cjs +208 -260
- package/frames/dist/client.dev.js +209 -261
- package/frames/dist/client.js +209 -261
- package/frames/dist/server.cjs +116 -22
- package/frames/dist/server.js +116 -22
- package/package.json +4 -5
- package/types/client.d.ts +7 -5
- package/types/frames/client.d.ts +9 -7
- package/types/frames/frame-client.d.ts +12 -0
- package/types/frames/frame-sink.d.ts +6 -3
- package/types/frames/frame-transport.d.ts +50 -56
- package/types/jsx.d.ts +3 -3
- package/types/server.d.ts +8 -6
- package/types-cjs/client.d.cts +7 -5
- package/types-cjs/frames/client.d.cts +9 -7
- package/types-cjs/frames/frame-client.d.cts +12 -0
- package/types-cjs/frames/frame-sink.d.cts +6 -3
- package/types-cjs/frames/frame-transport.d.cts +50 -56
- package/types-cjs/jsx.d.cts +3 -3
- package/types-cjs/server.d.cts +8 -6
|
@@ -36,12 +36,6 @@ export interface ApplyFrameResponseOptions {
|
|
|
36
36
|
* response.
|
|
37
37
|
*/
|
|
38
38
|
version?: number | ((frameId: string) => number);
|
|
39
|
-
/**
|
|
40
|
-
* Remap any frame id other than the response's own root onto a local one
|
|
41
|
-
* — how a consumer resolves the addresses a single-flight response uses
|
|
42
|
-
* for the regions it refreshed.
|
|
43
|
-
*/
|
|
44
|
-
route?(id: string): string;
|
|
45
39
|
/**
|
|
46
40
|
* Receives the payload text of each `outcome` chunk — the response-scoped
|
|
47
41
|
* single-flight envelope, the caller's result rather than anything the
|
|
@@ -80,29 +74,22 @@ export const SERVER_COMPONENT_SOURCE: unique symbol;
|
|
|
80
74
|
export const SERVER_COMPONENT_ADDRESS: unique symbol;
|
|
81
75
|
|
|
82
76
|
/**
|
|
83
|
-
* The
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* honor it without importing this module.
|
|
77
|
+
* The binding brand on values the transport resolves: `{ component, address }`
|
|
78
|
+
* — the identity split (DR-1). `component` is the mount identity, one per
|
|
79
|
+
* server function; `address` names the call's content store. An equals-gated
|
|
80
|
+
* reader compares `component` across resolutions: same function means "same
|
|
81
|
+
* instance, new binding" — keep the mounted instance and deliver the new
|
|
82
|
+
* address into it; a different function swaps normally. `Symbol.for`, so
|
|
83
|
+
* frameworks can honor it without importing this module.
|
|
90
84
|
*/
|
|
91
|
-
export const
|
|
85
|
+
export const COMPONENT_BINDING: unique symbol;
|
|
92
86
|
|
|
93
|
-
/** The value under `
|
|
94
|
-
export interface
|
|
95
|
-
/** The
|
|
96
|
-
|
|
97
|
-
/** The
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Offer `prev` (the reader's current value) to this component. Returns
|
|
101
|
-
* true when the reader should KEEP prev — the mounted frame was rebound
|
|
102
|
-
* to this component's id (or already showed it); false means swap
|
|
103
|
-
* normally (different function, unbranded prev, or nothing mounted).
|
|
104
|
-
*/
|
|
105
|
-
take(prev: unknown): boolean;
|
|
87
|
+
/** The value under `COMPONENT_BINDING` on a transport-resolved binding. */
|
|
88
|
+
export interface ComponentBinding<C = unknown> {
|
|
89
|
+
/** The per-function mount component (the equals-gate identity). */
|
|
90
|
+
component: C;
|
|
91
|
+
/** The call's intrinsic (function, arguments) address — its store's key. */
|
|
92
|
+
address: string;
|
|
106
93
|
}
|
|
107
94
|
|
|
108
95
|
/**
|
|
@@ -114,6 +101,16 @@ export interface ComponentHandoff {
|
|
|
114
101
|
*/
|
|
115
102
|
export const ServerComponentPlugin: unknown;
|
|
116
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Installs the hydration-serializer registry prefix: given the emitted
|
|
106
|
+
* script's serializer context, returns the expression the next serialized
|
|
107
|
+
* reference reads the `_$SC` registry through (the self-bootstrapping form
|
|
108
|
+
* on a script's first reference, a bare read after). Loaded document-SSR
|
|
109
|
+
* modules install this (see frame-sink); client bundles never carry the
|
|
110
|
+
* bootstrap text.
|
|
111
|
+
*/
|
|
112
|
+
export function setServerComponentBootstrap(resolve: (ctx: unknown) => string): void;
|
|
113
|
+
|
|
117
114
|
/**
|
|
118
115
|
* The codec options for a single-flight envelope: `codec` plus
|
|
119
116
|
* `ServerComponentPlugin` (deduped by tag). Injected by the protocol on both
|
|
@@ -125,24 +122,20 @@ export function flightCodec(codec?: JSONCodecOptions): JSONCodecOptions;
|
|
|
125
122
|
export interface ServerComponentHandlerOptions<C = unknown> {
|
|
126
123
|
host: FrameHost;
|
|
127
124
|
/**
|
|
128
|
-
* Builds the framework's
|
|
129
|
-
* per
|
|
130
|
-
*
|
|
125
|
+
* Builds the framework's mount component for a server FUNCTION. Invoked
|
|
126
|
+
* once per function and cached — this is the equals-gate identity every
|
|
127
|
+
* call of the function resolves through. The component is CALLED (by the
|
|
128
|
+
* binding wrapper or a gated reader), receiving its current address as a
|
|
129
|
+
* second argument (`() => string`); it should (re-)bind its frame's pull
|
|
130
|
+
* to that address's store. Multi-mount fans out per site.
|
|
131
131
|
*/
|
|
132
|
-
component(
|
|
132
|
+
component(fnId: string): C;
|
|
133
133
|
/**
|
|
134
|
-
* A new response is about to stream into
|
|
134
|
+
* A new response is about to stream into an address: rotate
|
|
135
135
|
* response-scoped state (codec data tables) here. `version` is the
|
|
136
136
|
* client-owned stream counter the chunks will be stamped with.
|
|
137
137
|
*/
|
|
138
|
-
onStream?(
|
|
139
|
-
/**
|
|
140
|
-
* Document-SSR adoption: given a boundary id the page already carries
|
|
141
|
-
* (server-rendered between `frame:<id>` markers), return the component
|
|
142
|
-
* that adopts that range — or `undefined` to stream normally. Consulted
|
|
143
|
-
* once per boundary, before any fetch.
|
|
144
|
-
*/
|
|
145
|
-
documentComponent?(frameId: string): C | undefined;
|
|
138
|
+
onStream?(address: string, version: number, response: Response): void;
|
|
146
139
|
/**
|
|
147
140
|
* Answer a call SYNCHRONOUSLY before any request is made (t = 0 local
|
|
148
141
|
* answers — e.g. a boundary the document already carries). Returning a
|
|
@@ -167,30 +160,31 @@ export interface ServerComponentHandlerOptions<C = unknown> {
|
|
|
167
160
|
/**
|
|
168
161
|
* The client mirror of `frameTransformResult`, shaped for the server-function
|
|
169
162
|
* client's `responseHandler` seam: frame-stream responses resolve the call
|
|
170
|
-
* with a **
|
|
171
|
-
* (Solid's `dynamic`) never remounts across
|
|
172
|
-
*
|
|
163
|
+
* with a **binding** — a callable wrapper branded `COMPONENT_BINDING` — so
|
|
164
|
+
* an equals-gated consumer (Solid's `dynamic`) never remounts across
|
|
165
|
+
* refetches or argument changes; the response streams into the address's
|
|
166
|
+
* resident store as the only observable effect.
|
|
173
167
|
*
|
|
174
|
-
*
|
|
175
|
-
* intrinsic (function, arguments)
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
168
|
+
* The identity split (DR-1): stores are keyed per-ADDRESS — the call's
|
|
169
|
+
* intrinsic (function, arguments) name, one-to-one with a query cache's
|
|
170
|
+
* per-args entries — while mounts are per-SITE, rendering the per-function
|
|
171
|
+
* component and following delivered addresses. An address nothing is bound
|
|
172
|
+
* to warms its store (preload isolation is the default, not a rule).
|
|
179
173
|
*/
|
|
180
174
|
export function createServerComponentHandler<C>(options: ServerComponentHandlerOptions<C>): {
|
|
181
|
-
intercept?(info: { id: string; meta: unknown; args: unknown[] }):
|
|
175
|
+
intercept?(info: { id: string; meta: unknown; args: unknown[] }): unknown;
|
|
182
176
|
handle(
|
|
183
177
|
response: Response,
|
|
184
178
|
ctx: { id: string; meta: unknown; args: unknown[]; context: unknown }
|
|
185
|
-
):
|
|
179
|
+
): unknown;
|
|
186
180
|
/**
|
|
187
181
|
* Declares that the document is showing a call: hydration-data references
|
|
188
182
|
* carry their call's address (`_$SC.r(id, address)`) but never travel
|
|
189
|
-
* through the transport, so the integration forwards those records here
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
183
|
+
* through the transport, so the integration forwards those records here.
|
|
184
|
+
* Mints the call's binding (a post-load refetch then resolves a value
|
|
185
|
+
* whose component matches what the document mounted) and brands the
|
|
186
|
+
* per-function component so cache-seeded readers deliver instead of
|
|
187
|
+
* remounting when their site later switches calls.
|
|
194
188
|
*/
|
|
195
|
-
showing(address: string, functionId: string
|
|
189
|
+
showing(address: string, functionId: string): void;
|
|
196
190
|
};
|
package/types/jsx.d.ts
CHANGED
|
@@ -240,13 +240,13 @@ export namespace JSX {
|
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
type RefCallback<T> = (el: T) => void;
|
|
243
|
-
type Ref<T> = T | RefCallback<T> | Ref<T>[];
|
|
243
|
+
type Ref<T> = T | RefCallback<T> | undefined | Ref<T>[];
|
|
244
244
|
|
|
245
245
|
interface IntrinsicAttributes {
|
|
246
|
-
ref?: Ref<unknown
|
|
246
|
+
ref?: Ref<unknown>;
|
|
247
247
|
}
|
|
248
248
|
interface CustomAttributes<T> {
|
|
249
|
-
ref?: Ref<T
|
|
249
|
+
ref?: Ref<T>;
|
|
250
250
|
children?: Element | undefined;
|
|
251
251
|
$ServerOnly?: boolean | undefined;
|
|
252
252
|
}
|
package/types/server.d.ts
CHANGED
|
@@ -176,13 +176,15 @@ export type HeadTag = {
|
|
|
176
176
|
};
|
|
177
177
|
/**
|
|
178
178
|
* Registers head tags with the render's head registry. An array is a group —
|
|
179
|
-
* one replacement set; a single tag is a group of one
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
179
|
+
* one replacement set; a single tag is a group of one; a function is a
|
|
180
|
+
* reactive group whose membership resolves at the owning flush boundary
|
|
181
|
+
* (resource tags inside it emit at that flush rather than eagerly).
|
|
182
|
+
* Replaceable tags (title/meta/canonical/…) resolve by last-committed group
|
|
183
|
+
* and stream as patches with their suspense boundary's reveal; resource tags
|
|
184
|
+
* (preload and friends, stylesheets, `script[src]`) emit eagerly and dedupe
|
|
185
|
+
* by identity. See docs/head-management-rfc.md.
|
|
184
186
|
*/
|
|
185
|
-
export function useHead(tag: HeadTag | HeadTag[]): void;
|
|
187
|
+
export function useHead(tag: HeadTag | HeadTag[] | (() => HeadTag | HeadTag[])): void;
|
|
186
188
|
export function getHydrationKey(): string | undefined;
|
|
187
189
|
export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void): void;
|
|
188
190
|
export function memo<T>(fn: () => T, equal: boolean): () => T;
|
package/types-cjs/client.d.cts
CHANGED
|
@@ -143,12 +143,14 @@ export type HeadTag = {
|
|
|
143
143
|
};
|
|
144
144
|
/**
|
|
145
145
|
* Registers head tags with the ambient head registry under the current
|
|
146
|
-
* owner. An array is a group — one replacement set
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
146
|
+
* owner. An array is a group — one replacement set; a function is a
|
|
147
|
+
* reactive group whose membership is tracked and re-read on change.
|
|
148
|
+
* Resolution is last-committed group per identity (reactive updates keep
|
|
149
|
+
* the registration's original commit position); disposal restores the
|
|
150
|
+
* previous winner. During hydration the server-flushed head state stays
|
|
151
|
+
* authoritative until hydration completes. See docs/head-management-rfc.md.
|
|
150
152
|
*/
|
|
151
|
-
export function useHead(tag: HeadTag | HeadTag[]): void;
|
|
153
|
+
export function useHead(tag: HeadTag | HeadTag[] | (() => HeadTag | HeadTag[])): void;
|
|
152
154
|
export type AssetDescriptor =
|
|
153
155
|
| { type: "style"; href: string; attrs?: Record<string, string> }
|
|
154
156
|
| { type: "inline-style"; id: string; content?: string; attrs?: Record<string, string> }
|
|
@@ -5,13 +5,15 @@ export type { Slot } from "./server.cjs";
|
|
|
5
5
|
export declare function getFrameHost(): any;
|
|
6
6
|
/**
|
|
7
7
|
* Installs the server-component transport policy on the server-function
|
|
8
|
-
* client
|
|
9
|
-
* address — per-args, exactly like the
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
8
|
+
* client — the identity split (DR-1): CONTENT is keyed by the call's
|
|
9
|
+
* intrinsic (function, arguments) address — per-args, exactly like the
|
|
10
|
+
* query cache, so a cached resolution always names the content it was
|
|
11
|
+
* cached for — while the MOUNT belongs to the call site. Every call of a
|
|
12
|
+
* function resolves a binding wrapping the same per-function component
|
|
13
|
+
* (the document placeholder), so `dynamic` keeps its instance across both
|
|
14
|
+
* refetches AND argument changes; the instance follows delivered addresses
|
|
15
|
+
* by re-binding its frame's pull, and a preload for unshown args only ever
|
|
16
|
+
* warms that address's resident store.
|
|
15
17
|
*
|
|
16
18
|
* Call once in the client entry (an explicit call — the package is
|
|
17
19
|
* `sideEffects: false`, so a bare import would be tree-shaken away);
|
|
@@ -239,6 +239,18 @@ export interface FrameOptions {
|
|
|
239
239
|
* for the framework-agnostic imperative swap (no reactive reveal).
|
|
240
240
|
*/
|
|
241
241
|
reveal?(seam: { before: Node; fallback: Node[]; content: () => Node | DocumentFragment }): void;
|
|
242
|
+
/**
|
|
243
|
+
* Document-face record-race guard (adopt path only — solidjs/solid#2968).
|
|
244
|
+
* Nothing on the wire formally orders an occurrence's args-record data
|
|
245
|
+
* script before the event that triggers adoption, so a recordless
|
|
246
|
+
* occurrence is ambiguous while this returns true: the frame defers its
|
|
247
|
+
* mount one macrotask (all currently parsed scripts run first), calls
|
|
248
|
+
* `drainRecords`, and classifies with whatever is then resolvable. Return
|
|
249
|
+
* false once the document can run no further data scripts.
|
|
250
|
+
*/
|
|
251
|
+
recordsPending?(): boolean;
|
|
252
|
+
/** Re-absorb the document's arrived-by-now records (idempotent per key). */
|
|
253
|
+
drainRecords?(): void;
|
|
242
254
|
}
|
|
243
255
|
|
|
244
256
|
/**
|
|
@@ -161,8 +161,11 @@ export {
|
|
|
161
161
|
} from "./frame-transport.cjs";
|
|
162
162
|
|
|
163
163
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
164
|
+
* Statement form of the `self._$SC` placeholder-registry bootstrap
|
|
165
|
+
* (idempotent — first definition wins). No longer required in the document
|
|
166
|
+
* shell: each hydration script's first serialized server-component reference
|
|
167
|
+
* self-bootstraps the registry. Kept for integrations still installing it
|
|
168
|
+
* document-wide; the client upgrades the registry via
|
|
169
|
+
* `installServerComponents()`.
|
|
167
170
|
*/
|
|
168
171
|
export const SERVER_COMPONENT_BOOTSTRAP: string;
|
|
@@ -36,12 +36,6 @@ export interface ApplyFrameResponseOptions {
|
|
|
36
36
|
* response.
|
|
37
37
|
*/
|
|
38
38
|
version?: number | ((frameId: string) => number);
|
|
39
|
-
/**
|
|
40
|
-
* Remap any frame id other than the response's own root onto a local one
|
|
41
|
-
* — how a consumer resolves the addresses a single-flight response uses
|
|
42
|
-
* for the regions it refreshed.
|
|
43
|
-
*/
|
|
44
|
-
route?(id: string): string;
|
|
45
39
|
/**
|
|
46
40
|
* Receives the payload text of each `outcome` chunk — the response-scoped
|
|
47
41
|
* single-flight envelope, the caller's result rather than anything the
|
|
@@ -80,29 +74,22 @@ export const SERVER_COMPONENT_SOURCE: unique symbol;
|
|
|
80
74
|
export const SERVER_COMPONENT_ADDRESS: unique symbol;
|
|
81
75
|
|
|
82
76
|
/**
|
|
83
|
-
* The
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* honor it without importing this module.
|
|
77
|
+
* The binding brand on values the transport resolves: `{ component, address }`
|
|
78
|
+
* — the identity split (DR-1). `component` is the mount identity, one per
|
|
79
|
+
* server function; `address` names the call's content store. An equals-gated
|
|
80
|
+
* reader compares `component` across resolutions: same function means "same
|
|
81
|
+
* instance, new binding" — keep the mounted instance and deliver the new
|
|
82
|
+
* address into it; a different function swaps normally. `Symbol.for`, so
|
|
83
|
+
* frameworks can honor it without importing this module.
|
|
90
84
|
*/
|
|
91
|
-
export const
|
|
85
|
+
export const COMPONENT_BINDING: unique symbol;
|
|
92
86
|
|
|
93
|
-
/** The value under `
|
|
94
|
-
export interface
|
|
95
|
-
/** The
|
|
96
|
-
|
|
97
|
-
/** The
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Offer `prev` (the reader's current value) to this component. Returns
|
|
101
|
-
* true when the reader should KEEP prev — the mounted frame was rebound
|
|
102
|
-
* to this component's id (or already showed it); false means swap
|
|
103
|
-
* normally (different function, unbranded prev, or nothing mounted).
|
|
104
|
-
*/
|
|
105
|
-
take(prev: unknown): boolean;
|
|
87
|
+
/** The value under `COMPONENT_BINDING` on a transport-resolved binding. */
|
|
88
|
+
export interface ComponentBinding<C = unknown> {
|
|
89
|
+
/** The per-function mount component (the equals-gate identity). */
|
|
90
|
+
component: C;
|
|
91
|
+
/** The call's intrinsic (function, arguments) address — its store's key. */
|
|
92
|
+
address: string;
|
|
106
93
|
}
|
|
107
94
|
|
|
108
95
|
/**
|
|
@@ -114,6 +101,16 @@ export interface ComponentHandoff {
|
|
|
114
101
|
*/
|
|
115
102
|
export const ServerComponentPlugin: unknown;
|
|
116
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Installs the hydration-serializer registry prefix: given the emitted
|
|
106
|
+
* script's serializer context, returns the expression the next serialized
|
|
107
|
+
* reference reads the `_$SC` registry through (the self-bootstrapping form
|
|
108
|
+
* on a script's first reference, a bare read after). Loaded document-SSR
|
|
109
|
+
* modules install this (see frame-sink); client bundles never carry the
|
|
110
|
+
* bootstrap text.
|
|
111
|
+
*/
|
|
112
|
+
export function setServerComponentBootstrap(resolve: (ctx: unknown) => string): void;
|
|
113
|
+
|
|
117
114
|
/**
|
|
118
115
|
* The codec options for a single-flight envelope: `codec` plus
|
|
119
116
|
* `ServerComponentPlugin` (deduped by tag). Injected by the protocol on both
|
|
@@ -125,24 +122,20 @@ export function flightCodec(codec?: JSONCodecOptions): JSONCodecOptions;
|
|
|
125
122
|
export interface ServerComponentHandlerOptions<C = unknown> {
|
|
126
123
|
host: FrameHost;
|
|
127
124
|
/**
|
|
128
|
-
* Builds the framework's
|
|
129
|
-
* per
|
|
130
|
-
*
|
|
125
|
+
* Builds the framework's mount component for a server FUNCTION. Invoked
|
|
126
|
+
* once per function and cached — this is the equals-gate identity every
|
|
127
|
+
* call of the function resolves through. The component is CALLED (by the
|
|
128
|
+
* binding wrapper or a gated reader), receiving its current address as a
|
|
129
|
+
* second argument (`() => string`); it should (re-)bind its frame's pull
|
|
130
|
+
* to that address's store. Multi-mount fans out per site.
|
|
131
131
|
*/
|
|
132
|
-
component(
|
|
132
|
+
component(fnId: string): C;
|
|
133
133
|
/**
|
|
134
|
-
* A new response is about to stream into
|
|
134
|
+
* A new response is about to stream into an address: rotate
|
|
135
135
|
* response-scoped state (codec data tables) here. `version` is the
|
|
136
136
|
* client-owned stream counter the chunks will be stamped with.
|
|
137
137
|
*/
|
|
138
|
-
onStream?(
|
|
139
|
-
/**
|
|
140
|
-
* Document-SSR adoption: given a boundary id the page already carries
|
|
141
|
-
* (server-rendered between `frame:<id>` markers), return the component
|
|
142
|
-
* that adopts that range — or `undefined` to stream normally. Consulted
|
|
143
|
-
* once per boundary, before any fetch.
|
|
144
|
-
*/
|
|
145
|
-
documentComponent?(frameId: string): C | undefined;
|
|
138
|
+
onStream?(address: string, version: number, response: Response): void;
|
|
146
139
|
/**
|
|
147
140
|
* Answer a call SYNCHRONOUSLY before any request is made (t = 0 local
|
|
148
141
|
* answers — e.g. a boundary the document already carries). Returning a
|
|
@@ -167,30 +160,31 @@ export interface ServerComponentHandlerOptions<C = unknown> {
|
|
|
167
160
|
/**
|
|
168
161
|
* The client mirror of `frameTransformResult`, shaped for the server-function
|
|
169
162
|
* client's `responseHandler` seam: frame-stream responses resolve the call
|
|
170
|
-
* with a **
|
|
171
|
-
* (Solid's `dynamic`) never remounts across
|
|
172
|
-
*
|
|
163
|
+
* with a **binding** — a callable wrapper branded `COMPONENT_BINDING` — so
|
|
164
|
+
* an equals-gated consumer (Solid's `dynamic`) never remounts across
|
|
165
|
+
* refetches or argument changes; the response streams into the address's
|
|
166
|
+
* resident store as the only observable effect.
|
|
173
167
|
*
|
|
174
|
-
*
|
|
175
|
-
* intrinsic (function, arguments)
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
168
|
+
* The identity split (DR-1): stores are keyed per-ADDRESS — the call's
|
|
169
|
+
* intrinsic (function, arguments) name, one-to-one with a query cache's
|
|
170
|
+
* per-args entries — while mounts are per-SITE, rendering the per-function
|
|
171
|
+
* component and following delivered addresses. An address nothing is bound
|
|
172
|
+
* to warms its store (preload isolation is the default, not a rule).
|
|
179
173
|
*/
|
|
180
174
|
export function createServerComponentHandler<C>(options: ServerComponentHandlerOptions<C>): {
|
|
181
|
-
intercept?(info: { id: string; meta: unknown; args: unknown[] }):
|
|
175
|
+
intercept?(info: { id: string; meta: unknown; args: unknown[] }): unknown;
|
|
182
176
|
handle(
|
|
183
177
|
response: Response,
|
|
184
178
|
ctx: { id: string; meta: unknown; args: unknown[]; context: unknown }
|
|
185
|
-
):
|
|
179
|
+
): unknown;
|
|
186
180
|
/**
|
|
187
181
|
* Declares that the document is showing a call: hydration-data references
|
|
188
182
|
* carry their call's address (`_$SC.r(id, address)`) but never travel
|
|
189
|
-
* through the transport, so the integration forwards those records here
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
183
|
+
* through the transport, so the integration forwards those records here.
|
|
184
|
+
* Mints the call's binding (a post-load refetch then resolves a value
|
|
185
|
+
* whose component matches what the document mounted) and brands the
|
|
186
|
+
* per-function component so cache-seeded readers deliver instead of
|
|
187
|
+
* remounting when their site later switches calls.
|
|
194
188
|
*/
|
|
195
|
-
showing(address: string, functionId: string
|
|
189
|
+
showing(address: string, functionId: string): void;
|
|
196
190
|
};
|
package/types-cjs/jsx.d.cts
CHANGED
|
@@ -240,13 +240,13 @@ export namespace JSX {
|
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
type RefCallback<T> = (el: T) => void;
|
|
243
|
-
type Ref<T> = T | RefCallback<T> | Ref<T>[];
|
|
243
|
+
type Ref<T> = T | RefCallback<T> | undefined | Ref<T>[];
|
|
244
244
|
|
|
245
245
|
interface IntrinsicAttributes {
|
|
246
|
-
ref?: Ref<unknown
|
|
246
|
+
ref?: Ref<unknown>;
|
|
247
247
|
}
|
|
248
248
|
interface CustomAttributes<T> {
|
|
249
|
-
ref?: Ref<T
|
|
249
|
+
ref?: Ref<T>;
|
|
250
250
|
children?: Element | undefined;
|
|
251
251
|
$ServerOnly?: boolean | undefined;
|
|
252
252
|
}
|
package/types-cjs/server.d.cts
CHANGED
|
@@ -176,13 +176,15 @@ export type HeadTag = {
|
|
|
176
176
|
};
|
|
177
177
|
/**
|
|
178
178
|
* Registers head tags with the render's head registry. An array is a group —
|
|
179
|
-
* one replacement set; a single tag is a group of one
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
179
|
+
* one replacement set; a single tag is a group of one; a function is a
|
|
180
|
+
* reactive group whose membership resolves at the owning flush boundary
|
|
181
|
+
* (resource tags inside it emit at that flush rather than eagerly).
|
|
182
|
+
* Replaceable tags (title/meta/canonical/…) resolve by last-committed group
|
|
183
|
+
* and stream as patches with their suspense boundary's reveal; resource tags
|
|
184
|
+
* (preload and friends, stylesheets, `script[src]`) emit eagerly and dedupe
|
|
185
|
+
* by identity. See docs/head-management-rfc.md.
|
|
184
186
|
*/
|
|
185
|
-
export function useHead(tag: HeadTag | HeadTag[]): void;
|
|
187
|
+
export function useHead(tag: HeadTag | HeadTag[] | (() => HeadTag | HeadTag[])): void;
|
|
186
188
|
export function getHydrationKey(): string | undefined;
|
|
187
189
|
export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void): void;
|
|
188
190
|
export function memo<T>(fn: () => T, equal: boolean): () => T;
|