solid-js 1.3.7 → 1.3.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 +14 -12
- package/dist/dev.js +14 -12
- package/dist/server.cjs +4 -3
- package/dist/server.js +4 -3
- package/dist/solid.cjs +14 -12
- package/dist/solid.js +14 -12
- package/package.json +2 -2
- package/store/dist/dev.cjs +1 -1
- package/store/dist/dev.js +1 -1
- package/store/dist/server.cjs +2 -1
- package/store/dist/server.js +2 -1
- package/store/types/index.d.ts +1 -1
- package/store/types/modifiers.d.ts +3 -3
- package/store/types/server.d.ts +6 -6
- package/store/types/store.d.ts +24 -23
- package/types/reactive/signal.d.ts +3 -1
- package/web/dist/dev.cjs +2 -3
- package/web/dist/dev.js +2 -3
- package/web/dist/web.cjs +2 -3
- package/web/dist/web.js +2 -3
package/dist/dev.cjs
CHANGED
|
@@ -124,7 +124,7 @@ function setHydrateContext(context) {
|
|
|
124
124
|
}
|
|
125
125
|
function nextHydrateContext() {
|
|
126
126
|
return { ...sharedConfig.context,
|
|
127
|
-
id: `${sharedConfig.context.id}${sharedConfig.context.count++}
|
|
127
|
+
id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,
|
|
128
128
|
count: 0
|
|
129
129
|
};
|
|
130
130
|
}
|
|
@@ -158,14 +158,13 @@ let Effects = null;
|
|
|
158
158
|
let ExecCount = 0;
|
|
159
159
|
let rootCount = 0;
|
|
160
160
|
function createRoot(fn, detachedOwner) {
|
|
161
|
-
detachedOwner && (Owner = detachedOwner);
|
|
162
161
|
const listener = Listener,
|
|
163
162
|
owner = Owner,
|
|
164
163
|
root = fn.length === 0 && !"_SOLID_DEV_" ? UNOWNED : {
|
|
165
164
|
owned: null,
|
|
166
165
|
cleanups: null,
|
|
167
166
|
context: null,
|
|
168
|
-
owner
|
|
167
|
+
owner: detachedOwner || owner
|
|
169
168
|
};
|
|
170
169
|
if (owner) root.name = `${owner.name}-r${rootCount++}`;
|
|
171
170
|
Owner = root;
|
|
@@ -405,7 +404,8 @@ function createSelector(source, fn = equalFn, options) {
|
|
|
405
404
|
let l;
|
|
406
405
|
if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));
|
|
407
406
|
onCleanup(() => {
|
|
408
|
-
l.
|
|
407
|
+
l.delete(listener);
|
|
408
|
+
!l.size && subs.delete(key);
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
411
|
return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
|
|
@@ -587,7 +587,8 @@ function createContext(defaultValue) {
|
|
|
587
587
|
};
|
|
588
588
|
}
|
|
589
589
|
function useContext(context) {
|
|
590
|
-
|
|
590
|
+
let ctx;
|
|
591
|
+
return (ctx = lookup(Owner, context.id)) !== undefined ? ctx : context.defaultValue;
|
|
591
592
|
}
|
|
592
593
|
function children(fn) {
|
|
593
594
|
const children = createMemo(fn);
|
|
@@ -668,8 +669,10 @@ function writeSignal(node, value, isComp) {
|
|
|
668
669
|
for (let i = 0; i < node.observers.length; i += 1) {
|
|
669
670
|
const o = node.observers[i];
|
|
670
671
|
if (TransitionRunning && Transition.disposed.has(o)) continue;
|
|
671
|
-
if (o.
|
|
672
|
-
|
|
672
|
+
if (TransitionRunning && !o.tState || !TransitionRunning && !o.state) {
|
|
673
|
+
if (o.pure) Updates.push(o);else Effects.push(o);
|
|
674
|
+
if (o.observers) markUpstream(o);
|
|
675
|
+
}
|
|
673
676
|
if (TransitionRunning) o.tState = STALE;else o.state = STALE;
|
|
674
677
|
}
|
|
675
678
|
if (Updates.length > 10e5) {
|
|
@@ -760,8 +763,7 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
760
763
|
}
|
|
761
764
|
function runTop(node) {
|
|
762
765
|
const runningTransition = Transition && Transition.running;
|
|
763
|
-
if (!runningTransition && node.state !== STALE
|
|
764
|
-
if (runningTransition && node.tState !== STALE) return node.tState = 0;
|
|
766
|
+
if (!runningTransition && node.state !== STALE || runningTransition && node.tState !== STALE) return lookDownstream(node);
|
|
765
767
|
if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);
|
|
766
768
|
const ancestors = [node];
|
|
767
769
|
while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
|
|
@@ -954,7 +956,7 @@ function handleError(err) {
|
|
|
954
956
|
fns.forEach(f => f(err));
|
|
955
957
|
}
|
|
956
958
|
function lookup(owner, key) {
|
|
957
|
-
return owner
|
|
959
|
+
return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;
|
|
958
960
|
}
|
|
959
961
|
function resolveChildren(children) {
|
|
960
962
|
if (typeof children === "function" && !children.length) return resolveChildren(children());
|
|
@@ -1015,7 +1017,7 @@ function observable(input) {
|
|
|
1015
1017
|
if (!(observer instanceof Object) || observer == null) {
|
|
1016
1018
|
throw new TypeError("Expected the observer to be an object.");
|
|
1017
1019
|
}
|
|
1018
|
-
const handler = "next" in observer ? observer.next : observer;
|
|
1020
|
+
const handler = "next" in observer ? observer.next.bind(observer) : observer;
|
|
1019
1021
|
let complete = false;
|
|
1020
1022
|
createComputed(() => {
|
|
1021
1023
|
if (complete) return;
|
|
@@ -1353,7 +1355,7 @@ function lazy(fn) {
|
|
|
1353
1355
|
let counter = 0;
|
|
1354
1356
|
function createUniqueId() {
|
|
1355
1357
|
const ctx = sharedConfig.context;
|
|
1356
|
-
return ctx ? `${ctx.id}${ctx.count++}` : `cl
|
|
1358
|
+
return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
|
|
1357
1359
|
}
|
|
1358
1360
|
|
|
1359
1361
|
function For(props) {
|
package/dist/dev.js
CHANGED
|
@@ -120,7 +120,7 @@ function setHydrateContext(context) {
|
|
|
120
120
|
}
|
|
121
121
|
function nextHydrateContext() {
|
|
122
122
|
return { ...sharedConfig.context,
|
|
123
|
-
id: `${sharedConfig.context.id}${sharedConfig.context.count++}
|
|
123
|
+
id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,
|
|
124
124
|
count: 0
|
|
125
125
|
};
|
|
126
126
|
}
|
|
@@ -154,14 +154,13 @@ let Effects = null;
|
|
|
154
154
|
let ExecCount = 0;
|
|
155
155
|
let rootCount = 0;
|
|
156
156
|
function createRoot(fn, detachedOwner) {
|
|
157
|
-
detachedOwner && (Owner = detachedOwner);
|
|
158
157
|
const listener = Listener,
|
|
159
158
|
owner = Owner,
|
|
160
159
|
root = fn.length === 0 && !"_SOLID_DEV_" ? UNOWNED : {
|
|
161
160
|
owned: null,
|
|
162
161
|
cleanups: null,
|
|
163
162
|
context: null,
|
|
164
|
-
owner
|
|
163
|
+
owner: detachedOwner || owner
|
|
165
164
|
};
|
|
166
165
|
if (owner) root.name = `${owner.name}-r${rootCount++}`;
|
|
167
166
|
Owner = root;
|
|
@@ -401,7 +400,8 @@ function createSelector(source, fn = equalFn, options) {
|
|
|
401
400
|
let l;
|
|
402
401
|
if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));
|
|
403
402
|
onCleanup(() => {
|
|
404
|
-
l.
|
|
403
|
+
l.delete(listener);
|
|
404
|
+
!l.size && subs.delete(key);
|
|
405
405
|
});
|
|
406
406
|
}
|
|
407
407
|
return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
|
|
@@ -583,7 +583,8 @@ function createContext(defaultValue) {
|
|
|
583
583
|
};
|
|
584
584
|
}
|
|
585
585
|
function useContext(context) {
|
|
586
|
-
|
|
586
|
+
let ctx;
|
|
587
|
+
return (ctx = lookup(Owner, context.id)) !== undefined ? ctx : context.defaultValue;
|
|
587
588
|
}
|
|
588
589
|
function children(fn) {
|
|
589
590
|
const children = createMemo(fn);
|
|
@@ -664,8 +665,10 @@ function writeSignal(node, value, isComp) {
|
|
|
664
665
|
for (let i = 0; i < node.observers.length; i += 1) {
|
|
665
666
|
const o = node.observers[i];
|
|
666
667
|
if (TransitionRunning && Transition.disposed.has(o)) continue;
|
|
667
|
-
if (o.
|
|
668
|
-
|
|
668
|
+
if (TransitionRunning && !o.tState || !TransitionRunning && !o.state) {
|
|
669
|
+
if (o.pure) Updates.push(o);else Effects.push(o);
|
|
670
|
+
if (o.observers) markUpstream(o);
|
|
671
|
+
}
|
|
669
672
|
if (TransitionRunning) o.tState = STALE;else o.state = STALE;
|
|
670
673
|
}
|
|
671
674
|
if (Updates.length > 10e5) {
|
|
@@ -756,8 +759,7 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
756
759
|
}
|
|
757
760
|
function runTop(node) {
|
|
758
761
|
const runningTransition = Transition && Transition.running;
|
|
759
|
-
if (!runningTransition && node.state !== STALE
|
|
760
|
-
if (runningTransition && node.tState !== STALE) return node.tState = 0;
|
|
762
|
+
if (!runningTransition && node.state !== STALE || runningTransition && node.tState !== STALE) return lookDownstream(node);
|
|
761
763
|
if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);
|
|
762
764
|
const ancestors = [node];
|
|
763
765
|
while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
|
|
@@ -950,7 +952,7 @@ function handleError(err) {
|
|
|
950
952
|
fns.forEach(f => f(err));
|
|
951
953
|
}
|
|
952
954
|
function lookup(owner, key) {
|
|
953
|
-
return owner
|
|
955
|
+
return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;
|
|
954
956
|
}
|
|
955
957
|
function resolveChildren(children) {
|
|
956
958
|
if (typeof children === "function" && !children.length) return resolveChildren(children());
|
|
@@ -1011,7 +1013,7 @@ function observable(input) {
|
|
|
1011
1013
|
if (!(observer instanceof Object) || observer == null) {
|
|
1012
1014
|
throw new TypeError("Expected the observer to be an object.");
|
|
1013
1015
|
}
|
|
1014
|
-
const handler = "next" in observer ? observer.next : observer;
|
|
1016
|
+
const handler = "next" in observer ? observer.next.bind(observer) : observer;
|
|
1015
1017
|
let complete = false;
|
|
1016
1018
|
createComputed(() => {
|
|
1017
1019
|
if (complete) return;
|
|
@@ -1349,7 +1351,7 @@ function lazy(fn) {
|
|
|
1349
1351
|
let counter = 0;
|
|
1350
1352
|
function createUniqueId() {
|
|
1351
1353
|
const ctx = sharedConfig.context;
|
|
1352
|
-
return ctx ? `${ctx.id}${ctx.count++}` : `cl
|
|
1354
|
+
return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
|
|
1353
1355
|
}
|
|
1354
1356
|
|
|
1355
1357
|
function For(props) {
|
package/dist/server.cjs
CHANGED
|
@@ -118,7 +118,8 @@ function createContext(defaultValue) {
|
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
function useContext(context) {
|
|
121
|
-
|
|
121
|
+
let ctx;
|
|
122
|
+
return (ctx = lookup(Owner, context.id)) !== undefined ? ctx : context.defaultValue;
|
|
122
123
|
}
|
|
123
124
|
function getOwner() {
|
|
124
125
|
return Owner;
|
|
@@ -136,7 +137,7 @@ function runWithOwner(o, fn) {
|
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
function lookup(owner, key) {
|
|
139
|
-
return owner
|
|
140
|
+
return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;
|
|
140
141
|
}
|
|
141
142
|
function resolveChildren(children) {
|
|
142
143
|
if (typeof children === "function" && !children.length) return resolveChildren(children());
|
|
@@ -231,7 +232,7 @@ function setHydrateContext(context) {
|
|
|
231
232
|
}
|
|
232
233
|
function nextHydrateContext() {
|
|
233
234
|
return sharedConfig.context ? { ...sharedConfig.context,
|
|
234
|
-
id: `${sharedConfig.context.id}${sharedConfig.context.count++}
|
|
235
|
+
id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,
|
|
235
236
|
count: 0
|
|
236
237
|
} : undefined;
|
|
237
238
|
}
|
package/dist/server.js
CHANGED
|
@@ -114,7 +114,8 @@ function createContext(defaultValue) {
|
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
116
|
function useContext(context) {
|
|
117
|
-
|
|
117
|
+
let ctx;
|
|
118
|
+
return (ctx = lookup(Owner, context.id)) !== undefined ? ctx : context.defaultValue;
|
|
118
119
|
}
|
|
119
120
|
function getOwner() {
|
|
120
121
|
return Owner;
|
|
@@ -132,7 +133,7 @@ function runWithOwner(o, fn) {
|
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
function lookup(owner, key) {
|
|
135
|
-
return owner
|
|
136
|
+
return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;
|
|
136
137
|
}
|
|
137
138
|
function resolveChildren(children) {
|
|
138
139
|
if (typeof children === "function" && !children.length) return resolveChildren(children());
|
|
@@ -227,7 +228,7 @@ function setHydrateContext(context) {
|
|
|
227
228
|
}
|
|
228
229
|
function nextHydrateContext() {
|
|
229
230
|
return sharedConfig.context ? { ...sharedConfig.context,
|
|
230
|
-
id: `${sharedConfig.context.id}${sharedConfig.context.count++}
|
|
231
|
+
id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,
|
|
231
232
|
count: 0
|
|
232
233
|
} : undefined;
|
|
233
234
|
}
|
package/dist/solid.cjs
CHANGED
|
@@ -124,7 +124,7 @@ function setHydrateContext(context) {
|
|
|
124
124
|
}
|
|
125
125
|
function nextHydrateContext() {
|
|
126
126
|
return { ...sharedConfig.context,
|
|
127
|
-
id: `${sharedConfig.context.id}${sharedConfig.context.count++}
|
|
127
|
+
id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,
|
|
128
128
|
count: 0
|
|
129
129
|
};
|
|
130
130
|
}
|
|
@@ -157,14 +157,13 @@ let Updates = null;
|
|
|
157
157
|
let Effects = null;
|
|
158
158
|
let ExecCount = 0;
|
|
159
159
|
function createRoot(fn, detachedOwner) {
|
|
160
|
-
detachedOwner && (Owner = detachedOwner);
|
|
161
160
|
const listener = Listener,
|
|
162
161
|
owner = Owner,
|
|
163
162
|
root = fn.length === 0 && !false ? UNOWNED : {
|
|
164
163
|
owned: null,
|
|
165
164
|
cleanups: null,
|
|
166
165
|
context: null,
|
|
167
|
-
owner
|
|
166
|
+
owner: detachedOwner || owner
|
|
168
167
|
};
|
|
169
168
|
Owner = root;
|
|
170
169
|
Listener = null;
|
|
@@ -402,7 +401,8 @@ function createSelector(source, fn = equalFn, options) {
|
|
|
402
401
|
let l;
|
|
403
402
|
if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));
|
|
404
403
|
onCleanup(() => {
|
|
405
|
-
l.
|
|
404
|
+
l.delete(listener);
|
|
405
|
+
!l.size && subs.delete(key);
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
|
|
@@ -531,7 +531,8 @@ function createContext(defaultValue) {
|
|
|
531
531
|
};
|
|
532
532
|
}
|
|
533
533
|
function useContext(context) {
|
|
534
|
-
|
|
534
|
+
let ctx;
|
|
535
|
+
return (ctx = lookup(Owner, context.id)) !== undefined ? ctx : context.defaultValue;
|
|
535
536
|
}
|
|
536
537
|
function children(fn) {
|
|
537
538
|
const children = createMemo(fn);
|
|
@@ -612,8 +613,10 @@ function writeSignal(node, value, isComp) {
|
|
|
612
613
|
for (let i = 0; i < node.observers.length; i += 1) {
|
|
613
614
|
const o = node.observers[i];
|
|
614
615
|
if (TransitionRunning && Transition.disposed.has(o)) continue;
|
|
615
|
-
if (o.
|
|
616
|
-
|
|
616
|
+
if (TransitionRunning && !o.tState || !TransitionRunning && !o.state) {
|
|
617
|
+
if (o.pure) Updates.push(o);else Effects.push(o);
|
|
618
|
+
if (o.observers) markUpstream(o);
|
|
619
|
+
}
|
|
617
620
|
if (TransitionRunning) o.tState = STALE;else o.state = STALE;
|
|
618
621
|
}
|
|
619
622
|
if (Updates.length > 10e5) {
|
|
@@ -703,8 +706,7 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
703
706
|
}
|
|
704
707
|
function runTop(node) {
|
|
705
708
|
const runningTransition = Transition && Transition.running;
|
|
706
|
-
if (!runningTransition && node.state !== STALE
|
|
707
|
-
if (runningTransition && node.tState !== STALE) return node.tState = 0;
|
|
709
|
+
if (!runningTransition && node.state !== STALE || runningTransition && node.tState !== STALE) return lookDownstream(node);
|
|
708
710
|
if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);
|
|
709
711
|
const ancestors = [node];
|
|
710
712
|
while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
|
|
@@ -896,7 +898,7 @@ function handleError(err) {
|
|
|
896
898
|
fns.forEach(f => f(err));
|
|
897
899
|
}
|
|
898
900
|
function lookup(owner, key) {
|
|
899
|
-
return owner
|
|
901
|
+
return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;
|
|
900
902
|
}
|
|
901
903
|
function resolveChildren(children) {
|
|
902
904
|
if (typeof children === "function" && !children.length) return resolveChildren(children());
|
|
@@ -934,7 +936,7 @@ function observable(input) {
|
|
|
934
936
|
if (!(observer instanceof Object) || observer == null) {
|
|
935
937
|
throw new TypeError("Expected the observer to be an object.");
|
|
936
938
|
}
|
|
937
|
-
const handler = "next" in observer ? observer.next : observer;
|
|
939
|
+
const handler = "next" in observer ? observer.next.bind(observer) : observer;
|
|
938
940
|
let complete = false;
|
|
939
941
|
createComputed(() => {
|
|
940
942
|
if (complete) return;
|
|
@@ -1269,7 +1271,7 @@ function lazy(fn) {
|
|
|
1269
1271
|
let counter = 0;
|
|
1270
1272
|
function createUniqueId() {
|
|
1271
1273
|
const ctx = sharedConfig.context;
|
|
1272
|
-
return ctx ? `${ctx.id}${ctx.count++}` : `cl
|
|
1274
|
+
return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
|
|
1273
1275
|
}
|
|
1274
1276
|
|
|
1275
1277
|
function For(props) {
|
package/dist/solid.js
CHANGED
|
@@ -120,7 +120,7 @@ function setHydrateContext(context) {
|
|
|
120
120
|
}
|
|
121
121
|
function nextHydrateContext() {
|
|
122
122
|
return { ...sharedConfig.context,
|
|
123
|
-
id: `${sharedConfig.context.id}${sharedConfig.context.count++}
|
|
123
|
+
id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,
|
|
124
124
|
count: 0
|
|
125
125
|
};
|
|
126
126
|
}
|
|
@@ -153,14 +153,13 @@ let Updates = null;
|
|
|
153
153
|
let Effects = null;
|
|
154
154
|
let ExecCount = 0;
|
|
155
155
|
function createRoot(fn, detachedOwner) {
|
|
156
|
-
detachedOwner && (Owner = detachedOwner);
|
|
157
156
|
const listener = Listener,
|
|
158
157
|
owner = Owner,
|
|
159
158
|
root = fn.length === 0 && !false ? UNOWNED : {
|
|
160
159
|
owned: null,
|
|
161
160
|
cleanups: null,
|
|
162
161
|
context: null,
|
|
163
|
-
owner
|
|
162
|
+
owner: detachedOwner || owner
|
|
164
163
|
};
|
|
165
164
|
Owner = root;
|
|
166
165
|
Listener = null;
|
|
@@ -398,7 +397,8 @@ function createSelector(source, fn = equalFn, options) {
|
|
|
398
397
|
let l;
|
|
399
398
|
if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));
|
|
400
399
|
onCleanup(() => {
|
|
401
|
-
l.
|
|
400
|
+
l.delete(listener);
|
|
401
|
+
!l.size && subs.delete(key);
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
404
|
return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
|
|
@@ -527,7 +527,8 @@ function createContext(defaultValue) {
|
|
|
527
527
|
};
|
|
528
528
|
}
|
|
529
529
|
function useContext(context) {
|
|
530
|
-
|
|
530
|
+
let ctx;
|
|
531
|
+
return (ctx = lookup(Owner, context.id)) !== undefined ? ctx : context.defaultValue;
|
|
531
532
|
}
|
|
532
533
|
function children(fn) {
|
|
533
534
|
const children = createMemo(fn);
|
|
@@ -608,8 +609,10 @@ function writeSignal(node, value, isComp) {
|
|
|
608
609
|
for (let i = 0; i < node.observers.length; i += 1) {
|
|
609
610
|
const o = node.observers[i];
|
|
610
611
|
if (TransitionRunning && Transition.disposed.has(o)) continue;
|
|
611
|
-
if (o.
|
|
612
|
-
|
|
612
|
+
if (TransitionRunning && !o.tState || !TransitionRunning && !o.state) {
|
|
613
|
+
if (o.pure) Updates.push(o);else Effects.push(o);
|
|
614
|
+
if (o.observers) markUpstream(o);
|
|
615
|
+
}
|
|
613
616
|
if (TransitionRunning) o.tState = STALE;else o.state = STALE;
|
|
614
617
|
}
|
|
615
618
|
if (Updates.length > 10e5) {
|
|
@@ -699,8 +702,7 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
699
702
|
}
|
|
700
703
|
function runTop(node) {
|
|
701
704
|
const runningTransition = Transition && Transition.running;
|
|
702
|
-
if (!runningTransition && node.state !== STALE
|
|
703
|
-
if (runningTransition && node.tState !== STALE) return node.tState = 0;
|
|
705
|
+
if (!runningTransition && node.state !== STALE || runningTransition && node.tState !== STALE) return lookDownstream(node);
|
|
704
706
|
if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);
|
|
705
707
|
const ancestors = [node];
|
|
706
708
|
while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
|
|
@@ -892,7 +894,7 @@ function handleError(err) {
|
|
|
892
894
|
fns.forEach(f => f(err));
|
|
893
895
|
}
|
|
894
896
|
function lookup(owner, key) {
|
|
895
|
-
return owner
|
|
897
|
+
return owner ? owner.context && owner.context[key] !== undefined ? owner.context[key] : lookup(owner.owner, key) : undefined;
|
|
896
898
|
}
|
|
897
899
|
function resolveChildren(children) {
|
|
898
900
|
if (typeof children === "function" && !children.length) return resolveChildren(children());
|
|
@@ -930,7 +932,7 @@ function observable(input) {
|
|
|
930
932
|
if (!(observer instanceof Object) || observer == null) {
|
|
931
933
|
throw new TypeError("Expected the observer to be an object.");
|
|
932
934
|
}
|
|
933
|
-
const handler = "next" in observer ? observer.next : observer;
|
|
935
|
+
const handler = "next" in observer ? observer.next.bind(observer) : observer;
|
|
934
936
|
let complete = false;
|
|
935
937
|
createComputed(() => {
|
|
936
938
|
if (complete) return;
|
|
@@ -1265,7 +1267,7 @@ function lazy(fn) {
|
|
|
1265
1267
|
let counter = 0;
|
|
1266
1268
|
function createUniqueId() {
|
|
1267
1269
|
const ctx = sharedConfig.context;
|
|
1268
|
-
return ctx ? `${ctx.id}${ctx.count++}` : `cl
|
|
1270
|
+
return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;
|
|
1269
1271
|
}
|
|
1270
1272
|
|
|
1271
1273
|
function For(props) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-js",
|
|
3
3
|
"description": "A declarative JavaScript library for building user interfaces.",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.10",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -144,5 +144,5 @@
|
|
|
144
144
|
"compiler",
|
|
145
145
|
"performance"
|
|
146
146
|
],
|
|
147
|
-
"gitHead": "
|
|
147
|
+
"gitHead": "95969d0b67dbad306f7b18736d88356d5e678532"
|
|
148
148
|
}
|
package/store/dist/dev.cjs
CHANGED
|
@@ -215,7 +215,7 @@ const proxyTraps = {
|
|
|
215
215
|
node = nodes[property] || (nodes[property] = createDataNode());
|
|
216
216
|
node();
|
|
217
217
|
}
|
|
218
|
-
return wrappable ? wrap(value, target[$NAME] && `${target[$NAME]}:${property}`) : value;
|
|
218
|
+
return wrappable ? wrap(value, target[$NAME] && `${target[$NAME]}:${property.toString()}`) : value;
|
|
219
219
|
},
|
|
220
220
|
set(target, property, value) {
|
|
221
221
|
setProperty(target, property, unwrap(value));
|
package/store/dist/dev.js
CHANGED
|
@@ -211,7 +211,7 @@ const proxyTraps = {
|
|
|
211
211
|
node = nodes[property] || (nodes[property] = createDataNode());
|
|
212
212
|
node();
|
|
213
213
|
}
|
|
214
|
-
return wrappable ? wrap(value, target[$NAME] && `${target[$NAME]}:${property}`) : value;
|
|
214
|
+
return wrappable ? wrap(value, target[$NAME] && `${target[$NAME]}:${property.toString()}`) : value;
|
|
215
215
|
},
|
|
216
216
|
set(target, property, value) {
|
|
217
217
|
setProperty(target, property, unwrap(value));
|
package/store/dist/server.cjs
CHANGED
|
@@ -77,7 +77,7 @@ function createMutable(state) {
|
|
|
77
77
|
}
|
|
78
78
|
function reconcile(value, options = {}) {
|
|
79
79
|
return state => {
|
|
80
|
-
if (!isWrappable(state)) return value;
|
|
80
|
+
if (!isWrappable(state) || !isWrappable(value)) return value;
|
|
81
81
|
const targetKeys = Object.keys(value);
|
|
82
82
|
for (let i = 0, len = targetKeys.length; i < len; i++) {
|
|
83
83
|
const key = targetKeys[i];
|
|
@@ -87,6 +87,7 @@ function reconcile(value, options = {}) {
|
|
|
87
87
|
for (let i = 0, len = previousKeys.length; i < len; i++) {
|
|
88
88
|
if (value[previousKeys[i]] === undefined) setProperty(state, previousKeys[i], undefined);
|
|
89
89
|
}
|
|
90
|
+
return state;
|
|
90
91
|
};
|
|
91
92
|
}
|
|
92
93
|
function produce(fn) {
|
package/store/dist/server.js
CHANGED
|
@@ -73,7 +73,7 @@ function createMutable(state) {
|
|
|
73
73
|
}
|
|
74
74
|
function reconcile(value, options = {}) {
|
|
75
75
|
return state => {
|
|
76
|
-
if (!isWrappable(state)) return value;
|
|
76
|
+
if (!isWrappable(state) || !isWrappable(value)) return value;
|
|
77
77
|
const targetKeys = Object.keys(value);
|
|
78
78
|
for (let i = 0, len = targetKeys.length; i < len; i++) {
|
|
79
79
|
const key = targetKeys[i];
|
|
@@ -83,6 +83,7 @@ function reconcile(value, options = {}) {
|
|
|
83
83
|
for (let i = 0, len = previousKeys.length; i < len; i++) {
|
|
84
84
|
if (value[previousKeys[i]] === undefined) setProperty(state, previousKeys[i], undefined);
|
|
85
85
|
}
|
|
86
|
+
return state;
|
|
86
87
|
};
|
|
87
88
|
}
|
|
88
89
|
function produce(fn) {
|
package/store/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { createStore, unwrap, $RAW } from "./store";
|
|
2
|
-
export type { Store, SetStoreFunction, NotWrappable, StoreNode, StoreSetter, StorePathRange, ArrayFilterFn, Part,
|
|
2
|
+
export type { Store, SetStoreFunction, NotWrappable, StoreNode, StoreSetter, StorePathRange, ArrayFilterFn, Part, DeepReadonly, DeepMutable } from "./store";
|
|
3
3
|
export * from "./mutable";
|
|
4
4
|
export * from "./modifiers";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DeepMutable, NotWrappable } from "./store";
|
|
2
2
|
export declare type ReconcileOptions = {
|
|
3
3
|
key?: string | null;
|
|
4
4
|
merge?: boolean;
|
|
5
5
|
};
|
|
6
|
-
export declare function reconcile<T>(value: T, options?: ReconcileOptions): (state:
|
|
7
|
-
export declare function produce<T>(fn: (state: T) => void): (state:
|
|
6
|
+
export declare function reconcile<T extends U, U>(value: T, options?: ReconcileOptions): (state: U) => T;
|
|
7
|
+
export declare function produce<T>(fn: (state: DeepMutable<Exclude<T, NotWrappable>>) => void): (state: T) => T;
|
package/store/types/server.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { SetStoreFunction, Store } from "store";
|
|
1
|
+
import type { DeepMutable, SetStoreFunction, Store } from "store";
|
|
2
2
|
export declare const $RAW: unique symbol;
|
|
3
3
|
export declare function isWrappable(obj: any): boolean;
|
|
4
4
|
export declare function unwrap<T>(item: any): T;
|
|
5
|
-
export declare function setProperty(state: any, property:
|
|
6
|
-
export declare function updatePath(current: any, path: any[], traversed?:
|
|
5
|
+
export declare function setProperty(state: any, property: PropertyKey, value: any, force?: boolean): void;
|
|
6
|
+
export declare function updatePath(current: any, path: any[], traversed?: PropertyKey[]): void;
|
|
7
7
|
export declare function createStore<T>(state: T | Store<T>): [Store<T>, SetStoreFunction<T>];
|
|
8
|
-
export declare function createMutable<T>(state: T | Store<T>):
|
|
8
|
+
export declare function createMutable<T>(state: T | Store<T>): T;
|
|
9
9
|
declare type ReconcileOptions = {
|
|
10
10
|
key?: string | null;
|
|
11
11
|
merge?: boolean;
|
|
12
12
|
};
|
|
13
|
-
export declare function reconcile<T>(value: T
|
|
14
|
-
export declare function produce<T>(fn: (state: T) => void): (state:
|
|
13
|
+
export declare function reconcile<T extends U, U>(value: T, options?: ReconcileOptions): (state: U) => T;
|
|
14
|
+
export declare function produce<T>(fn: (state: DeepMutable<T>) => void): (state: T) => T;
|
|
15
15
|
export {};
|
package/store/types/store.d.ts
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
import { Accessor } from "../..";
|
|
2
2
|
export declare const $RAW: unique symbol, $NODE: unique symbol, $NAME: unique symbol;
|
|
3
|
-
export declare type StoreNode = Record<
|
|
3
|
+
export declare type StoreNode = Record<PropertyKey, any>;
|
|
4
4
|
export declare type NotWrappable = string | number | bigint | symbol | boolean | Function | null | undefined;
|
|
5
5
|
export declare type Store<T> = DeepReadonly<T>;
|
|
6
6
|
export declare function isWrappable(obj: any): any;
|
|
7
7
|
export declare function unwrap<T extends StoreNode>(item: any, set?: Set<unknown>): T;
|
|
8
8
|
export declare function getDataNodes(target: StoreNode): any;
|
|
9
|
-
export declare function proxyDescriptor(target: StoreNode, property:
|
|
9
|
+
export declare function proxyDescriptor(target: StoreNode, property: PropertyKey): PropertyDescriptor | undefined;
|
|
10
10
|
export declare function ownKeys(target: StoreNode): (string | symbol)[];
|
|
11
11
|
export declare function createDataNode(): Accessor<void> & {
|
|
12
12
|
$: () => void;
|
|
13
13
|
};
|
|
14
|
-
export declare function setProperty(state: StoreNode, property:
|
|
15
|
-
export declare function updatePath(current: StoreNode, path: any[], traversed?:
|
|
16
|
-
export declare type DeepReadonly<T> = {
|
|
14
|
+
export declare function setProperty(state: StoreNode, property: PropertyKey, value: any): void;
|
|
15
|
+
export declare function updatePath(current: StoreNode, path: any[], traversed?: PropertyKey[]): void;
|
|
16
|
+
export declare type DeepReadonly<T> = 0 extends 1 & T ? T : {
|
|
17
17
|
readonly [K in keyof T]: T[K] extends NotWrappable ? T[K] : DeepReadonly<T[K]>;
|
|
18
18
|
};
|
|
19
|
-
export declare type
|
|
19
|
+
export declare type DeepMutable<T> = 0 extends 1 & T ? T : {
|
|
20
|
+
-readonly [K in keyof T]: T[K] extends NotWrappable ? T[K] : DeepMutable<T[K]>;
|
|
21
|
+
};
|
|
20
22
|
export declare type StorePathRange = {
|
|
21
23
|
from?: number;
|
|
22
24
|
to?: number;
|
|
23
25
|
by?: number;
|
|
24
26
|
};
|
|
25
|
-
export declare type ArrayFilterFn<T> = (item: T
|
|
26
|
-
export declare type
|
|
27
|
-
export declare type
|
|
28
|
-
|
|
29
|
-
declare type
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
interface
|
|
33
|
-
<K1 extends
|
|
34
|
-
<K1 extends
|
|
35
|
-
<K1 extends
|
|
36
|
-
<K1 extends
|
|
37
|
-
<K1 extends
|
|
38
|
-
<K1 extends
|
|
39
|
-
<K1 extends
|
|
40
|
-
|
|
41
|
-
(setter: StoreSetter<T>): void;
|
|
27
|
+
export declare type ArrayFilterFn<T> = (item: DeepReadonly<T>, index: number) => boolean;
|
|
28
|
+
export declare type StoreSetter<T, U extends PropertyKey[] = []> = ((prevState: DeepReadonly<T>, traversed: U) => DeepReadonly<T> | Partial<DeepReadonly<T>> | void) | DeepReadonly<T> | Partial<DeepReadonly<T>>;
|
|
29
|
+
export declare type Part<T, K extends KeyOf<T> = KeyOf<T>> = [K] extends [never] ? never : K | readonly K[] | (number extends K ? ArrayFilterFn<T[number]> | StorePathRange : never);
|
|
30
|
+
declare type W<T> = Exclude<T, NotWrappable>;
|
|
31
|
+
declare type KeyOf<T> = number extends keyof T ? 0 extends 1 & T ? keyof T : [T] extends [never] ? never : number : keyof T;
|
|
32
|
+
declare type Rest<T, U extends PropertyKey[]> = [StoreSetter<T, U>] | (0 extends 1 & T ? [...Part<any>[], StoreSetter<any, PropertyKey[]>] : DistributeRest<W<T>, KeyOf<W<T>>, U>);
|
|
33
|
+
declare type DistributeRest<T, K, U extends PropertyKey[]> = [T] extends [never] ? never : K extends KeyOf<T> ? [Part<T, K>, ...Rest<T[K], [K, ...U]>] : never;
|
|
34
|
+
export interface SetStoreFunction<T> {
|
|
35
|
+
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>, K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>, K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>, K7 extends KeyOf<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>, k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>, k7: Part<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>, K7>, ...rest: Rest<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7], [K7, K6, K5, K4, K3, K2, K1]>): void;
|
|
36
|
+
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>, K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>, K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>, k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>, setter: StoreSetter<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6], [K6, K5, K4, K3, K2, K1]>): void;
|
|
37
|
+
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>, K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>, setter: StoreSetter<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5], [K5, K4, K3, K2, K1]>): void;
|
|
38
|
+
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, setter: StoreSetter<W<W<W<W<T>[K1]>[K2]>[K3]>[K4], [K4, K3, K2, K1]>): void;
|
|
39
|
+
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, setter: StoreSetter<W<W<W<T>[K1]>[K2]>[K3], [K3, K2, K1]>): void;
|
|
40
|
+
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, setter: StoreSetter<W<W<T>[K1]>[K2], [K2, K1]>): void;
|
|
41
|
+
<K1 extends KeyOf<W<T>>>(k1: Part<W<T>, K1>, setter: StoreSetter<W<T>[K1], [K1]>): void;
|
|
42
|
+
(setter: StoreSetter<T, []>): void;
|
|
42
43
|
}
|
|
43
44
|
/**
|
|
44
45
|
* creates a reactive store that can be read through a proxy object and written with a setter function
|
|
@@ -437,6 +437,8 @@ export declare function createContext<T>(defaultValue: T): Context<T>;
|
|
|
437
437
|
* @description https://www.solidjs.com/docs/latest/api#usecontext
|
|
438
438
|
*/
|
|
439
439
|
export declare function useContext<T>(context: Context<T>): T;
|
|
440
|
+
export declare type ResolvedJSXElement = Exclude<JSX.Element, JSX.ArrayElement | JSX.FunctionElement>;
|
|
441
|
+
export declare type ResolvedChildren = ResolvedJSXElement | ResolvedJSXElement[];
|
|
440
442
|
/**
|
|
441
443
|
* Resolves child elements to help interact with children
|
|
442
444
|
*
|
|
@@ -445,7 +447,7 @@ export declare function useContext<T>(context: Context<T>): T;
|
|
|
445
447
|
*
|
|
446
448
|
* @description https://www.solidjs.com/docs/latest/api#children
|
|
447
449
|
*/
|
|
448
|
-
export declare function children(fn: Accessor<JSX.Element>): Accessor<
|
|
450
|
+
export declare function children(fn: Accessor<JSX.Element>): Accessor<ResolvedChildren>;
|
|
449
451
|
export declare type SuspenseContextType = {
|
|
450
452
|
increment?: () => void;
|
|
451
453
|
decrement?: () => void;
|
package/web/dist/dev.cjs
CHANGED
|
@@ -385,11 +385,10 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
385
385
|
solidJs.createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
|
|
386
386
|
return () => current;
|
|
387
387
|
}
|
|
388
|
-
if (solidJs.sharedConfig.context
|
|
388
|
+
if (solidJs.sharedConfig.context) {
|
|
389
389
|
for (let i = 0; i < array.length; i++) {
|
|
390
390
|
if (array[i].parentNode) return current = array;
|
|
391
391
|
}
|
|
392
|
-
return current;
|
|
393
392
|
}
|
|
394
393
|
if (array.length === 0) {
|
|
395
394
|
current = cleanChildren(parent, current, marker);
|
|
@@ -404,7 +403,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
404
403
|
}
|
|
405
404
|
current = array;
|
|
406
405
|
} else if (value instanceof Node) {
|
|
407
|
-
if (solidJs.sharedConfig.context) return current =
|
|
406
|
+
if (solidJs.sharedConfig.context && value.parentNode) return current = multi ? [value] : value;
|
|
408
407
|
if (Array.isArray(current)) {
|
|
409
408
|
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
410
409
|
cleanChildren(parent, current, null, value);
|
package/web/dist/dev.js
CHANGED
|
@@ -382,11 +382,10 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
382
382
|
createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
|
|
383
383
|
return () => current;
|
|
384
384
|
}
|
|
385
|
-
if (sharedConfig.context
|
|
385
|
+
if (sharedConfig.context) {
|
|
386
386
|
for (let i = 0; i < array.length; i++) {
|
|
387
387
|
if (array[i].parentNode) return current = array;
|
|
388
388
|
}
|
|
389
|
-
return current;
|
|
390
389
|
}
|
|
391
390
|
if (array.length === 0) {
|
|
392
391
|
current = cleanChildren(parent, current, marker);
|
|
@@ -401,7 +400,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
401
400
|
}
|
|
402
401
|
current = array;
|
|
403
402
|
} else if (value instanceof Node) {
|
|
404
|
-
if (sharedConfig.context) return current =
|
|
403
|
+
if (sharedConfig.context && value.parentNode) return current = multi ? [value] : value;
|
|
405
404
|
if (Array.isArray(current)) {
|
|
406
405
|
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
407
406
|
cleanChildren(parent, current, null, value);
|
package/web/dist/web.cjs
CHANGED
|
@@ -384,11 +384,10 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
384
384
|
solidJs.createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
|
|
385
385
|
return () => current;
|
|
386
386
|
}
|
|
387
|
-
if (solidJs.sharedConfig.context
|
|
387
|
+
if (solidJs.sharedConfig.context) {
|
|
388
388
|
for (let i = 0; i < array.length; i++) {
|
|
389
389
|
if (array[i].parentNode) return current = array;
|
|
390
390
|
}
|
|
391
|
-
return current;
|
|
392
391
|
}
|
|
393
392
|
if (array.length === 0) {
|
|
394
393
|
current = cleanChildren(parent, current, marker);
|
|
@@ -403,7 +402,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
403
402
|
}
|
|
404
403
|
current = array;
|
|
405
404
|
} else if (value instanceof Node) {
|
|
406
|
-
if (solidJs.sharedConfig.context) return current =
|
|
405
|
+
if (solidJs.sharedConfig.context && value.parentNode) return current = multi ? [value] : value;
|
|
407
406
|
if (Array.isArray(current)) {
|
|
408
407
|
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
409
408
|
cleanChildren(parent, current, null, value);
|
package/web/dist/web.js
CHANGED
|
@@ -381,11 +381,10 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
381
381
|
createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
|
|
382
382
|
return () => current;
|
|
383
383
|
}
|
|
384
|
-
if (sharedConfig.context
|
|
384
|
+
if (sharedConfig.context) {
|
|
385
385
|
for (let i = 0; i < array.length; i++) {
|
|
386
386
|
if (array[i].parentNode) return current = array;
|
|
387
387
|
}
|
|
388
|
-
return current;
|
|
389
388
|
}
|
|
390
389
|
if (array.length === 0) {
|
|
391
390
|
current = cleanChildren(parent, current, marker);
|
|
@@ -400,7 +399,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
400
399
|
}
|
|
401
400
|
current = array;
|
|
402
401
|
} else if (value instanceof Node) {
|
|
403
|
-
if (sharedConfig.context) return current =
|
|
402
|
+
if (sharedConfig.context && value.parentNode) return current = multi ? [value] : value;
|
|
404
403
|
if (Array.isArray(current)) {
|
|
405
404
|
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
406
405
|
cleanChildren(parent, current, null, value);
|