@solidjs/web 2.0.0-experimental.4 → 2.0.0-experimental.6
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 +39 -66
- package/dist/dev.js +102 -672
- package/dist/server.cjs +137 -136
- package/dist/server.js +211 -733
- package/dist/web.cjs +39 -66
- package/dist/web.js +100 -660
- package/package.json +3 -3
- package/storage/dist/storage.js +3 -3
- package/types/client.d.ts +2 -13
- package/types/core.d.ts +2 -11
- package/types/index.d.ts +5 -8
- package/types/server-mock.d.ts +26 -33
- package/types/server.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/web",
|
|
3
3
|
"description": "Solid's web runtime for the browser and the server",
|
|
4
|
-
"version": "2.0.0-experimental.
|
|
4
|
+
"version": "2.0.0-experimental.6",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"seroval-plugins": "^1.1.0"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"solid-js": "^2.0.0-experimental.
|
|
78
|
+
"solid-js": "^2.0.0-experimental.6"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"solid-js": "2.0.0-experimental.
|
|
81
|
+
"solid-js": "2.0.0-experimental.6"
|
|
82
82
|
},
|
|
83
83
|
"scripts": {
|
|
84
84
|
"build": "npm-run-all -nl build:*",
|
package/storage/dist/storage.js
CHANGED
|
@@ -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 '@solidjs/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/types/client.d.ts
CHANGED
|
@@ -5,16 +5,11 @@ export const DelegatedEvents: Set<string>;
|
|
|
5
5
|
export const DOMElements: Set<string>;
|
|
6
6
|
export const SVGElements: Set<string>;
|
|
7
7
|
export const SVGNamespace: Record<string, string>;
|
|
8
|
-
export function getPropAlias(prop: string, tagName: string): string | undefined;
|
|
9
8
|
|
|
10
9
|
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
11
10
|
export function render(code: () => JSX.Element, element: MountableElement): () => void;
|
|
12
11
|
export function template(html: string, isCE?: boolean, isSVG?: boolean): () => Element;
|
|
13
|
-
export function effect<T>(
|
|
14
|
-
fn: (prev?: T) => T,
|
|
15
|
-
effect: (value: T, prev?: T) => void,
|
|
16
|
-
init?: T
|
|
17
|
-
): void;
|
|
12
|
+
export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void, init?: T): void;
|
|
18
13
|
export function memo<T>(fn: () => T, equal: boolean): () => T;
|
|
19
14
|
export function untrack<T>(fn: () => T): T;
|
|
20
15
|
export function insert<T>(
|
|
@@ -35,16 +30,10 @@ export function spread<T>(
|
|
|
35
30
|
export function assign(node: Element, props: any, isSVG?: Boolean, skipChildren?: Boolean): void;
|
|
36
31
|
export function setAttribute(node: Element, name: string, value: string): void;
|
|
37
32
|
export function setAttributeNS(node: Element, namespace: string, name: string, value: string): void;
|
|
38
|
-
export function setBoolAttribute(node: Element, name: string, value: any): void;
|
|
39
33
|
type ClassList =
|
|
40
34
|
| Record<string, boolean>
|
|
41
35
|
| Array<string | number | boolean | null | undefined | Record<string, boolean>>;
|
|
42
|
-
export function className(
|
|
43
|
-
node: Element,
|
|
44
|
-
value: string | ClassList,
|
|
45
|
-
isSvg?: boolean,
|
|
46
|
-
prev?: string | ClassList
|
|
47
|
-
): void;
|
|
36
|
+
export function className(node: Element, value: string | ClassList, isSvg?: boolean, prev?: string | ClassList): void;
|
|
48
37
|
export function setProperty(node: Element, name: string, value: any): void;
|
|
49
38
|
export function addEventListener(
|
|
50
39
|
node: Element,
|
package/types/core.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
createComponent,
|
|
4
|
-
createRoot as root,
|
|
5
|
-
createRenderEffect as effect,
|
|
6
|
-
createMemo as memo,
|
|
7
|
-
sharedConfig,
|
|
8
|
-
untrack,
|
|
9
|
-
merge as mergeProps,
|
|
10
|
-
flatten
|
|
11
|
-
} from "solid-js";
|
|
1
|
+
export { getOwner, createComponent, createRoot as root, createRenderEffect as effect, sharedConfig, untrack, merge as mergeProps, flatten, ssrHandleError, ssrRunInScope } from "solid-js";
|
|
2
|
+
export declare const memo: (fn: any) => import("solid-js").Accessor<any>;
|
package/types/index.d.ts
CHANGED
|
@@ -14,13 +14,13 @@ export declare const hydrate: typeof hydrateCore;
|
|
|
14
14
|
* @description https://docs.solidjs.com/reference/components/portal
|
|
15
15
|
*/
|
|
16
16
|
export declare function Portal<T extends boolean = false, S extends boolean = false>(props: {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
mount?: Element;
|
|
18
|
+
children: JSX.Element;
|
|
19
19
|
}): Text;
|
|
20
20
|
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
21
|
-
|
|
21
|
+
[K in keyof P]: P[K];
|
|
22
22
|
} & {
|
|
23
|
-
|
|
23
|
+
component: T | undefined;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
26
|
* Renders an arbitrary component or element with the given props
|
|
@@ -34,10 +34,7 @@ export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
|
34
34
|
* ```
|
|
35
35
|
* @description https://docs.solidjs.com/reference/components/dynamic
|
|
36
36
|
*/
|
|
37
|
-
export declare function createDynamic<T extends ValidComponent>(
|
|
38
|
-
component: () => T | undefined,
|
|
39
|
-
props: ComponentProps<T>
|
|
40
|
-
): JSX.Element;
|
|
37
|
+
export declare function createDynamic<T extends ValidComponent>(component: () => T | undefined, props: ComponentProps<T>): JSX.Element;
|
|
41
38
|
/**
|
|
42
39
|
* Renders an arbitrary custom or native component and passes the other props
|
|
43
40
|
* ```typescript
|
package/types/server-mock.d.ts
CHANGED
|
@@ -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;
|
package/types/server.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export const DelegatedEvents: Set<string>;
|
|
|
5
5
|
export const DOMElements: Set<string>;
|
|
6
6
|
export const SVGElements: Set<string>;
|
|
7
7
|
export const SVGNamespace: Record<string, string>;
|
|
8
|
-
export function getPropAlias(prop: string, tagName: string): string | undefined;
|
|
9
8
|
|
|
10
9
|
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
11
10
|
|