@solidjs/web 2.0.0-experimental.14 → 2.0.0-experimental.16
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 +114 -22
- package/dist/dev.js +112 -20
- package/dist/server.cjs +263 -41
- package/dist/server.js +265 -41
- package/dist/web.cjs +64 -18
- package/dist/web.js +62 -16
- package/package.json +5 -4
- package/storage/types/src/client.d.ts +1 -0
- package/storage/types/src/index.d.ts +45 -0
- package/storage/types/src/server-mock.d.ts +72 -0
- package/storage/types/storage/src/index.d.ts +2 -0
- package/types/client.d.ts +23 -7
- package/types/core.d.ts +2 -1
- package/types/server-mock.d.ts +33 -1
- package/types/server.d.ts +23 -18
package/types/server-mock.d.ts
CHANGED
|
@@ -1,26 +1,58 @@
|
|
|
1
1
|
export declare function renderToString<T>(fn: () => T, options?: {
|
|
2
2
|
nonce?: string;
|
|
3
3
|
renderId?: string;
|
|
4
|
+
noScripts?: boolean;
|
|
5
|
+
plugins?: any[];
|
|
6
|
+
manifest?: Record<string, {
|
|
7
|
+
file: string;
|
|
8
|
+
css?: string[];
|
|
9
|
+
isEntry?: boolean;
|
|
10
|
+
isDynamicEntry?: boolean;
|
|
11
|
+
imports?: string[];
|
|
12
|
+
}>;
|
|
13
|
+
onError?: (err: any) => void;
|
|
4
14
|
}): string;
|
|
5
15
|
export declare function renderToStringAsync<T>(fn: () => T, options?: {
|
|
6
16
|
timeoutMs?: number;
|
|
7
17
|
nonce?: string;
|
|
8
18
|
renderId?: string;
|
|
19
|
+
noScripts?: boolean;
|
|
20
|
+
plugins?: any[];
|
|
21
|
+
manifest?: Record<string, {
|
|
22
|
+
file: string;
|
|
23
|
+
css?: string[];
|
|
24
|
+
isEntry?: boolean;
|
|
25
|
+
isDynamicEntry?: boolean;
|
|
26
|
+
imports?: string[];
|
|
27
|
+
}>;
|
|
28
|
+
onError?: (err: any) => void;
|
|
9
29
|
}): Promise<string>;
|
|
10
30
|
export declare function renderToStream<T>(fn: () => T, options?: {
|
|
11
31
|
nonce?: string;
|
|
12
32
|
renderId?: string;
|
|
33
|
+
noScripts?: boolean;
|
|
34
|
+
plugins?: any[];
|
|
35
|
+
manifest?: Record<string, {
|
|
36
|
+
file: string;
|
|
37
|
+
css?: string[];
|
|
38
|
+
isEntry?: boolean;
|
|
39
|
+
isDynamicEntry?: boolean;
|
|
40
|
+
imports?: string[];
|
|
41
|
+
}>;
|
|
13
42
|
onCompleteShell?: (info: {
|
|
14
43
|
write: (v: string) => void;
|
|
15
44
|
}) => void;
|
|
16
45
|
onCompleteAll?: (info: {
|
|
17
46
|
write: (v: string) => void;
|
|
18
47
|
}) => void;
|
|
48
|
+
onError?: (err: any) => void;
|
|
19
49
|
}): {
|
|
50
|
+
then: (fn: (html: string) => void) => void;
|
|
20
51
|
pipe: (writable: {
|
|
21
52
|
write: (v: string) => void;
|
|
53
|
+
end: () => void;
|
|
22
54
|
}) => void;
|
|
23
|
-
pipeTo: (writable: WritableStream) => void
|
|
55
|
+
pipeTo: (writable: WritableStream) => Promise<void>;
|
|
24
56
|
};
|
|
25
57
|
export declare function ssr(template: string[] | string, ...nodes: any[]): {
|
|
26
58
|
t: string;
|
package/types/server.d.ts
CHANGED
|
@@ -13,9 +13,12 @@ export function renderToString<T>(
|
|
|
13
13
|
options?: {
|
|
14
14
|
nonce?: string;
|
|
15
15
|
renderId?: string;
|
|
16
|
+
noScripts?: boolean;
|
|
17
|
+
plugins?: any[];
|
|
16
18
|
onError?: (err: any) => void;
|
|
17
19
|
}
|
|
18
20
|
): string;
|
|
21
|
+
/** @deprecated use renderToStream which also returns a promise */
|
|
19
22
|
export function renderToStringAsync<T>(
|
|
20
23
|
fn: () => T,
|
|
21
24
|
options?: {
|
|
@@ -23,6 +26,7 @@ export function renderToStringAsync<T>(
|
|
|
23
26
|
nonce?: string;
|
|
24
27
|
renderId?: string;
|
|
25
28
|
noScripts?: boolean;
|
|
29
|
+
plugins?: any[];
|
|
26
30
|
onError?: (err: any) => void;
|
|
27
31
|
}
|
|
28
32
|
): Promise<string>;
|
|
@@ -31,12 +35,15 @@ export function renderToStream<T>(
|
|
|
31
35
|
options?: {
|
|
32
36
|
nonce?: string;
|
|
33
37
|
renderId?: string;
|
|
38
|
+
noScripts?: boolean;
|
|
39
|
+
plugins?: any[];
|
|
34
40
|
onCompleteShell?: (info: { write: (v: string) => void }) => void;
|
|
35
41
|
onCompleteAll?: (info: { write: (v: string) => void }) => void;
|
|
36
42
|
onError?: (err: any) => void;
|
|
37
43
|
}
|
|
38
44
|
): {
|
|
39
|
-
|
|
45
|
+
then: (fn: (html: string) => void) => void;
|
|
46
|
+
pipe: (writable: { write: (v: string) => void; end: () => void }) => void;
|
|
40
47
|
pipeTo: (writable: WritableStream) => Promise<void>;
|
|
41
48
|
};
|
|
42
49
|
|
|
@@ -48,21 +55,24 @@ export function ssrElement(
|
|
|
48
55
|
children: any,
|
|
49
56
|
needsId: boolean
|
|
50
57
|
): { t: string };
|
|
51
|
-
export function
|
|
52
|
-
export function ssrStyle(value: { [k: string]: string }): string;
|
|
53
|
-
export function
|
|
58
|
+
export function ssrClassName(value: string | { [k: string]: boolean } | Array<any>): string;
|
|
59
|
+
export function ssrStyle(value: string | { [k: string]: string }): string;
|
|
60
|
+
export function ssrStyleProperty(name: string, value: any): string;
|
|
61
|
+
export function ssrAttribute(key: string, value: any): string;
|
|
54
62
|
export function ssrHydrationKey(): string;
|
|
55
|
-
export function resolveSSRNode(node: any):
|
|
56
|
-
export function escape(
|
|
63
|
+
export function resolveSSRNode(node: any, result?: any, top?: boolean): any;
|
|
64
|
+
export function escape(s: any, attr?: boolean): any;
|
|
65
|
+
export function applyRef(r: ((element: any) => void) | ((element: any) => void)[], element: any): void;
|
|
57
66
|
export function useAssets(fn: () => JSX.Element): void;
|
|
58
67
|
export function getAssets(): string;
|
|
59
|
-
export function getHydrationKey(): string;
|
|
60
|
-
export function effect<T>(fn: (prev?: T) => T, init?: T): void;
|
|
68
|
+
export function getHydrationKey(): string | undefined;
|
|
69
|
+
export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void, init?: T): void;
|
|
61
70
|
export function memo<T>(fn: () => T, equal: boolean): () => T;
|
|
62
71
|
export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): JSX.Element;
|
|
63
72
|
export function mergeProps(...sources: unknown[]): unknown;
|
|
64
73
|
export function getOwner(): unknown;
|
|
65
|
-
export function
|
|
74
|
+
export function ssrRunInScope(fn: () => void, owner: unknown): void;
|
|
75
|
+
export function generateHydrationScript(options?: { nonce?: string; eventNames?: string[] }): string;
|
|
66
76
|
export declare const RequestContext: unique symbol;
|
|
67
77
|
export interface RequestEvent {
|
|
68
78
|
request: Request;
|
|
@@ -77,13 +87,6 @@ export function untrack<T>(fn: () => T): T;
|
|
|
77
87
|
|
|
78
88
|
// client-only APIs
|
|
79
89
|
|
|
80
|
-
/** @deprecated not supported on the server side */
|
|
81
|
-
export function classList(
|
|
82
|
-
node: Element,
|
|
83
|
-
value: { [k: string]: boolean },
|
|
84
|
-
prev?: { [k: string]: boolean }
|
|
85
|
-
): { [k: string]: boolean };
|
|
86
|
-
|
|
87
90
|
/** @deprecated not supported on the server side */
|
|
88
91
|
export function style(
|
|
89
92
|
node: Element,
|
|
@@ -127,7 +130,7 @@ export function addEventListener(
|
|
|
127
130
|
/** @deprecated not supported on the server side */
|
|
128
131
|
export function render(code: () => JSX.Element, element: MountableElement): () => void;
|
|
129
132
|
/** @deprecated not supported on the server side */
|
|
130
|
-
export function template(html: string,
|
|
133
|
+
export function template(html: string, isImportNode?: boolean, isSVG?: boolean, isMathML?: boolean): () => Element;
|
|
131
134
|
/** @deprecated not supported on the server side */
|
|
132
135
|
export function setProperty(node: Element, name: string, value: any): void;
|
|
133
136
|
/** @deprecated not supported on the server side */
|
|
@@ -143,8 +146,10 @@ export function hydrate(
|
|
|
143
146
|
): () => void;
|
|
144
147
|
|
|
145
148
|
/** @deprecated not supported on the server side */
|
|
146
|
-
export function getNextElement(template?:
|
|
149
|
+
export function getNextElement(template?: () => Element): Element;
|
|
147
150
|
/** @deprecated not supported on the server side */
|
|
148
151
|
export function getNextMatch(start: Node, elementName: string): Element;
|
|
149
152
|
/** @deprecated not supported on the server side */
|
|
150
153
|
export function getNextMarker(start: Node): [Node, Array<Node>];
|
|
154
|
+
/** @deprecated not supported on the server side */
|
|
155
|
+
export function runHydrationEvents(): void;
|