solid-js 1.6.9 → 1.6.10
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 +4 -0
- package/dist/dev.js +4 -0
- package/dist/solid.cjs +4 -0
- package/dist/solid.js +4 -0
- package/package.json +1 -1
- package/types/index.d.ts +1 -1
- package/types/reactive/observable.d.ts +8 -6
- package/types/reactive/signal.d.ts +3 -1
- package/types/render/Suspense.d.ts +2 -2
- package/types/render/flow.d.ts +6 -6
- package/web/types/index.d.ts +3 -3
package/dist/dev.cjs
CHANGED
|
@@ -471,13 +471,16 @@ function getOwner() {
|
|
|
471
471
|
}
|
|
472
472
|
function runWithOwner(o, fn) {
|
|
473
473
|
const prev = Owner;
|
|
474
|
+
const prevListener = Listener;
|
|
474
475
|
Owner = o;
|
|
476
|
+
Listener = null;
|
|
475
477
|
try {
|
|
476
478
|
return runUpdates(fn, true);
|
|
477
479
|
} catch (err) {
|
|
478
480
|
handleError(err);
|
|
479
481
|
} finally {
|
|
480
482
|
Owner = prev;
|
|
483
|
+
Listener = prevListener;
|
|
481
484
|
}
|
|
482
485
|
}
|
|
483
486
|
function enableScheduling(scheduler = requestCallback) {
|
|
@@ -811,6 +814,7 @@ function runUpdates(fn, init) {
|
|
|
811
814
|
return res;
|
|
812
815
|
} catch (err) {
|
|
813
816
|
if (!Updates) Effects = null;
|
|
817
|
+
Updates = null;
|
|
814
818
|
handleError(err);
|
|
815
819
|
}
|
|
816
820
|
}
|
package/dist/dev.js
CHANGED
|
@@ -469,13 +469,16 @@ function getOwner() {
|
|
|
469
469
|
}
|
|
470
470
|
function runWithOwner(o, fn) {
|
|
471
471
|
const prev = Owner;
|
|
472
|
+
const prevListener = Listener;
|
|
472
473
|
Owner = o;
|
|
474
|
+
Listener = null;
|
|
473
475
|
try {
|
|
474
476
|
return runUpdates(fn, true);
|
|
475
477
|
} catch (err) {
|
|
476
478
|
handleError(err);
|
|
477
479
|
} finally {
|
|
478
480
|
Owner = prev;
|
|
481
|
+
Listener = prevListener;
|
|
479
482
|
}
|
|
480
483
|
}
|
|
481
484
|
function enableScheduling(scheduler = requestCallback) {
|
|
@@ -809,6 +812,7 @@ function runUpdates(fn, init) {
|
|
|
809
812
|
return res;
|
|
810
813
|
} catch (err) {
|
|
811
814
|
if (!Updates) Effects = null;
|
|
815
|
+
Updates = null;
|
|
812
816
|
handleError(err);
|
|
813
817
|
}
|
|
814
818
|
}
|
package/dist/solid.cjs
CHANGED
|
@@ -458,13 +458,16 @@ function getOwner() {
|
|
|
458
458
|
}
|
|
459
459
|
function runWithOwner(o, fn) {
|
|
460
460
|
const prev = Owner;
|
|
461
|
+
const prevListener = Listener;
|
|
461
462
|
Owner = o;
|
|
463
|
+
Listener = null;
|
|
462
464
|
try {
|
|
463
465
|
return runUpdates(fn, true);
|
|
464
466
|
} catch (err) {
|
|
465
467
|
handleError(err);
|
|
466
468
|
} finally {
|
|
467
469
|
Owner = prev;
|
|
470
|
+
Listener = prevListener;
|
|
468
471
|
}
|
|
469
472
|
}
|
|
470
473
|
function enableScheduling(scheduler = requestCallback) {
|
|
@@ -741,6 +744,7 @@ function runUpdates(fn, init) {
|
|
|
741
744
|
return res;
|
|
742
745
|
} catch (err) {
|
|
743
746
|
if (!Updates) Effects = null;
|
|
747
|
+
Updates = null;
|
|
744
748
|
handleError(err);
|
|
745
749
|
}
|
|
746
750
|
}
|
package/dist/solid.js
CHANGED
|
@@ -456,13 +456,16 @@ function getOwner() {
|
|
|
456
456
|
}
|
|
457
457
|
function runWithOwner(o, fn) {
|
|
458
458
|
const prev = Owner;
|
|
459
|
+
const prevListener = Listener;
|
|
459
460
|
Owner = o;
|
|
461
|
+
Listener = null;
|
|
460
462
|
try {
|
|
461
463
|
return runUpdates(fn, true);
|
|
462
464
|
} catch (err) {
|
|
463
465
|
handleError(err);
|
|
464
466
|
} finally {
|
|
465
467
|
Owner = prev;
|
|
468
|
+
Listener = prevListener;
|
|
466
469
|
}
|
|
467
470
|
}
|
|
468
471
|
function enableScheduling(scheduler = requestCallback) {
|
|
@@ -739,6 +742,7 @@ function runUpdates(fn, init) {
|
|
|
739
742
|
return res;
|
|
740
743
|
} catch (err) {
|
|
741
744
|
if (!Updates) Effects = null;
|
|
745
|
+
Updates = null;
|
|
742
746
|
handleError(err);
|
|
743
747
|
}
|
|
744
748
|
}
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { $DEVCOMP, $PROXY, $TRACK, batch, children, createComputed, createContext, createDeferred, createEffect, createMemo, createReaction, createRenderEffect, createResource, createRoot, createSelector, createSignal, enableExternalSource, enableScheduling, equalFn, getListener, getOwner, on, onCleanup, onError, onMount, runWithOwner, startTransition, untrack, useContext, useTransition } from "./reactive/signal.js";
|
|
2
|
-
export type { Accessor, AccessorArray, ChildrenReturn, Context, EffectFunction, InitializedResource, InitializedResourceOptions, InitializedResourceReturn, MemoOptions, NoInfer, OnEffectFunction, Owner, Resource, ResourceActions, ResourceFetcher, ResourceFetcherInfo, ResourceOptions, ResourceReturn, ResourceSource, ReturnTypes, Setter, Signal, SignalOptions } from "./reactive/signal.js";
|
|
2
|
+
export type { Accessor, AccessorArray, ChildrenReturn, Context, EffectFunction, EffectOptions, InitializedResource, InitializedResourceOptions, InitializedResourceReturn, MemoOptions, NoInfer, OnEffectFunction, OnOptions, Owner, Resource, ResourceActions, ResourceFetcher, ResourceFetcherInfo, ResourceOptions, ResourceReturn, ResourceSource, ReturnTypes, Setter, Signal, SignalOptions } from "./reactive/signal.js";
|
|
3
3
|
export * from "./reactive/observable.js";
|
|
4
4
|
export * from "./reactive/scheduler.js";
|
|
5
5
|
export * from "./reactive/array.js";
|
|
@@ -4,6 +4,12 @@ declare global {
|
|
|
4
4
|
readonly observable: symbol;
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
+
interface Observable<T> {
|
|
8
|
+
subscribe(observer: ObservableObserver<T>): {
|
|
9
|
+
unsubscribe(): void;
|
|
10
|
+
};
|
|
11
|
+
[Symbol.observable](): Observable<T>;
|
|
12
|
+
}
|
|
7
13
|
export declare type ObservableObserver<T> = ((v: T) => void) | {
|
|
8
14
|
next?: (v: T) => void;
|
|
9
15
|
error?: (v: any) => void;
|
|
@@ -19,14 +25,10 @@ export declare type ObservableObserver<T> = ((v: T) => void) | {
|
|
|
19
25
|
* ```
|
|
20
26
|
* description https://www.solidjs.com/docs/latest/api#observable
|
|
21
27
|
*/
|
|
22
|
-
export declare function observable<T>(input: Accessor<T>):
|
|
23
|
-
subscribe(observer: ObservableObserver<T>): {
|
|
24
|
-
unsubscribe(): void;
|
|
25
|
-
};
|
|
26
|
-
[Symbol.observable](): any;
|
|
27
|
-
};
|
|
28
|
+
export declare function observable<T>(input: Accessor<T>): Observable<T>;
|
|
28
29
|
export declare function from<T>(producer: ((setter: Setter<T | undefined>) => () => void) | {
|
|
29
30
|
subscribe: (fn: (v: T) => void) => (() => void) | {
|
|
30
31
|
unsubscribe: () => void;
|
|
31
32
|
};
|
|
32
33
|
}): Accessor<T | undefined>;
|
|
34
|
+
export {};
|
|
@@ -412,9 +412,11 @@ export declare function onMount(fn: () => void): void;
|
|
|
412
412
|
* onCleanup - run an effect once before the reactive scope is disposed
|
|
413
413
|
* @param fn an effect that should run only once on cleanup
|
|
414
414
|
*
|
|
415
|
+
* @returns the same {@link fn} function that was passed in
|
|
416
|
+
*
|
|
415
417
|
* @description https://www.solidjs.com/docs/latest/api#oncleanup
|
|
416
418
|
*/
|
|
417
|
-
export declare function onCleanup
|
|
419
|
+
export declare function onCleanup<T extends () => any>(fn: T): T;
|
|
418
420
|
/**
|
|
419
421
|
* onError - run an effect whenever an error is thrown within the context of the child scopes
|
|
420
422
|
* @param fn an error handler that receives the error
|
|
@@ -2,7 +2,7 @@ import type { JSX } from "../jsx.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* **[experimental]** controls the order in which suspended content is rendered
|
|
4
4
|
*
|
|
5
|
-
* @description https://www.solidjs.com/docs/latest/api
|
|
5
|
+
* @description https://www.solidjs.com/docs/latest/api#suspenselist-experimental
|
|
6
6
|
*/
|
|
7
7
|
export declare function SuspenseList(props: {
|
|
8
8
|
children: JSX.Element;
|
|
@@ -18,7 +18,7 @@ export declare function SuspenseList(props: {
|
|
|
18
18
|
* <AsyncComponent />
|
|
19
19
|
* </Suspense>
|
|
20
20
|
* ```
|
|
21
|
-
* @description https://www.solidjs.com/docs/latest/api
|
|
21
|
+
* @description https://www.solidjs.com/docs/latest/api#suspense
|
|
22
22
|
*/
|
|
23
23
|
export declare function Suspense(props: {
|
|
24
24
|
fallback?: JSX.Element;
|
package/types/render/flow.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type { JSX } from "../jsx.js";
|
|
|
11
11
|
* ```
|
|
12
12
|
* If you have a list with fixed indices and changing values, consider using `<Index>` instead.
|
|
13
13
|
*
|
|
14
|
-
* @description https://www.solidjs.com/docs/latest/api
|
|
14
|
+
* @description https://www.solidjs.com/docs/latest/api#for
|
|
15
15
|
*/
|
|
16
16
|
export declare function For<T extends readonly any[], U extends JSX.Element>(props: {
|
|
17
17
|
each: T | undefined | null | false;
|
|
@@ -29,7 +29,7 @@ export declare function For<T extends readonly any[], U extends JSX.Element>(pro
|
|
|
29
29
|
* ```
|
|
30
30
|
* If you have a list with changing indices, better use `<For>`.
|
|
31
31
|
*
|
|
32
|
-
* @description https://www.solidjs.com/docs/latest/api
|
|
32
|
+
* @description https://www.solidjs.com/docs/latest/api#index
|
|
33
33
|
*/
|
|
34
34
|
export declare function Index<T extends readonly any[], U extends JSX.Element>(props: {
|
|
35
35
|
each: T | undefined | null | false;
|
|
@@ -38,7 +38,7 @@ export declare function Index<T extends readonly any[], U extends JSX.Element>(p
|
|
|
38
38
|
}): Accessor<U[]>;
|
|
39
39
|
/**
|
|
40
40
|
* Conditionally render its children or an optional fallback component
|
|
41
|
-
* @description https://www.solidjs.com/docs/latest/api
|
|
41
|
+
* @description https://www.solidjs.com/docs/latest/api#show
|
|
42
42
|
*/
|
|
43
43
|
export declare function Show<T>(props: {
|
|
44
44
|
when: T | undefined | null | false;
|
|
@@ -64,7 +64,7 @@ export declare function Show<T>(props: {
|
|
|
64
64
|
* </Match>
|
|
65
65
|
* </Switch>
|
|
66
66
|
* ```
|
|
67
|
-
* @description https://www.solidjs.com/docs/latest/api
|
|
67
|
+
* @description https://www.solidjs.com/docs/latest/api#switchmatch
|
|
68
68
|
*/
|
|
69
69
|
export declare function Switch(props: {
|
|
70
70
|
fallback?: JSX.Element;
|
|
@@ -82,7 +82,7 @@ export declare type MatchProps<T> = {
|
|
|
82
82
|
* <Content/>
|
|
83
83
|
* </Match>
|
|
84
84
|
* ```
|
|
85
|
-
* @description https://www.solidjs.com/docs/latest/api
|
|
85
|
+
* @description https://www.solidjs.com/docs/latest/api#switchmatch
|
|
86
86
|
*/
|
|
87
87
|
export declare function Match<T>(props: {
|
|
88
88
|
when: T | undefined | null | false;
|
|
@@ -108,7 +108,7 @@ export declare function resetErrorBoundaries(): void;
|
|
|
108
108
|
* ```
|
|
109
109
|
* Errors thrown from the fallback can be caught by a parent ErrorBoundary
|
|
110
110
|
*
|
|
111
|
-
* @description https://www.solidjs.com/docs/latest/api
|
|
111
|
+
* @description https://www.solidjs.com/docs/latest/api#errorboundary
|
|
112
112
|
*/
|
|
113
113
|
export declare function ErrorBoundary(props: {
|
|
114
114
|
fallback: JSX.Element | ((err: any, reset: () => void) => JSX.Element);
|
package/web/types/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const hydrate: typeof hydrateCore;
|
|
|
10
10
|
*
|
|
11
11
|
* 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.
|
|
12
12
|
*
|
|
13
|
-
* @description https://www.solidjs.com/docs/latest/api
|
|
13
|
+
* @description https://www.solidjs.com/docs/latest/api#portal
|
|
14
14
|
*/
|
|
15
15
|
export declare function Portal<T extends boolean = false, S extends boolean = false>(props: {
|
|
16
16
|
mount?: Node;
|
|
@@ -21,7 +21,7 @@ export declare function Portal<T extends boolean = false, S extends boolean = fa
|
|
|
21
21
|
} : {}) & (S extends true ? SVGGElement : HTMLDivElement)) => void);
|
|
22
22
|
children: JSX.Element;
|
|
23
23
|
}): Text;
|
|
24
|
-
declare type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
24
|
+
export declare type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
25
25
|
[K in keyof P]: P[K];
|
|
26
26
|
} & {
|
|
27
27
|
component: T | undefined;
|
|
@@ -31,6 +31,6 @@ declare type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
|
31
31
|
* ```typescript
|
|
32
32
|
* <Dynamic component={multiline() ? 'textarea' : 'input'} value={value()} />
|
|
33
33
|
* ```
|
|
34
|
-
* @description https://www.solidjs.com/docs/latest/api
|
|
34
|
+
* @description https://www.solidjs.com/docs/latest/api#dynamic
|
|
35
35
|
*/
|
|
36
36
|
export declare function Dynamic<T extends ValidComponent>(props: DynamicProps<T>): Accessor<JSX.Element>;
|