@solidjs/web 2.0.0-rc.7 → 2.0.0-rc.9
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/server.dev.js +638 -124
- package/dist/server.js +445 -94
- package/dist/{server.dev.cjs → server.observe.js} +602 -416
- package/dist/web.dev.js +229 -49
- package/dist/web.js +194 -46
- package/dist/{web.cjs → web.observe.js} +290 -275
- package/frames/dist/client.dev.js +103 -4
- package/frames/dist/client.js +5 -2
- package/frames/dist/{client.dev.cjs → client.observe.js} +139 -79
- package/frames/dist/server.dev.js +540 -79
- package/frames/dist/server.js +371 -52
- package/frames/dist/{server.cjs → server.observe.js} +544 -140
- package/frames/package.json +15 -21
- package/package.json +145 -294
- package/serialization/decode/package.json +3 -9
- package/serialization/package.json +3 -9
- package/serialization/types/serializer-decode.d.ts +49 -2
- package/server-functions/dist/{client.cjs → client.dev.js} +140 -107
- package/server-functions/dist/client.js +74 -69
- package/server-functions/dist/client.observe.js +1102 -0
- package/server-functions/dist/server.dev.js +430 -41
- package/server-functions/dist/server.js +367 -40
- package/server-functions/dist/{server.cjs → server.observe.js} +430 -85
- package/server-functions/package.json +15 -21
- package/server-functions/rich-args/package.json +3 -9
- package/storage/package.json +3 -9
- package/types/client.d.ts +39 -1
- package/types/diagnostics.d.ts +24 -0
- package/types/frames/frame-transport.d.ts +1 -1
- package/types/frames/serializer-decode.d.ts +49 -2
- package/types/index.d.ts +25 -15
- package/types/index.server.d.ts +35 -8
- package/types/jsx.d.ts +15 -4
- package/types/observe.d.ts +294 -0
- package/types/response.d.ts +18 -0
- package/types/serializer-decode.d.ts +49 -2
- package/types/server-functions/client.d.ts +32 -22
- package/types/server-functions/server.d.ts +55 -41
- package/types/server-functions/shared.d.ts +39 -9
- package/types/server-mock.d.ts +26 -4
- package/types/server-observe.d.ts +39 -0
- package/types/server.d.ts +105 -6
- package/types/trace.d.ts +79 -0
- package/dist/server.cjs +0 -3708
- package/dist/web.dev.cjs +0 -2285
- package/frames/dist/client.cjs +0 -2043
- package/frames/dist/server.dev.cjs +0 -4584
- package/serialization/dist/decode.cjs +0 -155
- package/serialization/dist/serialization.cjs +0 -275
- package/serialization/types-cjs/index.d.cts +0 -101
- package/serialization/types-cjs/package.json +0 -3
- package/serialization/types-cjs/serializer-decode.d.cts +0 -172
- package/serialization/types-cjs/serializer.d.cts +0 -101
- package/server-functions/dist/rich-args.cjs +0 -11
- package/server-functions/dist/server.dev.cjs +0 -2409
- package/storage/dist/storage.cjs +0 -12
- package/storage/types-cjs/index.d.cts +0 -28
- package/storage/types-cjs/package.json +0 -3
- package/types-cjs/client.d.cts +0 -197
- package/types-cjs/constants.d.cts +0 -20
- package/types-cjs/cookies.d.cts +0 -41
- package/types-cjs/frames/client.d.cts +0 -36
- package/types-cjs/frames/frame-client.d.cts +0 -370
- package/types-cjs/frames/frame-container-plugin.d.cts +0 -71
- package/types-cjs/frames/frame-sink.d.cts +0 -92
- package/types-cjs/frames/frame-transport.d.cts +0 -189
- package/types-cjs/frames/serializer-decode.d.cts +0 -172
- package/types-cjs/frames/serializer.d.cts +0 -101
- package/types-cjs/frames/server.d.cts +0 -52
- package/types-cjs/head.d.cts +0 -19
- package/types-cjs/index.d.cts +0 -191
- package/types-cjs/index.server.d.cts +0 -147
- package/types-cjs/jsx-properties.d.cts +0 -93
- package/types-cjs/jsx.d.cts +0 -4146
- package/types-cjs/package.json +0 -3
- package/types-cjs/reconcile.d.cts +0 -1
- package/types-cjs/render.d.cts +0 -6
- package/types-cjs/response.d.cts +0 -81
- package/types-cjs/serializer-decode.d.cts +0 -172
- package/types-cjs/serializer.d.cts +0 -101
- package/types-cjs/server-functions/client.d.cts +0 -184
- package/types-cjs/server-functions/flash.d.cts +0 -36
- package/types-cjs/server-functions/registry.d.cts +0 -100
- package/types-cjs/server-functions/rich-args.d.cts +0 -1
- package/types-cjs/server-functions/server.d.cts +0 -546
- package/types-cjs/server-functions/shared.d.cts +0 -283
- package/types-cjs/server-mock.d.cts +0 -337
- package/types-cjs/server.d.cts +0 -408
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/web/server-functions",
|
|
3
|
-
"main": "./dist/server.
|
|
3
|
+
"main": "./dist/server.js",
|
|
4
4
|
"module": "./dist/server.js",
|
|
5
5
|
"types": "../types/server-functions/server.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -8,33 +8,27 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"browser": {
|
|
11
|
-
"
|
|
11
|
+
"development": {
|
|
12
12
|
"types": "../types/server-functions/client.d.ts",
|
|
13
|
-
"default": "./dist/client.js"
|
|
13
|
+
"default": "./dist/client.dev.js"
|
|
14
14
|
},
|
|
15
|
-
"
|
|
16
|
-
"types": "../types
|
|
17
|
-
"default": "./dist/client.
|
|
18
|
-
}
|
|
15
|
+
"observe": {
|
|
16
|
+
"types": "../types/server-functions/client.d.ts",
|
|
17
|
+
"default": "./dist/client.observe.js"
|
|
18
|
+
},
|
|
19
|
+
"types": "../types/server-functions/client.d.ts",
|
|
20
|
+
"default": "./dist/client.js"
|
|
19
21
|
},
|
|
20
22
|
"development": {
|
|
21
|
-
"
|
|
22
|
-
|
|
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
|
-
}
|
|
23
|
+
"types": "../types/server-functions/server.d.ts",
|
|
24
|
+
"default": "./dist/server.dev.js"
|
|
29
25
|
},
|
|
30
|
-
"
|
|
26
|
+
"observe": {
|
|
31
27
|
"types": "../types/server-functions/server.d.ts",
|
|
32
|
-
"default": "./dist/server.js"
|
|
28
|
+
"default": "./dist/server.observe.js"
|
|
33
29
|
},
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
"default": "./dist/server.cjs"
|
|
37
|
-
}
|
|
30
|
+
"types": "../types/server-functions/server.d.ts",
|
|
31
|
+
"default": "./dist/server.js"
|
|
38
32
|
}
|
|
39
33
|
}
|
|
40
34
|
}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/web/server-functions/rich-args",
|
|
3
|
-
"main": "../dist/rich-args.
|
|
3
|
+
"main": "../dist/rich-args.js",
|
|
4
4
|
"module": "../dist/rich-args.js",
|
|
5
5
|
"types": "../../types/server-functions/rich-args.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"
|
|
11
|
-
|
|
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
|
-
}
|
|
10
|
+
"types": "../../types/server-functions/rich-args.d.ts",
|
|
11
|
+
"default": "../dist/rich-args.js"
|
|
18
12
|
}
|
|
19
13
|
}
|
|
20
14
|
}
|
package/storage/package.json
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/web/storage",
|
|
3
|
-
"main": "./dist/storage.
|
|
3
|
+
"main": "./dist/storage.js",
|
|
4
4
|
"module": "./dist/storage.js",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"default": "./dist/storage.js"
|
|
13
|
-
},
|
|
14
|
-
"require": {
|
|
15
|
-
"types": "./types-cjs/index.d.cts",
|
|
16
|
-
"default": "./dist/storage.cjs"
|
|
17
|
-
}
|
|
10
|
+
"types": "./types/index.d.ts",
|
|
11
|
+
"default": "./dist/storage.js"
|
|
18
12
|
}
|
|
19
13
|
}
|
|
20
14
|
}
|
package/types/client.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { getOwner, createComponent, untrack, merge as mergeProps } from "solid-js";
|
|
2
|
+
import type { ClientErrorHook } from "solid-js";
|
|
2
3
|
import { effect, memo } from "./render.js";
|
|
3
4
|
import { JSX } from "./jsx.js";
|
|
4
5
|
import type { RequestEventLocals } from "./server.js";
|
|
6
|
+
import type { TraceContext } from "./trace.js";
|
|
5
7
|
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
6
8
|
/**
|
|
7
9
|
* A head tag descriptor. Props values may be getters (reactive on the
|
|
@@ -77,6 +79,8 @@ export interface RequestEvent {
|
|
|
77
79
|
locals: RequestEventLocals;
|
|
78
80
|
}
|
|
79
81
|
export type { CookieOptions } from "./cookies.js";
|
|
82
|
+
export type { CallEvent, CallListener, CallLive, FrameAppliedEvent, FrameEvent, FrameListener, FrameLive, FrameProducedEvent, InvocationEvent, InvocationListener, InvocationLive } from "./observe.js";
|
|
83
|
+
export type { TraceContext, TraceProvider, TraceSlot } from "./trace.js";
|
|
80
84
|
export type { ServerFunction, ServerFunctionMetadata, ServerFunctionRPC } from "./server-functions/shared.js";
|
|
81
85
|
export declare const waitAsset: (promise: Promise<unknown>) => void;
|
|
82
86
|
export { DOMWithState, ChildProperties, DOMElements, SVGElements, MathMLElements, VoidElements, RawTextElements, Namespaces, DelegatedEvents } from "./constants.js";
|
|
@@ -99,6 +103,12 @@ export { effect, memo, untrack, getOwner, createComponent };
|
|
|
99
103
|
*/
|
|
100
104
|
export { mergeProps };
|
|
101
105
|
export declare const getRequestEvent: () => RequestEvent | undefined;
|
|
106
|
+
/**
|
|
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.
|
|
110
|
+
*/
|
|
111
|
+
export declare const getTraceContext: () => TraceContext | undefined;
|
|
102
112
|
export { parseCookieHeader, serializeCookie } from "./cookies.js";
|
|
103
113
|
export { clearFlashCookie, hasFlashCookie } from "./cookies.js";
|
|
104
114
|
export { getServerFunctionMetadata, getServerFunctionRPC, isServerFunction } from "./server-functions/registry.js";
|
|
@@ -119,6 +129,14 @@ export { getServerFunctionMetadata, getServerFunctionRPC, isServerFunction } fro
|
|
|
119
129
|
export declare function render(code: () => JSX.Element, element: MountableElement, init?: JSX.Element, options?: {
|
|
120
130
|
owner?: unknown;
|
|
121
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;
|
|
122
140
|
}): () => void;
|
|
123
141
|
export declare function template(html: string, flag?: 1 | 2): () => Element;
|
|
124
142
|
export declare function delegateEvents(eventNames: string[]): void;
|
|
@@ -140,8 +158,27 @@ export declare function style(node: Element, value: {
|
|
|
140
158
|
}, prev?: {
|
|
141
159
|
[k: string]: string;
|
|
142
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 */
|
|
143
179
|
export declare function setStyleProperty(node: Element, name: string, value: any): void;
|
|
144
|
-
export declare function spread
|
|
180
|
+
export declare function spread(node: Element, sources: unknown[], skipChildren?: Boolean, skip?: (key: string) => boolean): void;
|
|
181
|
+
export declare function spread<T>(node: Element, accessor: T, skipChildren?: Boolean, skip?: (key: string) => boolean): void;
|
|
145
182
|
export declare function dynamicProperty(props: unknown, key: string): unknown;
|
|
146
183
|
export declare function applyRef<T extends Element = Element>(r: ((element: NoInfer<T>) => void) | ((element: NoInfer<T>) => void)[], element: T): void;
|
|
147
184
|
export declare function ref(fn: () => ((element: Element) => void) | ((element: Element) => void)[], element: Element): void;
|
|
@@ -186,6 +223,7 @@ export declare function useHead(tag: HeadTag | HeadTag[] | (() => HeadTag | Head
|
|
|
186
223
|
export declare function hydrate(fn: () => JSX.Element, node: MountableElement, options?: {
|
|
187
224
|
renderId?: string;
|
|
188
225
|
owner?: unknown;
|
|
226
|
+
onError?: ClientErrorHook;
|
|
189
227
|
}): () => void;
|
|
190
228
|
export declare function getNextElement(template?: () => Element): Element;
|
|
191
229
|
export declare function getNextMatch(start: Node, elementName: string): Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type DiagnosticEvent } from "solid-js";
|
|
2
|
+
export type Finding = Omit<DiagnosticEvent, "sequence">;
|
|
3
|
+
/**
|
|
4
|
+
* Records a finding — observe and dev tiers — and, in dev, reports it on the
|
|
5
|
+
* console. `subject` locates it (the current server owner by default; its
|
|
6
|
+
* component labels give the `ownerPath`); pass `null` for a finding with no
|
|
7
|
+
* location by nature (a stream event). No-op in prod.
|
|
8
|
+
*/
|
|
9
|
+
export declare function emitFinding(finding: Finding, subject?: unknown): void;
|
|
10
|
+
/**
|
|
11
|
+
* The structured record alone, for a site that THROWS its message: the
|
|
12
|
+
* thrown error is the console face and the core lands the once-per-code
|
|
13
|
+
* footer beneath it. Reporting as well would print the finding twice.
|
|
14
|
+
*/
|
|
15
|
+
export declare function recordFinding(finding: Finding, subject?: unknown): void;
|
|
16
|
+
/**
|
|
17
|
+
* A dev CHECK: `emitFinding` behind the dev gate, so the site reads as one
|
|
18
|
+
* call and the observe and prod artifacts carry none of it. Extra console
|
|
19
|
+
* arguments (the offending descriptor, the caught error) go on `data` — the
|
|
20
|
+
* structured record keeps them, the console face prints the message.
|
|
21
|
+
*/
|
|
22
|
+
export declare function devCheck(finding: Finding, subject?: unknown): void;
|
|
23
|
+
/** `Name: message` for an Error, `String(value)` otherwise. */
|
|
24
|
+
export declare function errorText(error: unknown): string;
|
|
@@ -98,7 +98,7 @@ export declare const FRAME_STREAM_HEADER = "X-Frame-Stream"; /**
|
|
|
98
98
|
* @experimental
|
|
99
99
|
*/
|
|
100
100
|
export declare function isFrameStreamResponse(response: Response): boolean;
|
|
101
|
-
export declare
|
|
101
|
+
export declare const applyFrameResponse: (response: Response, host: FrameHost, options?: ApplyFrameResponseOptions) => Promise<string>;
|
|
102
102
|
/** Brands an inline-rendered server component with its function id. */
|
|
103
103
|
export declare const SERVER_COMPONENT: unique symbol;
|
|
104
104
|
/** The unwrapped server component behind an inline-render wrap. */
|
|
@@ -145,7 +145,54 @@ export interface JSONDataTable {
|
|
|
145
145
|
* and deserialize halves, so the set lives on the decode side and the
|
|
146
146
|
* encode module composes over it.
|
|
147
147
|
*/
|
|
148
|
-
export declare const DEFAULT_WEB_PLUGINS:
|
|
148
|
+
export declare const DEFAULT_WEB_PLUGINS: readonly ({
|
|
149
|
+
tag: string;
|
|
150
|
+
test(value: any): boolean;
|
|
151
|
+
parse: {
|
|
152
|
+
sync(): never;
|
|
153
|
+
async(value: any, ctx: any): Promise<{
|
|
154
|
+
a: number;
|
|
155
|
+
i: any;
|
|
156
|
+
}>;
|
|
157
|
+
stream: (value: any, ctx: any) => {
|
|
158
|
+
a: number;
|
|
159
|
+
i: any;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
serialize(node: any, ctx: any): string;
|
|
163
|
+
deserialize(node: any, ctx: any): any;
|
|
164
|
+
} | import("seroval").Plugin<AbortSignal, {
|
|
165
|
+
reason?: import("seroval").SerovalNode;
|
|
166
|
+
controller?: import("seroval").SerovalNode;
|
|
167
|
+
factory?: import("seroval").SerovalNode;
|
|
168
|
+
}> | import("seroval").Plugin<CustomEvent<any>, {
|
|
169
|
+
type: import("seroval").SerovalNode;
|
|
170
|
+
options: import("seroval").SerovalNode;
|
|
171
|
+
}> | import("seroval").Plugin<DOMException, {
|
|
172
|
+
name: import("seroval").SerovalNode;
|
|
173
|
+
message: import("seroval").SerovalNode;
|
|
174
|
+
}> | import("seroval").Plugin<Event, {
|
|
175
|
+
type: import("seroval").SerovalNode;
|
|
176
|
+
options: import("seroval").SerovalNode;
|
|
177
|
+
}> | import("seroval").Plugin<FormData, {
|
|
178
|
+
factory: import("seroval").SerovalNode;
|
|
179
|
+
entries: import("seroval").SerovalNode;
|
|
180
|
+
}> | import("seroval").Plugin<Headers, {
|
|
181
|
+
value: import("seroval").SerovalNode;
|
|
182
|
+
}> | import("seroval").Plugin<ReadableStream<any>, {
|
|
183
|
+
factory: import("seroval").SerovalNode;
|
|
184
|
+
stream: import("seroval").SerovalNode;
|
|
185
|
+
}> | import("seroval").Plugin<Request, {
|
|
186
|
+
url: import("seroval").SerovalNode;
|
|
187
|
+
options: import("seroval").SerovalNode;
|
|
188
|
+
}> | import("seroval").Plugin<Response, {
|
|
189
|
+
body: import("seroval").SerovalNode;
|
|
190
|
+
options: import("seroval").SerovalNode;
|
|
191
|
+
}> | import("seroval").Plugin<URLSearchParams, {
|
|
192
|
+
value: import("seroval").SerovalNode;
|
|
193
|
+
}> | import("seroval").Plugin<URL, {
|
|
194
|
+
value: import("seroval").SerovalNode;
|
|
195
|
+
}>)[]; /**
|
|
149
196
|
* Composes custom plugins with `DEFAULT_WEB_PLUGINS`. Custom plugins come
|
|
150
197
|
* first so they can shadow a default for values both would match. Returns a
|
|
151
198
|
* fresh array; the defaults are never mutated. Useful when handing a full
|
|
@@ -156,7 +203,7 @@ export declare const DEFAULT_WEB_PLUGINS: any; /**
|
|
|
156
203
|
export declare function resolveSerializerPlugins(customPlugins?: SerializerPlugin[]): SerializerPlugin[];
|
|
157
204
|
export declare function resolveCodecOptions({ plugins, disabledFeatures, depthLimit, serializeErrorStacks }?: JSONCodecOptions): {
|
|
158
205
|
plugins: SerializerPlugin<any, any>[];
|
|
159
|
-
disabledFeatures:
|
|
206
|
+
disabledFeatures: number;
|
|
160
207
|
depthLimit: number;
|
|
161
208
|
serializeErrorStacks: boolean;
|
|
162
209
|
}; /**
|
package/types/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export declare const isDev: boolean;
|
|
|
46
46
|
export type IntrinsicElement = Extract<keyof JSX.IntrinsicElements, string>;
|
|
47
47
|
export type ValidComponent = IntrinsicElement | Component<any> | (string & {});
|
|
48
48
|
export type ComponentProps<T extends ValidComponent> = T extends Component<infer P> ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : Record<string, unknown>;
|
|
49
|
+
/** @deprecated Props of the deprecated `<Dynamic>`; see `dynamic()`. */
|
|
49
50
|
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
50
51
|
[K in keyof P]: P[K];
|
|
51
52
|
} & {
|
|
@@ -86,22 +87,32 @@ export interface DynamicOptions {
|
|
|
86
87
|
* `deferStream`. Ignored on the client.
|
|
87
88
|
*/
|
|
88
89
|
deferStream?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* The source cannot change: call it once, untracked, now, and render the
|
|
92
|
+
* result with no computation per instance (see `dynamic`). The source must
|
|
93
|
+
* resolve synchronously.
|
|
94
|
+
*/
|
|
95
|
+
static?: boolean;
|
|
89
96
|
}
|
|
90
|
-
export declare function dynamic<T extends ValidComponent>(source: () => T | Promise<T> | null | undefined | false,
|
|
97
|
+
export declare function dynamic<T extends ValidComponent>(source: () => T | Promise<T> | null | undefined | false, options?: DynamicOptions): Component<ComponentProps<T>>;
|
|
91
98
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
99
|
+
* @deprecated Use `dynamic()`. `<Dynamic>` is the same primitive, but its
|
|
100
|
+
* shape puts the tag in the same bag as the element's props: every instance
|
|
101
|
+
* merges `component` in at the call site, `omit()`s it back out here, and
|
|
102
|
+
* builds a fresh `dynamic()` factory (with its memo) because there is nowhere
|
|
103
|
+
* to hoist one. `dynamic()` has none of that and is one line longer:
|
|
94
104
|
*
|
|
95
|
-
* @example
|
|
96
105
|
* ```tsx
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
106
|
+
* // before
|
|
107
|
+
* <Dynamic component={multiline() ? RichTextEditor : "input"} value={value()} />
|
|
108
|
+
*
|
|
109
|
+
* // after — hoist per component instance (or per module for a constant)
|
|
110
|
+
* const Field = dynamic(() => multiline() ? RichTextEditor : "input");
|
|
111
|
+
* <Field value={value()} />
|
|
102
112
|
* ```
|
|
103
113
|
*
|
|
104
|
-
*
|
|
114
|
+
* Remains available in 2.0 (deprecated, no runtime warning); prefer `dynamic()`
|
|
115
|
+
* in new code.
|
|
105
116
|
*/
|
|
106
117
|
export declare function Dynamic<T extends ValidComponent>(props: DynamicProps<T>): JSX.Element;
|
|
107
118
|
/**
|
|
@@ -162,8 +173,8 @@ export declare function clientOnly<T extends Component<any>>(fn: () => Promise<{
|
|
|
162
173
|
* then recovered retracts its write instead of stomping a status a
|
|
163
174
|
* surviving part of the tree legitimately set. Once the response head is
|
|
164
175
|
* `committed` (head derived/sent — the shell flush of a piped
|
|
165
|
-
* `renderToStream`, the completion of an awaited one
|
|
166
|
-
*
|
|
176
|
+
* `renderToStream`, the completion of an awaited one or of
|
|
177
|
+
* `renderToString`), writes and retractions are no-ops.
|
|
167
178
|
*/
|
|
168
179
|
export declare function httpStatus(_code: number, _text?: string): void;
|
|
169
180
|
/**
|
|
@@ -182,9 +193,8 @@ export declare function httpStatus(_code: number, _text?: string): void;
|
|
|
182
193
|
* write time and restored when the owning scope is disposed (deleted if
|
|
183
194
|
* there was none) — a boundary that errors or recovers retracts its writes.
|
|
184
195
|
* Once the response head is `committed` (head derived/sent — the shell
|
|
185
|
-
* flush of a piped `renderToStream`, the completion of an awaited one
|
|
186
|
-
*
|
|
187
|
-
* retractions are no-ops.
|
|
196
|
+
* flush of a piped `renderToStream`, the completion of an awaited one or
|
|
197
|
+
* of `renderToString`), writes and retractions are no-ops.
|
|
188
198
|
*/
|
|
189
199
|
export declare function httpHeader(_name: string, _value: string, _options?: {
|
|
190
200
|
append?: boolean;
|
package/types/index.server.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { type Component } from "solid-js";
|
|
|
2
2
|
import type { JSX } from "./jsx.js";
|
|
3
3
|
export * from "./server.js";
|
|
4
4
|
export * from "./response.js";
|
|
5
|
+
export type { CallEvent, CallListener, CallLive, FrameAppliedEvent, FrameEvent, FrameListener, FrameLive, FrameProducedEvent, InvocationEvent, InvocationListener, InvocationLive } from "./observe.js";
|
|
6
|
+
export type { TraceContext, TraceProvider, TraceSlot } from "./trace.js";
|
|
5
7
|
export type { JSX } from "./jsx.js";
|
|
6
8
|
export { For, Show, Loading, Reveal, Switch, Match, Repeat, Errored, NoHydration, Hydration } from "solid-js";
|
|
7
9
|
/**
|
|
@@ -33,13 +35,39 @@ export interface DynamicOptions {
|
|
|
33
35
|
* for its module load, since its code is a prerequisite to the render).
|
|
34
36
|
*/
|
|
35
37
|
deferStream?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The source cannot change: call it once, untracked, now, and render the
|
|
40
|
+
* result with no computation per instance (see the client `dynamic`). The
|
|
41
|
+
* source must resolve synchronously.
|
|
42
|
+
*/
|
|
43
|
+
static?: boolean;
|
|
36
44
|
}
|
|
37
45
|
export declare function dynamic<T extends ValidComponent>(source: () => T | Promise<T> | null | undefined | false, options?: DynamicOptions): Component<ComponentProps<T>>;
|
|
46
|
+
/** @deprecated Props of the deprecated `<Dynamic>`; see `dynamic()`. */
|
|
38
47
|
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
39
48
|
[K in keyof P]: P[K];
|
|
40
49
|
} & {
|
|
41
50
|
component: T | null | undefined | false;
|
|
42
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated Use `dynamic()`. `<Dynamic>` is the same primitive, but its
|
|
54
|
+
* shape puts the tag in the same bag as the element's props: every instance
|
|
55
|
+
* merges `component` in at the call site, `omit()`s it back out here, and
|
|
56
|
+
* builds a fresh `dynamic()` factory (with its memo) because there is nowhere
|
|
57
|
+
* to hoist one. `dynamic()` has none of that and is one line longer:
|
|
58
|
+
*
|
|
59
|
+
* ```tsx
|
|
60
|
+
* // before
|
|
61
|
+
* <Dynamic component={multiline() ? RichTextEditor : "input"} value={value()} />
|
|
62
|
+
*
|
|
63
|
+
* // after — hoist per component instance (or per module for a constant)
|
|
64
|
+
* const Field = dynamic(() => multiline() ? RichTextEditor : "input");
|
|
65
|
+
* <Field value={value()} />
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* Remains available in 2.0 (deprecated, no runtime warning); prefer `dynamic()`
|
|
69
|
+
* in new code.
|
|
70
|
+
*/
|
|
43
71
|
export declare function Dynamic<T extends ValidComponent>(props: DynamicProps<T>): JSX.Element;
|
|
44
72
|
/**
|
|
45
73
|
* Portals are client-only islands: the server renders nothing for them —
|
|
@@ -107,11 +135,11 @@ export declare function clientOnly<T extends Component<any>>(fn: () => Promise<{
|
|
|
107
135
|
* cleanup are no-ops once the response head is `committed` (head
|
|
108
136
|
* derived/sent — status can no longer change). The head commits when it
|
|
109
137
|
* freezes: at shell flush for a piped `renderToStream` (`createSSRResponse`
|
|
110
|
-
* commits on the first write), at completion for an awaited one
|
|
111
|
-
* commits right before its final dispose, so
|
|
112
|
-
* that point are the ones the consumer
|
|
113
|
-
*
|
|
114
|
-
* is a no-op.
|
|
138
|
+
* commits on the first write), and at completion for an awaited one or for
|
|
139
|
+
* `renderToString` (the render commits right before its final dispose, so
|
|
140
|
+
* the declarations still live at that point are the ones the consumer
|
|
141
|
+
* derives the head from; `createSSRResponse` then passes the committed stub
|
|
142
|
+
* through). On the client this is a no-op.
|
|
115
143
|
*/
|
|
116
144
|
export declare function httpStatus(code: number, text?: string): void;
|
|
117
145
|
/**
|
|
@@ -138,9 +166,8 @@ export declare function httpStatus(code: number, text?: string): void;
|
|
|
138
166
|
* header). Both the write and the cleanup are no-ops once the response head
|
|
139
167
|
* is `committed` (head derived/sent — headers can no longer change); the
|
|
140
168
|
* head commits when it freezes — shell flush for a piped `renderToStream`,
|
|
141
|
-
* completion (right before the final dispose) for an awaited one
|
|
142
|
-
* `
|
|
143
|
-
* the client this is a no-op.
|
|
169
|
+
* completion (right before the final dispose) for an awaited one and for
|
|
170
|
+
* `renderToString` — see `httpStatus`. On the client this is a no-op.
|
|
144
171
|
*/
|
|
145
172
|
export declare function httpHeader(name: string, value: string, options?: {
|
|
146
173
|
append?: boolean;
|
package/types/jsx.d.ts
CHANGED
|
@@ -1109,7 +1109,17 @@ export namespace JSX {
|
|
|
1109
1109
|
type HTMLPreloadAs = "fetch" | "font" | "image" | "script" | "style" | "track";
|
|
1110
1110
|
type HTMLLinkAs = HTMLPreloadAs | "audio" | "document" | "embed" | "object" | "video" | "worker";
|
|
1111
1111
|
|
|
1112
|
-
|
|
1112
|
+
/**
|
|
1113
|
+
* `xmlns` on the tags that exist in both HTML and SVG (`a`, `script`, `style`,
|
|
1114
|
+
* `title`). The compiler reads it to pick the namespace when the tag is not
|
|
1115
|
+
* nested under `<svg>` at compile time (e.g. an XML partial), and `dynamic()`
|
|
1116
|
+
* honors it the same way when creating a tag-name element at runtime.
|
|
1117
|
+
*/
|
|
1118
|
+
interface AmbiguousNamespaceAttributes {
|
|
1119
|
+
xmlns?: string | RemoveAttribute;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
interface AnchorHTMLAttributes<T> extends HTMLAttributes<T>, AmbiguousNamespaceAttributes {
|
|
1113
1123
|
download?: string | EnumeratedAcceptsEmpty | RemoveAttribute;
|
|
1114
1124
|
href?: string | SerializableAttributeValue | RemoveAttribute;
|
|
1115
1125
|
hreflang?: string | RemoveAttribute;
|
|
@@ -1698,7 +1708,7 @@ export namespace JSX {
|
|
|
1698
1708
|
max?: number | string | RemoveAttribute;
|
|
1699
1709
|
value?: string | string[] | number | RemoveAttribute;
|
|
1700
1710
|
}
|
|
1701
|
-
interface ScriptHTMLAttributes<T> extends HTMLAttributes<T
|
|
1711
|
+
interface ScriptHTMLAttributes<T> extends HTMLAttributes<T>, AmbiguousNamespaceAttributes {
|
|
1702
1712
|
async?: BooleanAttribute | RemoveAttribute;
|
|
1703
1713
|
blocking?: "render" | RemoveAttribute;
|
|
1704
1714
|
crossorigin?: HTMLCrossorigin | RemoveAttribute;
|
|
@@ -1760,7 +1770,7 @@ export namespace JSX {
|
|
|
1760
1770
|
type?: string | RemoveAttribute;
|
|
1761
1771
|
width?: number | string | RemoveAttribute;
|
|
1762
1772
|
}
|
|
1763
|
-
interface StyleHTMLAttributes<T> extends HTMLAttributes<T
|
|
1773
|
+
interface StyleHTMLAttributes<T> extends HTMLAttributes<T>, AmbiguousNamespaceAttributes {
|
|
1764
1774
|
blocking?: "render" | RemoveAttribute;
|
|
1765
1775
|
media?: string | RemoveAttribute;
|
|
1766
1776
|
|
|
@@ -1861,6 +1871,7 @@ export namespace JSX {
|
|
|
1861
1871
|
interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1862
1872
|
datetime?: string | RemoveAttribute;
|
|
1863
1873
|
}
|
|
1874
|
+
interface TitleHTMLAttributes<T> extends HTMLAttributes<T>, AmbiguousNamespaceAttributes {}
|
|
1864
1875
|
interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
1865
1876
|
default?: BooleanAttribute | RemoveAttribute;
|
|
1866
1877
|
kind?:
|
|
@@ -3589,7 +3600,7 @@ export namespace JSX {
|
|
|
3589
3600
|
* @url https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
|
|
3590
3601
|
* @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLTitleElement
|
|
3591
3602
|
*/
|
|
3592
|
-
title:
|
|
3603
|
+
title: TitleHTMLAttributes<HTMLTitleElement> & Properties<HTMLTitleElement>;
|
|
3593
3604
|
/**
|
|
3594
3605
|
* @url https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr
|
|
3595
3606
|
* @url https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement
|