solid-js 1.9.3 → 2.0.0-experimental.0

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.
Files changed (76) hide show
  1. package/dist/dev.cjs +213 -1603
  2. package/dist/dev.js +159 -1749
  3. package/dist/server.cjs +88 -11
  4. package/dist/server.js +91 -11
  5. package/dist/solid.cjs +196 -1558
  6. package/dist/solid.js +139 -1682
  7. package/package.json +8 -154
  8. package/types/{render → client}/component.d.ts +0 -61
  9. package/types/client/core.d.ts +75 -0
  10. package/types/client/flow.d.ts +114 -0
  11. package/types/{render → client}/hydration.d.ts +0 -2
  12. package/types/{reactive → client}/observable.d.ts +1 -1
  13. package/types/index.d.ts +44 -55
  14. package/types/jsx.d.ts +1944 -174
  15. package/types/server/index.d.ts +1 -1
  16. package/types/server/reactive.d.ts +6 -1
  17. package/types/server/store.d.ts +6 -0
  18. package/h/dist/h.cjs +0 -115
  19. package/h/dist/h.js +0 -144
  20. package/h/jsx-dev-runtime/package.json +0 -8
  21. package/h/jsx-runtime/dist/jsx.cjs +0 -15
  22. package/h/jsx-runtime/dist/jsx.js +0 -10
  23. package/h/jsx-runtime/package.json +0 -8
  24. package/h/jsx-runtime/types/index.d.ts +0 -14
  25. package/h/jsx-runtime/types/jsx.d.ts +0 -2276
  26. package/h/package.json +0 -8
  27. package/h/types/hyperscript.d.ts +0 -20
  28. package/h/types/index.d.ts +0 -3
  29. package/html/dist/html.cjs +0 -583
  30. package/html/dist/html.js +0 -706
  31. package/html/package.json +0 -8
  32. package/html/types/index.d.ts +0 -3
  33. package/html/types/lit.d.ts +0 -60
  34. package/store/dist/dev.cjs +0 -454
  35. package/store/dist/dev.js +0 -525
  36. package/store/dist/server.cjs +0 -126
  37. package/store/dist/server.js +0 -126
  38. package/store/dist/store.cjs +0 -434
  39. package/store/dist/store.js +0 -499
  40. package/store/package.json +0 -46
  41. package/store/types/index.d.ts +0 -26
  42. package/store/types/modifiers.d.ts +0 -9
  43. package/store/types/mutable.d.ts +0 -8
  44. package/store/types/server.d.ts +0 -37
  45. package/store/types/store.d.ts +0 -263
  46. package/types/reactive/array.d.ts +0 -52
  47. package/types/reactive/scheduler.d.ts +0 -13
  48. package/types/reactive/signal.d.ts +0 -664
  49. package/types/render/Suspense.d.ts +0 -26
  50. package/types/render/flow.d.ts +0 -130
  51. package/types/render/index.d.ts +0 -4
  52. package/universal/dist/dev.cjs +0 -243
  53. package/universal/dist/dev.js +0 -257
  54. package/universal/dist/universal.cjs +0 -243
  55. package/universal/dist/universal.js +0 -257
  56. package/universal/package.json +0 -20
  57. package/universal/types/index.d.ts +0 -4
  58. package/universal/types/universal.d.ts +0 -29
  59. package/web/dist/dev.cjs +0 -804
  60. package/web/dist/dev.js +0 -1241
  61. package/web/dist/server.cjs +0 -793
  62. package/web/dist/server.js +0 -1214
  63. package/web/dist/web.cjs +0 -793
  64. package/web/dist/web.js +0 -1220
  65. package/web/package.json +0 -46
  66. package/web/storage/dist/storage.cjs +0 -12
  67. package/web/storage/dist/storage.js +0 -10
  68. package/web/storage/package.json +0 -15
  69. package/web/storage/types/index.d.ts +0 -2
  70. package/web/storage/types/index.js +0 -13
  71. package/web/types/client.d.ts +0 -79
  72. package/web/types/core.d.ts +0 -10
  73. package/web/types/index.d.ts +0 -54
  74. package/web/types/jsx.d.ts +0 -1
  75. package/web/types/server-mock.d.ts +0 -80
  76. package/web/types/server.d.ts +0 -177
