solid-js 1.8.6 → 1.8.8
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 +31 -21
- package/dist/dev.js +327 -552
- package/dist/server.js +75 -170
- package/dist/solid.cjs +31 -21
- package/dist/solid.js +285 -479
- package/h/dist/h.js +8 -34
- package/h/jsx-runtime/dist/jsx.js +1 -1
- package/h/jsx-runtime/types/index.d.ts +8 -11
- package/h/jsx-runtime/types/jsx.d.ts +15 -1
- package/h/types/hyperscript.d.ts +11 -11
- package/html/dist/html.js +94 -216
- package/html/types/lit.d.ts +33 -47
- package/package.json +2 -2
- package/store/dist/dev.cjs +3 -2
- package/store/dist/dev.js +44 -115
- package/store/dist/server.js +8 -19
- package/store/dist/store.cjs +3 -2
- package/store/dist/store.js +41 -106
- package/store/types/index.d.ts +7 -21
- package/store/types/modifiers.d.ts +3 -6
- package/store/types/mutable.d.ts +2 -5
- package/store/types/server.d.ts +4 -12
- package/store/types/store.d.ts +61 -218
- package/types/index.d.ts +10 -75
- package/types/jsx.d.ts +15 -1
- package/types/reactive/array.d.ts +4 -12
- package/types/reactive/observable.d.ts +17 -25
- package/types/reactive/scheduler.d.ts +6 -9
- package/types/reactive/signal.d.ts +142 -231
- package/types/render/Suspense.d.ts +5 -5
- package/types/render/component.d.ts +33 -62
- package/types/render/flow.d.ts +31 -43
- package/types/render/hydration.d.ts +13 -13
- package/types/server/index.d.ts +2 -57
- package/types/server/reactive.d.ts +42 -73
- package/types/server/rendering.d.ts +96 -166
- package/universal/dist/dev.js +12 -28
- package/universal/dist/universal.js +12 -28
- package/universal/types/index.d.ts +1 -3
- package/universal/types/universal.d.ts +1 -0
- package/web/dist/dev.js +81 -620
- package/web/dist/server.cjs +23 -15
- package/web/dist/server.js +117 -191
- package/web/dist/storage.js +3 -3
- package/web/dist/web.js +80 -614
- package/web/types/client.d.ts +2 -2
- package/web/types/core.d.ts +1 -10
- package/web/types/index.d.ts +10 -27
- package/web/types/server-mock.d.ts +32 -47
package/dist/dev.cjs
CHANGED
|
@@ -152,7 +152,7 @@ const NO_INIT = {};
|
|
|
152
152
|
var Owner = null;
|
|
153
153
|
let Transition = null;
|
|
154
154
|
let Scheduler = null;
|
|
155
|
-
let
|
|
155
|
+
let ExternalSourceConfig = null;
|
|
156
156
|
let Listener = null;
|
|
157
157
|
let Updates = null;
|
|
158
158
|
let Effects = null;
|
|
@@ -162,7 +162,6 @@ const DevHooks = {
|
|
|
162
162
|
afterCreateOwner: null,
|
|
163
163
|
afterCreateSignal: null
|
|
164
164
|
};
|
|
165
|
-
const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
|
|
166
165
|
function createRoot(fn, detachedOwner) {
|
|
167
166
|
const listener = Listener,
|
|
168
167
|
owner = Owner,
|
|
@@ -439,10 +438,11 @@ function batch(fn) {
|
|
|
439
438
|
return runUpdates(fn, false);
|
|
440
439
|
}
|
|
441
440
|
function untrack(fn) {
|
|
442
|
-
if (Listener === null) return fn();
|
|
441
|
+
if (!ExternalSourceConfig && Listener === null) return fn();
|
|
443
442
|
const listener = Listener;
|
|
444
443
|
Listener = null;
|
|
445
444
|
try {
|
|
445
|
+
if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);
|
|
446
446
|
return fn();
|
|
447
447
|
} finally {
|
|
448
448
|
Listener = listener;
|
|
@@ -541,6 +541,7 @@ function startTransition(fn) {
|
|
|
541
541
|
return t ? t.done : undefined;
|
|
542
542
|
});
|
|
543
543
|
}
|
|
544
|
+
const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
|
|
544
545
|
function useTransition() {
|
|
545
546
|
return [transPending, startTransition];
|
|
546
547
|
}
|
|
@@ -594,22 +595,31 @@ let SuspenseContext;
|
|
|
594
595
|
function getSuspenseContext() {
|
|
595
596
|
return SuspenseContext || (SuspenseContext = createContext());
|
|
596
597
|
}
|
|
597
|
-
function enableExternalSource(factory) {
|
|
598
|
-
if (
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
598
|
+
function enableExternalSource(factory, untrack = fn => fn()) {
|
|
599
|
+
if (ExternalSourceConfig) {
|
|
600
|
+
const {
|
|
601
|
+
factory: oldFactory,
|
|
602
|
+
untrack: oldUntrack
|
|
603
|
+
} = ExternalSourceConfig;
|
|
604
|
+
ExternalSourceConfig = {
|
|
605
|
+
factory: (fn, trigger) => {
|
|
606
|
+
const oldSource = oldFactory(fn, trigger);
|
|
607
|
+
const source = factory(x => oldSource.track(x), trigger);
|
|
608
|
+
return {
|
|
609
|
+
track: x => source.track(x),
|
|
610
|
+
dispose() {
|
|
611
|
+
source.dispose();
|
|
612
|
+
oldSource.dispose();
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
},
|
|
616
|
+
untrack: fn => oldUntrack(() => untrack(fn))
|
|
610
617
|
};
|
|
611
618
|
} else {
|
|
612
|
-
|
|
619
|
+
ExternalSourceConfig = {
|
|
620
|
+
factory,
|
|
621
|
+
untrack
|
|
622
|
+
};
|
|
613
623
|
}
|
|
614
624
|
}
|
|
615
625
|
function readSignal() {
|
|
@@ -752,14 +762,14 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
752
762
|
}
|
|
753
763
|
}
|
|
754
764
|
if (options && options.name) c.name = options.name;
|
|
755
|
-
if (
|
|
765
|
+
if (ExternalSourceConfig && c.fn) {
|
|
756
766
|
const [track, trigger] = createSignal(undefined, {
|
|
757
767
|
equals: false
|
|
758
768
|
});
|
|
759
|
-
const ordinary =
|
|
769
|
+
const ordinary = ExternalSourceConfig.factory(c.fn, trigger);
|
|
760
770
|
onCleanup(() => ordinary.dispose());
|
|
761
771
|
const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());
|
|
762
|
-
const inTransition =
|
|
772
|
+
const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);
|
|
763
773
|
c.fn = x => {
|
|
764
774
|
track();
|
|
765
775
|
return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);
|
|
@@ -1508,7 +1518,7 @@ function Show(props) {
|
|
|
1508
1518
|
}
|
|
1509
1519
|
function Switch(props) {
|
|
1510
1520
|
let keyed = false;
|
|
1511
|
-
const equals = (a, b) =>
|
|
1521
|
+
const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
|
|
1512
1522
|
const conditions = children(() => props.children),
|
|
1513
1523
|
evalConditions = createMemo(() => {
|
|
1514
1524
|
let conds = conditions();
|