solid-js 1.8.11 → 1.8.13
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.js +544 -307
- package/dist/server.js +170 -75
- package/dist/solid.js +471 -265
- package/h/dist/h.js +34 -8
- package/h/jsx-runtime/dist/jsx.js +1 -1
- package/h/jsx-runtime/types/index.d.ts +11 -8
- package/h/types/hyperscript.d.ts +11 -11
- package/html/dist/html.js +216 -94
- package/html/types/lit.d.ts +47 -33
- package/package.json +9 -4
- package/store/dist/dev.cjs +12 -2
- package/store/dist/dev.js +133 -44
- package/store/dist/server.js +19 -8
- package/store/dist/store.cjs +12 -2
- package/store/dist/store.js +124 -41
- package/store/types/index.d.ts +21 -7
- package/store/types/modifiers.d.ts +6 -3
- package/store/types/mutable.d.ts +5 -2
- package/store/types/server.d.ts +12 -4
- package/store/types/store.d.ts +218 -61
- package/types/index.d.ts +75 -10
- package/types/reactive/array.d.ts +12 -4
- package/types/reactive/observable.d.ts +25 -17
- package/types/reactive/scheduler.d.ts +9 -6
- package/types/reactive/signal.d.ts +233 -142
- package/types/render/Suspense.d.ts +5 -5
- package/types/render/component.d.ts +64 -33
- package/types/render/flow.d.ts +43 -31
- package/types/render/hydration.d.ts +13 -13
- package/types/server/index.d.ts +57 -2
- package/types/server/reactive.d.ts +73 -42
- package/types/server/rendering.d.ts +167 -96
- package/universal/dist/dev.js +28 -12
- package/universal/dist/universal.js +28 -12
- package/universal/types/index.d.ts +3 -1
- package/universal/types/universal.d.ts +0 -1
- package/web/dist/dev.cjs +3 -0
- package/web/dist/dev.js +625 -81
- package/web/dist/server.cjs +10 -15
- package/web/dist/server.js +216 -107
- package/web/dist/web.js +614 -80
- package/web/storage/dist/storage.js +10 -0
- package/web/storage/package.json +15 -0
- package/web/storage/types/index.d.ts +2 -0
- package/web/storage/types/index.js +13 -0
- package/web/types/client.d.ts +2 -2
- package/web/types/core.d.ts +10 -1
- package/web/types/index.d.ts +27 -10
- package/web/types/server-mock.d.ts +47 -32
- package/web/dist/storage.js +0 -10
- package/web/types/storage.d.ts +0 -2
- /package/web/{dist → storage/dist}/storage.cjs +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import { isServer, RequestContext } from "solid-js/web";
|
|
3
|
+
|
|
4
|
+
function provideRequestEvent(init, cb) {
|
|
5
|
+
if (!isServer) throw new Error("Attempting to use server context in non-server build");
|
|
6
|
+
const ctx = (globalThis[RequestContext] = globalThis[RequestContext] || new AsyncLocalStorage());
|
|
7
|
+
return ctx.run(init, cb);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { provideRequestEvent };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "solid-js/web/storage",
|
|
3
|
+
"main": "./dist/storage.cjs",
|
|
4
|
+
"module": "./dist/storage.js",
|
|
5
|
+
"types": "./types/index.d.ts",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./types/index.d.ts",
|
|
11
|
+
"import": "./dist/storage.js",
|
|
12
|
+
"require": "./dist/storage.cjs"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.provideRequestEvent = void 0;
|
|
4
|
+
var node_async_hooks_1 = require("node:async_hooks");
|
|
5
|
+
var web_1 = require("solid-js/web");
|
|
6
|
+
// using global on a symbol for locating it later and detaching for environments that don't support it.
|
|
7
|
+
function provideRequestEvent(init, cb) {
|
|
8
|
+
if (!web_1.isServer) throw new Error("Attempting to use server context in non-server build");
|
|
9
|
+
var ctx = (globalThis[web_1.RequestContext] =
|
|
10
|
+
globalThis[web_1.RequestContext] || new node_async_hooks_1.AsyncLocalStorage());
|
|
11
|
+
return ctx.run(init, cb);
|
|
12
|
+
}
|
|
13
|
+
exports.provideRequestEvent = provideRequestEvent;
|
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 +1,10 @@
|
|
|
1
|
-
export {
|
|
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";
|
package/web/types/index.d.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
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 {
|
|
4
|
+
export {
|
|
5
|
+
For,
|
|
6
|
+
Show,
|
|
7
|
+
Suspense,
|
|
8
|
+
SuspenseList,
|
|
9
|
+
Switch,
|
|
10
|
+
Match,
|
|
11
|
+
Index,
|
|
12
|
+
ErrorBoundary,
|
|
13
|
+
mergeProps
|
|
14
|
+
} from "solid-js";
|
|
5
15
|
export * from "./server-mock.js";
|
|
6
16
|
export declare const isServer: boolean;
|
|
7
17
|
export declare const isDev: boolean;
|
|
@@ -14,18 +24,25 @@ export declare const hydrate: typeof hydrateCore;
|
|
|
14
24
|
* @description https://www.solidjs.com/docs/latest/api#portal
|
|
15
25
|
*/
|
|
16
26
|
export declare function Portal<T extends boolean = false, S extends boolean = false>(props: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
mount?: Node;
|
|
28
|
+
useShadow?: T;
|
|
29
|
+
isSVG?: S;
|
|
30
|
+
ref?:
|
|
31
|
+
| (S extends true ? SVGGElement : HTMLDivElement)
|
|
32
|
+
| ((
|
|
33
|
+
el: (T extends true
|
|
34
|
+
? {
|
|
35
|
+
readonly shadowRoot: ShadowRoot;
|
|
36
|
+
}
|
|
37
|
+
: {}) &
|
|
38
|
+
(S extends true ? SVGGElement : HTMLDivElement)
|
|
39
|
+
) => void);
|
|
40
|
+
children: JSX.Element;
|
|
24
41
|
}): Text;
|
|
25
42
|
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
26
|
-
|
|
43
|
+
[K in keyof P]: P[K];
|
|
27
44
|
} & {
|
|
28
|
-
|
|
45
|
+
component: T | undefined;
|
|
29
46
|
};
|
|
30
47
|
/**
|
|
31
48
|
* renders an arbitrary custom or native component and passes the other props
|
|
@@ -1,39 +1,46 @@
|
|
|
1
|
-
export declare function renderToString<T>(
|
|
1
|
+
export declare function renderToString<T>(
|
|
2
|
+
fn: () => T,
|
|
3
|
+
options?: {
|
|
2
4
|
nonce?: string;
|
|
3
5
|
renderId?: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
+
}
|
|
7
|
+
): string;
|
|
8
|
+
export declare function renderToStringAsync<T>(
|
|
9
|
+
fn: () => T,
|
|
10
|
+
options?: {
|
|
6
11
|
timeoutMs?: number;
|
|
7
12
|
nonce?: string;
|
|
8
13
|
renderId?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
14
|
+
}
|
|
15
|
+
): Promise<string>;
|
|
16
|
+
export declare function renderToStream<T>(
|
|
17
|
+
fn: () => T,
|
|
18
|
+
options?: {
|
|
11
19
|
nonce?: string;
|
|
12
20
|
renderId?: string;
|
|
13
|
-
onCompleteShell?: (info: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}): {
|
|
20
|
-
pipe: (writable: {
|
|
21
|
-
write: (v: string) => void;
|
|
22
|
-
}) => void;
|
|
23
|
-
pipeTo: (writable: WritableStream) => void;
|
|
21
|
+
onCompleteShell?: (info: { write: (v: string) => void }) => void;
|
|
22
|
+
onCompleteAll?: (info: { write: (v: string) => void }) => void;
|
|
23
|
+
}
|
|
24
|
+
): {
|
|
25
|
+
pipe: (writable: { write: (v: string) => void }) => void;
|
|
26
|
+
pipeTo: (writable: WritableStream) => void;
|
|
24
27
|
};
|
|
25
|
-
export declare function ssr(
|
|
26
|
-
|
|
28
|
+
export declare function ssr(
|
|
29
|
+
template: string[] | string,
|
|
30
|
+
...nodes: any[]
|
|
31
|
+
): {
|
|
32
|
+
t: string;
|
|
27
33
|
};
|
|
28
|
-
export declare function ssrElement(
|
|
29
|
-
|
|
34
|
+
export declare function ssrElement(
|
|
35
|
+
name: string,
|
|
36
|
+
props: any,
|
|
37
|
+
children: any,
|
|
38
|
+
needsId: boolean
|
|
39
|
+
): {
|
|
40
|
+
t: string;
|
|
30
41
|
};
|
|
31
|
-
export declare function ssrClassList(value: {
|
|
32
|
-
|
|
33
|
-
}): string;
|
|
34
|
-
export declare function ssrStyle(value: {
|
|
35
|
-
[k: string]: string;
|
|
36
|
-
}): string;
|
|
42
|
+
export declare function ssrClassList(value: { [k: string]: boolean }): string;
|
|
43
|
+
export declare function ssrStyle(value: { [k: string]: string }): string;
|
|
37
44
|
export declare function ssrAttribute(key: string, value: boolean): string;
|
|
38
45
|
export declare function ssrHydrationKey(): string;
|
|
39
46
|
export declare function resolveSSRNode(node: any): string;
|
|
@@ -43,23 +50,31 @@ export declare function escape(html: string): string;
|
|
|
43
50
|
*/
|
|
44
51
|
export declare function ssrSpread(props: any, isSVG: boolean, skipChildren: boolean): void;
|
|
45
52
|
export type LegacyResults = {
|
|
46
|
-
|
|
53
|
+
startWriting: () => void;
|
|
47
54
|
};
|
|
48
55
|
/**
|
|
49
56
|
* @deprecated Replaced by renderToStream
|
|
50
57
|
*/
|
|
51
|
-
export declare function pipeToWritable<T>(
|
|
58
|
+
export declare function pipeToWritable<T>(
|
|
59
|
+
fn: () => T,
|
|
60
|
+
writable: WritableStream,
|
|
61
|
+
options?: {
|
|
52
62
|
nonce?: string;
|
|
53
63
|
onReady?: (res: LegacyResults) => void;
|
|
54
64
|
onCompleteAll?: () => void;
|
|
55
|
-
}
|
|
65
|
+
}
|
|
66
|
+
): void;
|
|
56
67
|
/**
|
|
57
68
|
* @deprecated Replaced by renderToStream
|
|
58
69
|
*/
|
|
59
|
-
export declare function pipeToNodeWritable<T>(
|
|
70
|
+
export declare function pipeToNodeWritable<T>(
|
|
71
|
+
fn: () => T,
|
|
72
|
+
writable: {
|
|
60
73
|
write: (v: string) => void;
|
|
61
|
-
},
|
|
74
|
+
},
|
|
75
|
+
options?: {
|
|
62
76
|
nonce?: string;
|
|
63
77
|
onReady?: (res: LegacyResults) => void;
|
|
64
78
|
onCompleteAll?: () => void;
|
|
65
|
-
}
|
|
79
|
+
}
|
|
80
|
+
): void;
|
package/web/dist/storage.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
-
import { isServer, RequestContext } from 'solid-js/web';
|
|
3
|
-
|
|
4
|
-
function provideRequestEvent(init, cb) {
|
|
5
|
-
if (!isServer) throw new Error("Attempting to use server context in non-server build");
|
|
6
|
-
const ctx = globalThis[RequestContext] = globalThis[RequestContext] || new AsyncLocalStorage();
|
|
7
|
-
return ctx.run(init, cb);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { provideRequestEvent };
|
package/web/types/storage.d.ts
DELETED
|
File without changes
|