solid-js 1.7.0 → 1.7.2
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 +3 -3
- package/dist/dev.js +2 -3
- package/dist/solid.cjs +1 -1
- package/dist/solid.js +1 -1
- package/package.json +1 -1
- package/store/dist/dev.cjs +8 -8
- package/store/dist/dev.js +7 -8
- package/store/dist/store.cjs +6 -6
- package/store/dist/store.js +6 -6
- package/store/types/index.d.ts +7 -5
- package/store/types/store.d.ts +1 -1
- package/types/index.d.ts +6 -3
- package/web/dist/dev.cjs +4 -9
- package/web/dist/dev.js +5 -10
- package/web/dist/web.cjs +4 -9
- package/web/dist/web.js +5 -10
package/dist/dev.cjs
CHANGED
|
@@ -1666,12 +1666,11 @@ function Suspense(props) {
|
|
|
1666
1666
|
});
|
|
1667
1667
|
}
|
|
1668
1668
|
|
|
1669
|
-
|
|
1670
|
-
exports.DEV = {
|
|
1669
|
+
const DEV = {
|
|
1671
1670
|
hooks: DevHooks,
|
|
1672
1671
|
writeSignal,
|
|
1673
1672
|
registerGraph
|
|
1674
|
-
};
|
|
1673
|
+
} ;
|
|
1675
1674
|
if (globalThis) {
|
|
1676
1675
|
if (!globalThis.Solid$$) globalThis.Solid$$ = true;else console.warn("You appear to have multiple instances of Solid. This can lead to unexpected behavior.");
|
|
1677
1676
|
}
|
|
@@ -1679,6 +1678,7 @@ if (globalThis) {
|
|
|
1679
1678
|
exports.$DEVCOMP = $DEVCOMP;
|
|
1680
1679
|
exports.$PROXY = $PROXY;
|
|
1681
1680
|
exports.$TRACK = $TRACK;
|
|
1681
|
+
exports.DEV = DEV;
|
|
1682
1682
|
exports.ErrorBoundary = ErrorBoundary;
|
|
1683
1683
|
exports.For = For;
|
|
1684
1684
|
exports.Index = Index;
|
package/dist/dev.js
CHANGED
|
@@ -1664,12 +1664,11 @@ function Suspense(props) {
|
|
|
1664
1664
|
});
|
|
1665
1665
|
}
|
|
1666
1666
|
|
|
1667
|
-
|
|
1668
|
-
DEV = {
|
|
1667
|
+
const DEV = {
|
|
1669
1668
|
hooks: DevHooks,
|
|
1670
1669
|
writeSignal,
|
|
1671
1670
|
registerGraph
|
|
1672
|
-
};
|
|
1671
|
+
} ;
|
|
1673
1672
|
if (globalThis) {
|
|
1674
1673
|
if (!globalThis.Solid$$) globalThis.Solid$$ = true;else console.warn("You appear to have multiple instances of Solid. This can lead to unexpected behavior.");
|
|
1675
1674
|
}
|
package/dist/solid.cjs
CHANGED
package/dist/solid.js
CHANGED
|
@@ -1602,6 +1602,6 @@ function Suspense(props) {
|
|
|
1602
1602
|
});
|
|
1603
1603
|
}
|
|
1604
1604
|
|
|
1605
|
-
|
|
1605
|
+
const DEV = undefined;
|
|
1606
1606
|
|
|
1607
1607
|
export { $DEVCOMP, $PROXY, $TRACK, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, cancelCallback, catchError, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createReaction, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableHydration, enableScheduling, equalFn, from, getListener, getOwner, indexArray, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount, requestCallback, resetErrorBoundaries, runWithOwner, sharedConfig, splitProps, startTransition, untrack, useContext, useTransition };
|
package/package.json
CHANGED
package/store/dist/dev.cjs
CHANGED
|
@@ -59,7 +59,7 @@ function unwrap(item, set = new Set()) {
|
|
|
59
59
|
function getDataNodes(target) {
|
|
60
60
|
let nodes = target[$NODE];
|
|
61
61
|
if (!nodes) Object.defineProperty(target, $NODE, {
|
|
62
|
-
value: nodes =
|
|
62
|
+
value: nodes = Object.create(null)
|
|
63
63
|
});
|
|
64
64
|
return nodes;
|
|
65
65
|
}
|
|
@@ -101,8 +101,8 @@ const proxyTraps$1 = {
|
|
|
101
101
|
return receiver;
|
|
102
102
|
}
|
|
103
103
|
const nodes = getDataNodes(target);
|
|
104
|
-
const tracked = nodes
|
|
105
|
-
let value = tracked ?
|
|
104
|
+
const tracked = nodes[property];
|
|
105
|
+
let value = tracked ? tracked() : target[property];
|
|
106
106
|
if (property === $NODE || property === "__proto__") return value;
|
|
107
107
|
if (!tracked) {
|
|
108
108
|
const desc = Object.getOwnPropertyDescriptor(target, property);
|
|
@@ -239,8 +239,8 @@ const proxyTraps = {
|
|
|
239
239
|
return receiver;
|
|
240
240
|
}
|
|
241
241
|
const nodes = getDataNodes(target);
|
|
242
|
-
const tracked = nodes
|
|
243
|
-
let value = tracked ?
|
|
242
|
+
const tracked = nodes[property];
|
|
243
|
+
let value = tracked ? tracked() : target[property];
|
|
244
244
|
if (property === $NODE || property === "__proto__") return value;
|
|
245
245
|
if (!tracked) {
|
|
246
246
|
const desc = Object.getOwnPropertyDescriptor(target, property);
|
|
@@ -421,14 +421,14 @@ function produce(fn) {
|
|
|
421
421
|
};
|
|
422
422
|
}
|
|
423
423
|
|
|
424
|
-
|
|
425
|
-
exports.DEV = {
|
|
424
|
+
const DEV = {
|
|
426
425
|
$NODE,
|
|
427
426
|
isWrappable,
|
|
428
427
|
hooks: DevHooks
|
|
429
|
-
};
|
|
428
|
+
} ;
|
|
430
429
|
|
|
431
430
|
exports.$RAW = $RAW;
|
|
431
|
+
exports.DEV = DEV;
|
|
432
432
|
exports.createMutable = createMutable;
|
|
433
433
|
exports.createStore = createStore;
|
|
434
434
|
exports.modifyMutable = modifyMutable;
|
package/store/dist/dev.js
CHANGED
|
@@ -57,7 +57,7 @@ function unwrap(item, set = new Set()) {
|
|
|
57
57
|
function getDataNodes(target) {
|
|
58
58
|
let nodes = target[$NODE];
|
|
59
59
|
if (!nodes) Object.defineProperty(target, $NODE, {
|
|
60
|
-
value: nodes =
|
|
60
|
+
value: nodes = Object.create(null)
|
|
61
61
|
});
|
|
62
62
|
return nodes;
|
|
63
63
|
}
|
|
@@ -99,8 +99,8 @@ const proxyTraps$1 = {
|
|
|
99
99
|
return receiver;
|
|
100
100
|
}
|
|
101
101
|
const nodes = getDataNodes(target);
|
|
102
|
-
const tracked = nodes
|
|
103
|
-
let value = tracked ?
|
|
102
|
+
const tracked = nodes[property];
|
|
103
|
+
let value = tracked ? tracked() : target[property];
|
|
104
104
|
if (property === $NODE || property === "__proto__") return value;
|
|
105
105
|
if (!tracked) {
|
|
106
106
|
const desc = Object.getOwnPropertyDescriptor(target, property);
|
|
@@ -237,8 +237,8 @@ const proxyTraps = {
|
|
|
237
237
|
return receiver;
|
|
238
238
|
}
|
|
239
239
|
const nodes = getDataNodes(target);
|
|
240
|
-
const tracked = nodes
|
|
241
|
-
let value = tracked ?
|
|
240
|
+
const tracked = nodes[property];
|
|
241
|
+
let value = tracked ? tracked() : target[property];
|
|
242
242
|
if (property === $NODE || property === "__proto__") return value;
|
|
243
243
|
if (!tracked) {
|
|
244
244
|
const desc = Object.getOwnPropertyDescriptor(target, property);
|
|
@@ -419,11 +419,10 @@ function produce(fn) {
|
|
|
419
419
|
};
|
|
420
420
|
}
|
|
421
421
|
|
|
422
|
-
|
|
423
|
-
DEV = {
|
|
422
|
+
const DEV = {
|
|
424
423
|
$NODE,
|
|
425
424
|
isWrappable,
|
|
426
425
|
hooks: DevHooks
|
|
427
|
-
};
|
|
426
|
+
} ;
|
|
428
427
|
|
|
429
428
|
export { $RAW, DEV, createMutable, createStore, modifyMutable, produce, reconcile, unwrap };
|
package/store/dist/store.cjs
CHANGED
|
@@ -56,7 +56,7 @@ function unwrap(item, set = new Set()) {
|
|
|
56
56
|
function getDataNodes(target) {
|
|
57
57
|
let nodes = target[$NODE];
|
|
58
58
|
if (!nodes) Object.defineProperty(target, $NODE, {
|
|
59
|
-
value: nodes =
|
|
59
|
+
value: nodes = Object.create(null)
|
|
60
60
|
});
|
|
61
61
|
return nodes;
|
|
62
62
|
}
|
|
@@ -98,8 +98,8 @@ const proxyTraps$1 = {
|
|
|
98
98
|
return receiver;
|
|
99
99
|
}
|
|
100
100
|
const nodes = getDataNodes(target);
|
|
101
|
-
const tracked = nodes
|
|
102
|
-
let value = tracked ?
|
|
101
|
+
const tracked = nodes[property];
|
|
102
|
+
let value = tracked ? tracked() : target[property];
|
|
103
103
|
if (property === $NODE || property === "__proto__") return value;
|
|
104
104
|
if (!tracked) {
|
|
105
105
|
const desc = Object.getOwnPropertyDescriptor(target, property);
|
|
@@ -228,8 +228,8 @@ const proxyTraps = {
|
|
|
228
228
|
return receiver;
|
|
229
229
|
}
|
|
230
230
|
const nodes = getDataNodes(target);
|
|
231
|
-
const tracked = nodes
|
|
232
|
-
let value = tracked ?
|
|
231
|
+
const tracked = nodes[property];
|
|
232
|
+
let value = tracked ? tracked() : target[property];
|
|
233
233
|
if (property === $NODE || property === "__proto__") return value;
|
|
234
234
|
if (!tracked) {
|
|
235
235
|
const desc = Object.getOwnPropertyDescriptor(target, property);
|
|
@@ -405,7 +405,7 @@ function produce(fn) {
|
|
|
405
405
|
};
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
-
|
|
408
|
+
const DEV = undefined;
|
|
409
409
|
|
|
410
410
|
exports.$RAW = $RAW;
|
|
411
411
|
exports.DEV = DEV;
|
package/store/dist/store.js
CHANGED
|
@@ -54,7 +54,7 @@ function unwrap(item, set = new Set()) {
|
|
|
54
54
|
function getDataNodes(target) {
|
|
55
55
|
let nodes = target[$NODE];
|
|
56
56
|
if (!nodes) Object.defineProperty(target, $NODE, {
|
|
57
|
-
value: nodes =
|
|
57
|
+
value: nodes = Object.create(null)
|
|
58
58
|
});
|
|
59
59
|
return nodes;
|
|
60
60
|
}
|
|
@@ -96,8 +96,8 @@ const proxyTraps$1 = {
|
|
|
96
96
|
return receiver;
|
|
97
97
|
}
|
|
98
98
|
const nodes = getDataNodes(target);
|
|
99
|
-
const tracked = nodes
|
|
100
|
-
let value = tracked ?
|
|
99
|
+
const tracked = nodes[property];
|
|
100
|
+
let value = tracked ? tracked() : target[property];
|
|
101
101
|
if (property === $NODE || property === "__proto__") return value;
|
|
102
102
|
if (!tracked) {
|
|
103
103
|
const desc = Object.getOwnPropertyDescriptor(target, property);
|
|
@@ -226,8 +226,8 @@ const proxyTraps = {
|
|
|
226
226
|
return receiver;
|
|
227
227
|
}
|
|
228
228
|
const nodes = getDataNodes(target);
|
|
229
|
-
const tracked = nodes
|
|
230
|
-
let value = tracked ?
|
|
229
|
+
const tracked = nodes[property];
|
|
230
|
+
let value = tracked ? tracked() : target[property];
|
|
231
231
|
if (property === $NODE || property === "__proto__") return value;
|
|
232
232
|
if (!tracked) {
|
|
233
233
|
const desc = Object.getOwnPropertyDescriptor(target, property);
|
|
@@ -403,6 +403,6 @@ function produce(fn) {
|
|
|
403
403
|
};
|
|
404
404
|
}
|
|
405
405
|
|
|
406
|
-
|
|
406
|
+
const DEV = undefined;
|
|
407
407
|
|
|
408
408
|
export { $RAW, DEV, createMutable, createStore, modifyMutable, produce, reconcile, unwrap };
|
package/store/types/index.d.ts
CHANGED
|
@@ -2,10 +2,12 @@ export { $RAW, createStore, unwrap } from "./store.js";
|
|
|
2
2
|
export type { ArrayFilterFn, DeepMutable, DeepReadonly, NotWrappable, Part, SetStoreFunction, SolidStore, Store, StoreNode, StorePathRange, StoreSetter } from "./store.js";
|
|
3
3
|
export * from "./mutable.js";
|
|
4
4
|
export * from "./modifiers.js";
|
|
5
|
-
import { $NODE, isWrappable
|
|
6
|
-
declare
|
|
7
|
-
$NODE: typeof $NODE;
|
|
8
|
-
isWrappable: typeof isWrappable;
|
|
9
|
-
hooks:
|
|
5
|
+
import { $NODE, isWrappable } from "./store.js";
|
|
6
|
+
declare const DEV: {
|
|
7
|
+
readonly $NODE: typeof $NODE;
|
|
8
|
+
readonly isWrappable: typeof isWrappable;
|
|
9
|
+
readonly hooks: {
|
|
10
|
+
onStoreNodeUpdate: import("./store.js").OnStoreNodeUpdate | null;
|
|
11
|
+
};
|
|
10
12
|
} | undefined;
|
|
11
13
|
export { DEV };
|
package/store/types/store.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ type DataNode = {
|
|
|
6
6
|
(): any;
|
|
7
7
|
$(value?: any): void;
|
|
8
8
|
};
|
|
9
|
-
type DataNodes = Record<PropertyKey, DataNode>;
|
|
9
|
+
type DataNodes = Record<PropertyKey, DataNode | undefined>;
|
|
10
10
|
export type OnStoreNodeUpdate = (state: StoreNode, property: PropertyKey, value: StoreNode | NotWrappable, prev: StoreNode | NotWrappable) => void;
|
|
11
11
|
export interface StoreNode {
|
|
12
12
|
[$NODE]?: DataNodes;
|
package/types/index.d.ts
CHANGED
|
@@ -7,9 +7,12 @@ export * from "./render/index.js";
|
|
|
7
7
|
import type { JSX } from "./jsx.js";
|
|
8
8
|
type JSXElement = JSX.Element;
|
|
9
9
|
export type { JSXElement, JSX };
|
|
10
|
-
import { registerGraph, writeSignal
|
|
11
|
-
declare
|
|
12
|
-
readonly hooks:
|
|
10
|
+
import { registerGraph, writeSignal } from "./reactive/signal.js";
|
|
11
|
+
declare const DEV: {
|
|
12
|
+
readonly hooks: {
|
|
13
|
+
afterUpdate: (() => void) | null;
|
|
14
|
+
afterCreateOwner: ((owner: import("./reactive/signal.js").Owner) => void) | null;
|
|
15
|
+
};
|
|
13
16
|
readonly writeSignal: typeof writeSignal;
|
|
14
17
|
readonly registerGraph: typeof registerGraph;
|
|
15
18
|
} | undefined;
|
package/web/dist/dev.cjs
CHANGED
|
@@ -573,20 +573,15 @@ function Portal(props) {
|
|
|
573
573
|
} = props,
|
|
574
574
|
marker = document.createTextNode(""),
|
|
575
575
|
mount = () => props.mount || document.body,
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
if (solidJs.sharedConfig.context) {
|
|
579
|
-
const [s, set] = solidJs.createSignal(false);
|
|
580
|
-
solidJs.onMount(() => set(true));
|
|
581
|
-
return () => s() && props.children;
|
|
582
|
-
} else return () => props.children;
|
|
583
|
-
}
|
|
576
|
+
owner = solidJs.getOwner();
|
|
577
|
+
let content;
|
|
584
578
|
solidJs.createEffect(() => {
|
|
579
|
+
content || (content = solidJs.runWithOwner(owner, () => props.children));
|
|
585
580
|
const el = mount();
|
|
586
581
|
if (el instanceof HTMLHeadElement) {
|
|
587
582
|
const [clean, setClean] = solidJs.createSignal(false);
|
|
588
583
|
const cleanup = () => setClean(true);
|
|
589
|
-
solidJs.createRoot(dispose => insert(el, () => !clean() ? content
|
|
584
|
+
solidJs.createRoot(dispose => insert(el, () => !clean() ? content : dispose(), null));
|
|
590
585
|
solidJs.onCleanup(cleanup);
|
|
591
586
|
} else {
|
|
592
587
|
const container = createElement(props.isSVG ? "g" : "div", props.isSVG),
|
package/web/dist/dev.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRoot, createRenderEffect, sharedConfig, untrack, enableHydration,
|
|
1
|
+
import { createRoot, createRenderEffect, sharedConfig, untrack, enableHydration, getOwner, createEffect, runWithOwner, createSignal, onCleanup, splitProps, createMemo, $DEVCOMP } from 'solid-js';
|
|
2
2
|
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, createMemo as memo, mergeProps, untrack } from 'solid-js';
|
|
3
3
|
|
|
4
4
|
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
@@ -572,20 +572,15 @@ function Portal(props) {
|
|
|
572
572
|
} = props,
|
|
573
573
|
marker = document.createTextNode(""),
|
|
574
574
|
mount = () => props.mount || document.body,
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
if (sharedConfig.context) {
|
|
578
|
-
const [s, set] = createSignal(false);
|
|
579
|
-
onMount(() => set(true));
|
|
580
|
-
return () => s() && props.children;
|
|
581
|
-
} else return () => props.children;
|
|
582
|
-
}
|
|
575
|
+
owner = getOwner();
|
|
576
|
+
let content;
|
|
583
577
|
createEffect(() => {
|
|
578
|
+
content || (content = runWithOwner(owner, () => props.children));
|
|
584
579
|
const el = mount();
|
|
585
580
|
if (el instanceof HTMLHeadElement) {
|
|
586
581
|
const [clean, setClean] = createSignal(false);
|
|
587
582
|
const cleanup = () => setClean(true);
|
|
588
|
-
createRoot(dispose => insert(el, () => !clean() ? content
|
|
583
|
+
createRoot(dispose => insert(el, () => !clean() ? content : dispose(), null));
|
|
589
584
|
onCleanup(cleanup);
|
|
590
585
|
} else {
|
|
591
586
|
const container = createElement(props.isSVG ? "g" : "div", props.isSVG),
|
package/web/dist/web.cjs
CHANGED
|
@@ -573,20 +573,15 @@ function Portal(props) {
|
|
|
573
573
|
} = props,
|
|
574
574
|
marker = document.createTextNode(""),
|
|
575
575
|
mount = () => props.mount || document.body,
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
if (solidJs.sharedConfig.context) {
|
|
579
|
-
const [s, set] = solidJs.createSignal(false);
|
|
580
|
-
solidJs.onMount(() => set(true));
|
|
581
|
-
return () => s() && props.children;
|
|
582
|
-
} else return () => props.children;
|
|
583
|
-
}
|
|
576
|
+
owner = solidJs.getOwner();
|
|
577
|
+
let content;
|
|
584
578
|
solidJs.createEffect(() => {
|
|
579
|
+
content || (content = solidJs.runWithOwner(owner, () => props.children));
|
|
585
580
|
const el = mount();
|
|
586
581
|
if (el instanceof HTMLHeadElement) {
|
|
587
582
|
const [clean, setClean] = solidJs.createSignal(false);
|
|
588
583
|
const cleanup = () => setClean(true);
|
|
589
|
-
solidJs.createRoot(dispose => insert(el, () => !clean() ? content
|
|
584
|
+
solidJs.createRoot(dispose => insert(el, () => !clean() ? content : dispose(), null));
|
|
590
585
|
solidJs.onCleanup(cleanup);
|
|
591
586
|
} else {
|
|
592
587
|
const container = createElement(props.isSVG ? "g" : "div", props.isSVG),
|
package/web/dist/web.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRoot, createRenderEffect, sharedConfig, untrack, enableHydration,
|
|
1
|
+
import { createRoot, createRenderEffect, sharedConfig, untrack, enableHydration, getOwner, createEffect, runWithOwner, createSignal, onCleanup, splitProps, createMemo, $DEVCOMP } from 'solid-js';
|
|
2
2
|
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, createMemo as memo, mergeProps, untrack } from 'solid-js';
|
|
3
3
|
|
|
4
4
|
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
@@ -572,20 +572,15 @@ function Portal(props) {
|
|
|
572
572
|
} = props,
|
|
573
573
|
marker = document.createTextNode(""),
|
|
574
574
|
mount = () => props.mount || document.body,
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
if (sharedConfig.context) {
|
|
578
|
-
const [s, set] = createSignal(false);
|
|
579
|
-
onMount(() => set(true));
|
|
580
|
-
return () => s() && props.children;
|
|
581
|
-
} else return () => props.children;
|
|
582
|
-
}
|
|
575
|
+
owner = getOwner();
|
|
576
|
+
let content;
|
|
583
577
|
createEffect(() => {
|
|
578
|
+
content || (content = runWithOwner(owner, () => props.children));
|
|
584
579
|
const el = mount();
|
|
585
580
|
if (el instanceof HTMLHeadElement) {
|
|
586
581
|
const [clean, setClean] = createSignal(false);
|
|
587
582
|
const cleanup = () => setClean(true);
|
|
588
|
-
createRoot(dispose => insert(el, () => !clean() ? content
|
|
583
|
+
createRoot(dispose => insert(el, () => !clean() ? content : dispose(), null));
|
|
589
584
|
onCleanup(cleanup);
|
|
590
585
|
} else {
|
|
591
586
|
const container = createElement(props.isSVG ? "g" : "div", props.isSVG),
|