package/web/package.json DELETED
@@ -1,46 +0,0 @@
1
- {
2
- "name": "solid-js/web",
3
- "main": "./dist/server.cjs",
4
- "module": "./dist/server.js",
5
- "unpkg": "./dist/web.cjs",
6
- "types": "./types/index.d.ts",
7
- "type": "module",
8
- "sideEffects": false,
9
- "exports": {
10
- ".": {
11
- "worker": {
12
- "types": "./types/index.d.ts",
13
- "import": "./dist/server.js",
14
- "require": "./dist/server.cjs"
15
- },
16
- "browser": {
17
- "development": {
18
- "types": "./types/index.d.ts",
19
- "import": "./dist/dev.js",
20
- "require": "./dist/dev.cjs"
21
- },
22
- "types": "./types/index.d.ts",
23
- "import": "./dist/web.js",
24
- "require": "./dist/web.cjs"
25
- },
26
- "deno": {
27
- "types": "./types/index.d.ts",
28
- "import": "./dist/server.js",
29
- "require": "./dist/server.cjs"
30
- },
31
- "node": {
32
- "types": "./types/index.d.ts",
33
- "import": "./dist/server.js",
34
- "require": "./dist/server.cjs"
35
- },
36
- "development": {
37
- "types": "./types/index.d.ts",
38
- "import": "./dist/dev.js",
39
- "require": "./dist/dev.cjs"
40
- },
41
- "types": "./types/index.d.ts",
42
- "import": "./dist/web.js",
43
- "require": "./dist/web.cjs"
44
- }
45
- }
46
- }
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var node_async_hooks = require('node:async_hooks');
4
- var web = require('solid-js/web');
5
-
6
- function provideRequestEvent(init, cb) {
7
- if (!web.isServer) throw new Error("Attempting to use server context in non-server build");
8
- const ctx = globalThis[web.RequestContext] = globalThis[web.RequestContext] || new node_async_hooks.AsyncLocalStorage();
9
- return ctx.run(init, cb);
10
- }
11
-
12
- exports.provideRequestEvent = provideRequestEvent;
@@ -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 };
@@ -1,15 +0,0 @@
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
- }
@@ -1,2 +0,0 @@
1
- import type { RequestEvent } from "solid-js/web";
2
- export declare function provideRequestEvent<T extends RequestEvent, U>(init: T, cb: () => U): U;
@@ -1,13 +0,0 @@
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;
@@ -1,79 +0,0 @@
1
- import { JSX } from "./jsx.js";
2
- export const Aliases: Record<string, string>;
3
- export const Properties: Set<string>;
4
- export const ChildProperties: Set<string>;
5
- export const DelegatedEvents: Set<string>;
6
- export const DOMElements: Set<string>;
7
- export const SVGElements: Set<string>;
8
- export const SVGNamespace: Record<string, string>;
9
- export function getPropAlias(prop: string, tagName: string): string | undefined;
10
-
11
- type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
12
- export function render(code: () => JSX.Element, element: MountableElement): () => void;
13
- export function template(html: string, isCE?: boolean, isSVG?: boolean): () => Element;
14
- export function effect<T>(fn: (prev?: T) => T, init?: T): void;
15
- export function memo<T>(fn: () => T, equal: boolean): () => T;
16
- export function untrack<T>(fn: () => T): T;
17
- export function insert<T>(
18
- parent: MountableElement,
19
- accessor: (() => T) | T,
20
- marker?: Node | null,
21
- init?: JSX.Element
22
- ): JSX.Element;
23
- export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): JSX.Element;
24
- export function delegateEvents(eventNames: string[], d?: Document): void;
25
- export function clearDelegatedEvents(d?: Document): void;
26
- export function spread<T>(
27
- node: Element,
28
- accessor: T,
29
- isSVG?: Boolean,
30
- skipChildren?: Boolean
31
- ): void;
32
- export function assign(node: Element, props: any, isSVG?: Boolean, skipChildren?: Boolean): void;
33
- export function setAttribute(node: Element, name: string, value: string): void;
34
- export function setAttributeNS(node: Element, namespace: string, name: string, value: string): void;
35
- export function setBoolAttribute(node: Element, name: string, value: any): void;
36
- export function className(node: Element, value: string): void;
37
- export function setProperty(node: Element, name: string, value: any): void;
38
- export function addEventListener(
39
- node: Element,
40
- name: string,
41
- handler: EventListener | EventListenerObject | (EventListenerObject & AddEventListenerOptions),
42
- delegate: boolean
43
- ): void;
44
- export function classList(
45
- node: Element,
46
- value: { [k: string]: boolean },
47
- prev?: { [k: string]: boolean }
48
- ): { [k: string]: boolean };
49
- export function style(
50
- node: Element,
51
- value: { [k: string]: string },
52
- prev?: { [k: string]: string }
53
- ): void;
54
- export function getOwner(): unknown;
55
- export function mergeProps(...sources: unknown[]): unknown;
56
- export function dynamicProperty(props: unknown, key: string): unknown;
57
-
58
- export function hydrate(
59
- fn: () => JSX.Element,
60
- node: MountableElement,
61
- options?: { renderId?: string; owner?: unknown }
62
- ): () => void;
63
- export function getHydrationKey(): string;
64
- export function getNextElement(template?: HTMLTemplateElement): Element;
65
- export function getNextMatch(start: Node, elementName: string): Element;
66
- export function getNextMarker(start: Node): [Node, Array<Node>];
67
- export function useAssets(fn: () => JSX.Element): void;
68
- export function getAssets(): string;
69
- export function HydrationScript(): JSX.Element;
70
- export function generateHydrationScript(): string;
71
- export function Assets(props: { children?: JSX.Element }): JSX.Element;
72
- export function Hydration(props: { children?: JSX.Element }): JSX.Element;
73
- export function NoHydration(props: { children?: JSX.Element }): JSX.Element;
74
- export interface RequestEvent {
75
- request: Request;
76
- }
77
- export declare const RequestContext: unique symbol;
78
- export function getRequestEvent(): RequestEvent | undefined;
79
- export function runHydrationEvents(): void;
@@ -1,10 +0,0 @@
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,54 +0,0 @@
1
- import { hydrate as hydrateCore } from "./client.js";
2
- import { JSX, ComponentProps, ValidComponent } from "solid-js";
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";
15
- export * from "./server-mock.js";
16
- export declare const isServer: boolean;
17
- export declare const isDev: boolean;
18
- export declare const hydrate: typeof hydrateCore;
19
- /**
20
- * Renders components somewhere else in the DOM
21
- *
22
- * Useful for inserting modals and tooltips outside of an cropping layout. If no mount point is given, the portal is inserted in document.body; it is wrapped in a `<div>` unless the target is document.head or `isSVG` is true. setting `useShadow` to true places the element in a shadow root to isolate styles.
23
- *
24
- * @description https://docs.solidjs.com/reference/components/portal
25
- */
26
- export declare function Portal<T extends boolean = false, S extends boolean = false>(props: {
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;
41
- }): Text;
42
- export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
43
- [K in keyof P]: P[K];
44
- } & {
45
- component: T | undefined;
46
- };
47
- /**
48
- * Renders an arbitrary custom or native component and passes the other props
49
- * ```typescript
50
- * <Dynamic component={multiline() ? 'textarea' : 'input'} value={value()} />
51
- * ```
52
- * @description https://docs.solidjs.com/reference/components/dynamic
53
- */
54
- export declare function Dynamic<T extends ValidComponent>(props: DynamicProps<T>): JSX.Element;
@@ -1 +0,0 @@
1
- export type { JSX } from "../../types/jsx.js";
@@ -1,80 +0,0 @@
1
- export declare function renderToString<T>(
2
- fn: () => T,
3
- options?: {
4
- nonce?: string;
5
- renderId?: string;
6
- }
7
- ): string;
8
- export declare function renderToStringAsync<T>(
9
- fn: () => T,
10
- options?: {
11
- timeoutMs?: number;
12
- nonce?: string;
13
- renderId?: string;
14
- }
15
- ): Promise<string>;
16
- export declare function renderToStream<T>(
17
- fn: () => T,
18
- options?: {
19
- nonce?: string;
20
- renderId?: string;
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;
27
- };
28
- export declare function ssr(
29
- template: string[] | string,
30
- ...nodes: any[]
31
- ): {
32
- t: string;
33
- };
34
- export declare function ssrElement(
35
- name: string,
36
- props: any,
37
- children: any,
38
- needsId: boolean
39
- ): {
40
- t: string;
41
- };
42
- export declare function ssrClassList(value: { [k: string]: boolean }): string;
43
- export declare function ssrStyle(value: { [k: string]: string }): string;
44
- export declare function ssrAttribute(key: string, value: boolean): string;
45
- export declare function ssrHydrationKey(): string;
46
- export declare function resolveSSRNode(node: any): string;
47
- export declare function escape(html: string): string;
48
- /**
49
- * @deprecated Replaced by ssrElement
50
- */
51
- export declare function ssrSpread(props: any, isSVG: boolean, skipChildren: boolean): void;
52
- export type LegacyResults = {
53
- startWriting: () => void;
54
- };
55
- /**
56
- * @deprecated Replaced by renderToStream
57
- */
58
- export declare function pipeToWritable<T>(
59
- fn: () => T,
60
- writable: WritableStream,
61
- options?: {
62
- nonce?: string;
63
- onReady?: (res: LegacyResults) => void;
64
- onCompleteAll?: () => void;
65
- }
66
- ): void;
67
- /**
68
- * @deprecated Replaced by renderToStream
69
- */
70
- export declare function pipeToNodeWritable<T>(
71
- fn: () => T,
72
- writable: {
73
- write: (v: string) => void;
74
- },
75
- options?: {
76
- nonce?: string;
77
- onReady?: (res: LegacyResults) => void;
78
- onCompleteAll?: () => void;
79
- }
80
- ): void;
@@ -1,177 +0,0 @@
1
- import { JSX } from "./jsx.js";
2
- export const Aliases: Record<string, string>;
3
- export const Properties: Set<string>;
4
- export const ChildProperties: Set<string>;
5
- export const DelegatedEvents: Set<string>;
6
- export const DOMElements: Set<string>;
7
- export const SVGElements: Set<string>;
8
- export const SVGNamespace: Record<string, string>;
9
- export function getPropAlias(prop: string, tagName: string): string | undefined;
10
-
11
- type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
12
-
13
- export function renderToString<T>(
14
- fn: () => T,
15
- options?: {
16
- nonce?: string;
17
- renderId?: string;
18
- onError?: (err: any) => void;
19
- }
20
- ): string;
21
- export function renderToStringAsync<T>(
22
- fn: () => T,
23
- options?: {
24
- timeoutMs?: number;
25
- nonce?: string;
26
- renderId?: string;
27
- noScripts?: boolean;
28
- onError?: (err: any) => void;
29
- }
30
- ): Promise<string>;
31
- export function renderToStream<T>(
32
- fn: () => T,
33
- options?: {
34
- nonce?: string;
35
- renderId?: string;
36
- onCompleteShell?: (info: { write: (v: string) => void }) => void;
37
- onCompleteAll?: (info: { write: (v: string) => void }) => void;
38
- onError?: (err: any) => void;
39
- }
40
- ): {
41
- pipe: (writable: { write: (v: string) => void }) => void;
42
- pipeTo: (writable: WritableStream) => Promise<void>;
43
- };
44
-
45
- export function HydrationScript(props: { nonce?: string; eventNames?: string[] }): JSX.Element;
46
- export function ssr(template: string[] | string, ...nodes: any[]): { t: string };
47
- export function ssrElement(
48
- name: string,
49
- props: any,
50
- children: any,
51
- needsId: boolean
52
- ): { t: string };
53
- export function ssrClassList(value: { [k: string]: boolean }): string;
54
- export function ssrStyle(value: { [k: string]: string }): string;
55
- export function ssrAttribute(key: string, value: any, isBoolean: boolean): string;
56
- export function ssrHydrationKey(): string;
57
- export function resolveSSRNode(node: any): string;
58
- export function escape(html: string): string;
59
- export function useAssets(fn: () => JSX.Element): void;
60
- export function getAssets(): string;
61
- export function getHydrationKey(): string;
62
- export function effect<T>(fn: (prev?: T) => T, init?: T): void;
63
- export function memo<T>(fn: () => T, equal: boolean): () => T;
64
- export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): JSX.Element;
65
- export function mergeProps(...sources: unknown[]): unknown;
66
- export function getOwner(): unknown;
67
- export function generateHydrationScript(options: { nonce?: string; eventNames?: string[] }): string;
68
- export declare const RequestContext: unique symbol;
69
- export interface RequestEvent {
70
- request: Request;
71
- locals: Record<string | number | symbol, any>;
72
- }
73
- export function getRequestEvent(): RequestEvent | undefined;
74
-
75
- export function Hydration(props: { children?: JSX.Element }): JSX.Element;
76
- export function NoHydration(props: { children?: JSX.Element }): JSX.Element;
77
- export function Assets(props: { children?: JSX.Element }): JSX.Element;
78
-
79
- // deprecated
80
- export type LegacyResults = {
81
- write: (text: string) => void;
82
- startWriting: () => void;
83
- };
84
- export function pipeToWritable<T>(
85
- fn: () => T,
86
- writable: WritableStream,
87
- options?: {
88
- nonce?: string;
89
- onReady?: (res: LegacyResults) => void;
90
- onCompleteAll?: () => void;
91
- }
92
- ): void;
93
- export function pipeToNodeWritable<T>(
94
- fn: () => T,
95
- writable: { write: (v: string) => void },
96
- options?: {
97
- nonce?: string;
98
- onReady?: (res: LegacyResults) => void;
99
- onCompleteAll?: () => void;
100
- }
101
- ): void;
102
-
103
- export function untrack<T>(fn: () => T): T;
104
-
105
- // client-only APIs
106
-
107
- /** @deprecated not supported on the server side */
108
- export function classList(
109
- node: Element,
110
- value: { [k: string]: boolean },
111
- prev?: { [k: string]: boolean }
112
- ): { [k: string]: boolean };
113
-
114
- /** @deprecated not supported on the server side */
115
- export function style(
116
- node: Element,
117
- value: { [k: string]: string },
118
- prev?: { [k: string]: string }
119
- ): void;
120
-
121
- /** @deprecated not supported on the server side */
122
- export function insert<T>(
123
- parent: MountableElement,
124
- accessor: (() => T) | T,
125
- marker?: Node | null,
126
- init?: JSX.Element
127
- ): JSX.Element;
128
-
129
- /** @deprecated not supported on the server side */
130
- export function spread<T>(
131
- node: Element,
132
- accessor: T,
133
- isSVG?: Boolean,
134
- skipChildren?: Boolean
135
- ): void;
136
-
137
- /** @deprecated not supported on the server side */
138
- export function delegateEvents(eventNames: string[], d?: Document): void;
139
- /** @deprecated not supported on the server side */
140
- export function dynamicProperty(props: unknown, key: string): unknown;
141
- /** @deprecated not supported on the server side */
142
- export function setAttribute(node: Element, name: string, value: string): void;
143
- /** @deprecated not supported on the server side */
144
- export function setAttributeNS(node: Element, namespace: string, name: string, value: string): void;
145
-
146
- /** @deprecated not supported on the server side */
147
- export function addEventListener(
148
- node: Element,
149
- name: string,
150
- handler: () => void,
151
- delegate: boolean
152
- ): void;
153
-
154
- /** @deprecated not supported on the server side */
155
- export function render(code: () => JSX.Element, element: MountableElement): () => void;
156
- /** @deprecated not supported on the server side */
157
- export function template(html: string, isCE?: boolean, isSVG?: boolean): () => Element;
158
- /** @deprecated not supported on the server side */
159
- export function setProperty(node: Element, name: string, value: any): void;
160
- /** @deprecated not supported on the server side */
161
- export function className(node: Element, value: string): void;
162
- /** @deprecated not supported on the server side */
163
- export function assign(node: Element, props: any, isSVG?: Boolean, skipChildren?: Boolean): void;
164
-
165
- /** @deprecated not supported on the server side */
166
- export function hydrate(
167
- fn: () => JSX.Element,
168
- node: MountableElement,
169
- options?: { renderId?: string; owner?: unknown }
170
- ): () => void;
171
-
172
- /** @deprecated not supported on the server side */
173
- export function getNextElement(template?: HTMLTemplateElement): Element;
174
- /** @deprecated not supported on the server side */
175
- export function getNextMatch(start: Node, elementName: string): Element;
176
- /** @deprecated not supported on the server side */
177
- export function getNextMarker(start: Node): [Node, Array<Node>];