solid-js 1.8.21 → 1.8.22
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 +3 -3
- package/dist/dev.cjs +6 -4
- package/dist/dev.js +325 -564
- package/dist/server.js +74 -168
- package/dist/solid.cjs +6 -4
- package/dist/solid.js +283 -491
- package/h/dist/h.cjs +1 -1
- package/h/dist/h.js +9 -38
- package/h/jsx-runtime/dist/jsx.js +1 -1
- package/h/jsx-runtime/types/index.d.ts +8 -11
- package/h/jsx-runtime/types/jsx.d.ts +2 -0
- package/h/types/hyperscript.d.ts +11 -11
- package/html/dist/html.js +94 -216
- package/html/types/lit.d.ts +33 -47
- package/package.json +1 -1
- package/store/dist/dev.js +43 -122
- package/store/dist/server.js +8 -19
- package/store/dist/store.js +40 -113
- package/store/types/index.d.ts +7 -21
- package/store/types/modifiers.d.ts +3 -6
- package/store/types/mutable.d.ts +2 -5
- package/store/types/server.d.ts +4 -12
- package/store/types/store.d.ts +61 -218
- package/types/index.d.ts +10 -75
- package/types/jsx.d.ts +8 -18
- package/types/reactive/array.d.ts +4 -12
- package/types/reactive/observable.d.ts +17 -25
- package/types/reactive/scheduler.d.ts +6 -9
- package/types/reactive/signal.d.ts +142 -233
- package/types/render/Suspense.d.ts +5 -5
- package/types/render/component.d.ts +33 -64
- package/types/render/flow.d.ts +31 -43
- package/types/render/hydration.d.ts +15 -15
- package/types/server/index.d.ts +2 -57
- package/types/server/reactive.d.ts +42 -73
- package/types/server/rendering.d.ts +98 -169
- package/universal/dist/dev.js +12 -28
- package/universal/dist/universal.js +12 -28
- package/universal/types/index.d.ts +1 -3
- package/universal/types/universal.d.ts +1 -0
- package/web/dist/dev.js +83 -625
- package/web/dist/server.js +96 -210
- package/web/dist/web.js +81 -616
- package/web/storage/dist/storage.js +3 -3
- package/web/types/client.d.ts +2 -2
- package/web/types/core.d.ts +1 -10
- package/web/types/index.d.ts +10 -27
- package/web/types/server-mock.d.ts +32 -47
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from
|
|
2
|
-
import { isServer, RequestContext } from
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import { isServer, RequestContext } from 'solid-js/web';
|
|
3
3
|
|
|
4
4
|
function provideRequestEvent(init, cb) {
|
|
5
5
|
if (!isServer) throw new Error("Attempting to use server context in non-server build");
|
|
6
|
-
const ctx =
|
|
6
|
+
const ctx = globalThis[RequestContext] = globalThis[RequestContext] || new AsyncLocalStorage();
|
|
7
7
|
return ctx.run(init, cb);
|
|
8
8
|
}
|
|
9
9
|
|
package/web/types/client.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export function dynamicProperty(props: unknown, key: string): unknown;
|
|
|
57
57
|
export function hydrate(
|
|
58
58
|
fn: () => JSX.Element,
|
|
59
59
|
node: MountableElement,
|
|
60
|
-
options?: { renderId?: string
|
|
60
|
+
options?: { renderId?: string, owner?: unknown }
|
|
61
61
|
): () => void;
|
|
62
62
|
export function getHydrationKey(): string;
|
|
63
63
|
export function getNextElement(template?: HTMLTemplateElement): Element;
|
|
@@ -74,4 +74,4 @@ export interface RequestEvent {
|
|
|
74
74
|
request: Request;
|
|
75
75
|
}
|
|
76
76
|
export declare const RequestContext: unique symbol;
|
|
77
|
-
export function getRequestEvent(): RequestEvent | undefined;
|
|
77
|
+
export function getRequestEvent(): RequestEvent | undefined;
|
package/web/types/core.d.ts
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
getOwner,
|
|
3
|
-
createComponent,
|
|
4
|
-
createRoot as root,
|
|
5
|
-
createRenderEffect as effect,
|
|
6
|
-
createMemo as memo,
|
|
7
|
-
sharedConfig,
|
|
8
|
-
untrack,
|
|
9
|
-
mergeProps
|
|
10
|
-
} from "solid-js";
|
|
1
|
+
export { getOwner, createComponent, createRoot as root, createRenderEffect as effect, createMemo as memo, sharedConfig, untrack, mergeProps } from "solid-js";
|
package/web/types/index.d.ts
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { hydrate as hydrateCore } from "./client.js";
|
|
2
2
|
import { JSX, ComponentProps, ValidComponent } from "solid-js";
|
|
3
3
|
export * from "./client.js";
|
|
4
|
-
export {
|
|
5
|
-
For,
|
|
6
|
-
Show,
|
|
7
|
-
Suspense,
|
|
8
|
-
SuspenseList,
|
|
9
|
-
Switch,
|
|
10
|
-
Match,
|
|
11
|
-
Index,
|
|
12
|
-
ErrorBoundary,
|
|
13
|
-
mergeProps
|
|
14
|
-
} from "solid-js";
|
|
4
|
+
export { For, Show, Suspense, SuspenseList, Switch, Match, Index, ErrorBoundary, mergeProps } from "solid-js";
|
|
15
5
|
export * from "./server-mock.js";
|
|
16
6
|
export declare const isServer: boolean;
|
|
17
7
|
export declare const isDev: boolean;
|
|
@@ -24,25 +14,18 @@ export declare const hydrate: typeof hydrateCore;
|
|
|
24
14
|
* @description https://docs.solidjs.com/reference/components/portal
|
|
25
15
|
*/
|
|
26
16
|
export declare function Portal<T extends boolean = false, S extends boolean = false>(props: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
? {
|
|
35
|
-
readonly shadowRoot: ShadowRoot;
|
|
36
|
-
}
|
|
37
|
-
: {}) &
|
|
38
|
-
(S extends true ? SVGGElement : HTMLDivElement)
|
|
39
|
-
) => void);
|
|
40
|
-
children: JSX.Element;
|
|
17
|
+
mount?: Node;
|
|
18
|
+
useShadow?: T;
|
|
19
|
+
isSVG?: S;
|
|
20
|
+
ref?: (S extends true ? SVGGElement : HTMLDivElement) | ((el: (T extends true ? {
|
|
21
|
+
readonly shadowRoot: ShadowRoot;
|
|
22
|
+
} : {}) & (S extends true ? SVGGElement : HTMLDivElement)) => void);
|
|
23
|
+
children: JSX.Element;
|
|
41
24
|
}): Text;
|
|
42
25
|
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
43
|
-
|
|
26
|
+
[K in keyof P]: P[K];
|
|
44
27
|
} & {
|
|
45
|
-
|
|
28
|
+
component: T | undefined;
|
|
46
29
|
};
|
|
47
30
|
/**
|
|
48
31
|
* Renders an arbitrary custom or native component and passes the other props
|
|
@@ -1,46 +1,39 @@
|
|
|
1
|
-
export declare function renderToString<T>(
|
|
2
|
-
fn: () => T,
|
|
3
|
-
options?: {
|
|
1
|
+
export declare function renderToString<T>(fn: () => T, options?: {
|
|
4
2
|
nonce?: string;
|
|
5
3
|
renderId?: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare function renderToStringAsync<T>(
|
|
9
|
-
fn: () => T,
|
|
10
|
-
options?: {
|
|
4
|
+
}): string;
|
|
5
|
+
export declare function renderToStringAsync<T>(fn: () => T, options?: {
|
|
11
6
|
timeoutMs?: number;
|
|
12
7
|
nonce?: string;
|
|
13
8
|
renderId?: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export declare function renderToStream<T>(
|
|
17
|
-
fn: () => T,
|
|
18
|
-
options?: {
|
|
9
|
+
}): Promise<string>;
|
|
10
|
+
export declare function renderToStream<T>(fn: () => T, options?: {
|
|
19
11
|
nonce?: string;
|
|
20
12
|
renderId?: string;
|
|
21
|
-
onCompleteShell?: (info: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
onCompleteShell?: (info: {
|
|
14
|
+
write: (v: string) => void;
|
|
15
|
+
}) => void;
|
|
16
|
+
onCompleteAll?: (info: {
|
|
17
|
+
write: (v: string) => void;
|
|
18
|
+
}) => void;
|
|
19
|
+
}): {
|
|
20
|
+
pipe: (writable: {
|
|
21
|
+
write: (v: string) => void;
|
|
22
|
+
}) => void;
|
|
23
|
+
pipeTo: (writable: WritableStream) => void;
|
|
27
24
|
};
|
|
28
|
-
export declare function ssr(
|
|
29
|
-
|
|
30
|
-
...nodes: any[]
|
|
31
|
-
): {
|
|
32
|
-
t: string;
|
|
25
|
+
export declare function ssr(template: string[] | string, ...nodes: any[]): {
|
|
26
|
+
t: string;
|
|
33
27
|
};
|
|
34
|
-
export declare function ssrElement(
|
|
35
|
-
|
|
36
|
-
props: any,
|
|
37
|
-
children: any,
|
|
38
|
-
needsId: boolean
|
|
39
|
-
): {
|
|
40
|
-
t: string;
|
|
28
|
+
export declare function ssrElement(name: string, props: any, children: any, needsId: boolean): {
|
|
29
|
+
t: string;
|
|
41
30
|
};
|
|
42
|
-
export declare function ssrClassList(value: {
|
|
43
|
-
|
|
31
|
+
export declare function ssrClassList(value: {
|
|
32
|
+
[k: string]: boolean;
|
|
33
|
+
}): string;
|
|
34
|
+
export declare function ssrStyle(value: {
|
|
35
|
+
[k: string]: string;
|
|
36
|
+
}): string;
|
|
44
37
|
export declare function ssrAttribute(key: string, value: boolean): string;
|
|
45
38
|
export declare function ssrHydrationKey(): string;
|
|
46
39
|
export declare function resolveSSRNode(node: any): string;
|
|
@@ -50,31 +43,23 @@ export declare function escape(html: string): string;
|
|
|
50
43
|
*/
|
|
51
44
|
export declare function ssrSpread(props: any, isSVG: boolean, skipChildren: boolean): void;
|
|
52
45
|
export type LegacyResults = {
|
|
53
|
-
|
|
46
|
+
startWriting: () => void;
|
|
54
47
|
};
|
|
55
48
|
/**
|
|
56
49
|
* @deprecated Replaced by renderToStream
|
|
57
50
|
*/
|
|
58
|
-
export declare function pipeToWritable<T>(
|
|
59
|
-
fn: () => T,
|
|
60
|
-
writable: WritableStream,
|
|
61
|
-
options?: {
|
|
51
|
+
export declare function pipeToWritable<T>(fn: () => T, writable: WritableStream, options?: {
|
|
62
52
|
nonce?: string;
|
|
63
53
|
onReady?: (res: LegacyResults) => void;
|
|
64
54
|
onCompleteAll?: () => void;
|
|
65
|
-
|
|
66
|
-
): void;
|
|
55
|
+
}): void;
|
|
67
56
|
/**
|
|
68
57
|
* @deprecated Replaced by renderToStream
|
|
69
58
|
*/
|
|
70
|
-
export declare function pipeToNodeWritable<T>(
|
|
71
|
-
fn: () => T,
|
|
72
|
-
writable: {
|
|
59
|
+
export declare function pipeToNodeWritable<T>(fn: () => T, writable: {
|
|
73
60
|
write: (v: string) => void;
|
|
74
|
-
|
|
75
|
-
options?: {
|
|
61
|
+
}, options?: {
|
|
76
62
|
nonce?: string;
|
|
77
63
|
onReady?: (res: LegacyResults) => void;
|
|
78
64
|
onCompleteAll?: () => void;
|
|
79
|
-
|
|
80
|
-
): void;
|
|
65
|
+
}): void;
|