@tanstack/query-devtools 5.0.0 → 5.0.3

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.
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.pnpm/solid-js@1.7.8/node_modules/solid-js/dist/solid.js
1
+ // ../../node_modules/.pnpm/solid-js@1.8.1/node_modules/solid-js/dist/solid.js
2
2
  var sharedConfig = {
3
3
  context: void 0,
4
4
  registry: void 0
@@ -16,7 +16,6 @@ function nextHydrateContext() {
16
16
  var equalFn = (a, b) => a === b;
17
17
  var $PROXY = Symbol("solid-proxy");
18
18
  var $TRACK = Symbol("solid-track");
19
- var $DEVCOMP = Symbol("solid-dev-component");
20
19
  var signalOptions = {
21
20
  equals: equalFn
22
21
  };
@@ -41,11 +40,11 @@ var Effects = null;
41
40
  var ExecCount = 0;
42
41
  var [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
43
42
  function createRoot(fn, detachedOwner) {
44
- const listener = Listener, owner = Owner, unowned = fn.length === 0, root = unowned ? UNOWNED : {
43
+ const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {
45
44
  owned: null,
46
45
  cleanups: null,
47
- context: null,
48
- owner: detachedOwner === void 0 ? owner : detachedOwner
46
+ context: current ? current.context : null,
47
+ owner: current
49
48
  }, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));
50
49
  Owner = root;
51
50
  Listener = null;
@@ -91,7 +90,7 @@ function createRenderEffect(fn, value, options) {
91
90
  }
92
91
  function createEffect(fn, value, options) {
93
92
  runEffects = runUserEffects;
94
- const c = createComputation(fn, value, false, STALE), s = SuspenseContext && lookup(Owner, SuspenseContext.id);
93
+ const c = createComputation(fn, value, false, STALE), s = SuspenseContext && useContext(SuspenseContext);
95
94
  if (s)
96
95
  c.suspense = s;
97
96
  if (!options || !options.render)
@@ -111,6 +110,9 @@ function createMemo(fn, value, options) {
111
110
  updateComputation(c);
112
111
  return readSignal.bind(c);
113
112
  }
113
+ function isPromise(v) {
114
+ return v && typeof v === "object" && "then" in v;
115
+ }
114
116
  function createResource(pSource, pFetcher, pOptions) {
115
117
  let source;
116
118
  let fetcher;
@@ -134,16 +136,18 @@ function createResource(pSource, pFetcher, pOptions) {
134
136
  if (options.ssrLoadFrom === "initial")
135
137
  initP = options.initialValue;
136
138
  else if (sharedConfig.load && (v = sharedConfig.load(id)))
137
- initP = v[0];
139
+ initP = isPromise(v) && "value" in v ? v.value : v;
138
140
  }
139
141
  function loadEnd(p, v, error2, key) {
140
142
  if (pr === p) {
141
143
  pr = null;
142
144
  key !== void 0 && (resolved = true);
143
145
  if ((p === initP || v === initP) && options.onHydrated)
144
- queueMicrotask(() => options.onHydrated(key, {
145
- value: v
146
- }));
146
+ queueMicrotask(
147
+ () => options.onHydrated(key, {
148
+ value: v
149
+ })
150
+ );
147
151
  initP = NO_INIT;
148
152
  if (Transition && p && loadedUnderTransition) {
149
153
  Transition.promises.delete(p);
@@ -169,7 +173,7 @@ function createResource(pSource, pFetcher, pOptions) {
169
173
  }, false);
170
174
  }
171
175
  function read() {
172
- const c = SuspenseContext && lookup(Owner, SuspenseContext.id), v = value(), err = error();
176
+ const c = SuspenseContext && useContext(SuspenseContext), v = value(), err = error();
173
177
  if (err !== void 0 && !pr)
174
178
  throw err;
175
179
  if (Listener && !Listener.user && c) {
@@ -191,20 +195,22 @@ function createResource(pSource, pFetcher, pOptions) {
191
195
  if (refetching !== false && scheduled)
192
196
  return;
193
197
  scheduled = false;
194
- const lookup2 = dynamic ? dynamic() : source;
198
+ const lookup = dynamic ? dynamic() : source;
195
199
  loadedUnderTransition = Transition && Transition.running;
196
- if (lookup2 == null || lookup2 === false) {
200
+ if (lookup == null || lookup === false) {
197
201
  loadEnd(pr, untrack(value));
198
202
  return;
199
203
  }
200
204
  if (Transition && pr)
201
205
  Transition.promises.delete(pr);
202
- const p = initP !== NO_INIT ? initP : untrack(() => fetcher(lookup2, {
203
- value: value(),
204
- refetching
205
- }));
206
- if (typeof p !== "object" || !(p && "then" in p)) {
207
- loadEnd(pr, p, void 0, lookup2);
206
+ const p = initP !== NO_INIT ? initP : untrack(
207
+ () => fetcher(lookup, {
208
+ value: value(),
209
+ refetching
210
+ })
211
+ );
212
+ if (!isPromise(p)) {
213
+ loadEnd(pr, p, void 0, lookup);
208
214
  return p;
209
215
  }
210
216
  pr = p;
@@ -214,7 +220,10 @@ function createResource(pSource, pFetcher, pOptions) {
214
220
  setState(resolved ? "refreshing" : "pending");
215
221
  trigger();
216
222
  }, false);
217
- return p.then((v) => loadEnd(p, v, void 0, lookup2), (e) => loadEnd(p, void 0, castError(e), lookup2));
223
+ return p.then(
224
+ (v) => loadEnd(p, v, void 0, lookup),
225
+ (e) => loadEnd(p, void 0, castError(e), lookup)
226
+ );
218
227
  }
219
228
  Object.defineProperties(read, {
220
229
  state: {
@@ -244,10 +253,13 @@ function createResource(pSource, pFetcher, pOptions) {
244
253
  createComputed(() => load(false));
245
254
  else
246
255
  load(false);
247
- return [read, {
248
- refetch: load,
249
- mutate: setValue
250
- }];
256
+ return [
257
+ read,
258
+ {
259
+ refetch: load,
260
+ mutate: setValue
261
+ }
262
+ ];
251
263
  }
252
264
  function batch(fn) {
253
265
  return runUpdates(fn, false);
@@ -356,8 +368,7 @@ function createContext(defaultValue, options) {
356
368
  };
357
369
  }
358
370
  function useContext(context) {
359
- let ctx;
360
- return (ctx = lookup(Owner, context.id)) !== void 0 ? ctx : context.defaultValue;
371
+ return Owner && Owner.context && Owner.context[context.id] !== void 0 ? Owner.context[context.id] : context.defaultValue;
361
372
  }
362
373
  function children(fn) {
363
374
  const children2 = createMemo(fn);
@@ -452,7 +463,11 @@ function updateComputation(node) {
452
463
  cleanNode(node);
453
464
  const owner = Owner, listener = Listener, time = ExecCount;
454
465
  Listener = Owner = node;
455
- runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
466
+ runComputation(
467
+ node,
468
+ Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
469
+ time
470
+ );
456
471
  if (Transition && !Transition.running && Transition.sources.has(node)) {
457
472
  queueMicrotask(() => {
458
473
  runUpdates(() => {
@@ -507,7 +522,7 @@ function createComputation(fn, init, pure, state = STALE, options) {
507
522
  cleanups: null,
508
523
  value: init,
509
524
  owner: Owner,
510
- context: null,
525
+ context: Owner ? Owner.context : null,
511
526
  pure
512
527
  };
513
528
  if (Transition && Transition.running) {
@@ -770,7 +785,6 @@ function cleanNode(node) {
770
785
  node.tState = 0;
771
786
  else
772
787
  node.state = 0;
773
- node.context = null;
774
788
  }
775
789
  function reset(node, top) {
776
790
  if (!top) {
@@ -798,7 +812,7 @@ function runErrors(err, fns, owner) {
798
812
  }
799
813
  }
800
814
  function handleError(err, owner = Owner) {
801
- const fns = ERROR && lookup(owner, ERROR);
815
+ const fns = ERROR && owner && owner.context && owner.context[ERROR];
802
816
  const error = castError(err);
803
817
  if (!fns)
804
818
  throw error;
@@ -812,9 +826,6 @@ function handleError(err, owner = Owner) {
812
826
  else
813
827
  runErrors(error, fns, owner);
814
828
  }
815
- function lookup(owner, key) {
816
- return owner ? owner.context && owner.context[key] !== void 0 ? owner.context[key] : lookup(owner.owner, key) : void 0;
817
- }
818
829
  function resolveChildren(children2) {
819
830
  if (typeof children2 === "function" && !children2.length)
820
831
  return resolveChildren(children2());
@@ -831,12 +842,16 @@ function resolveChildren(children2) {
831
842
  function createProvider(id, options) {
832
843
  return function provider(props) {
833
844
  let res;
834
- createRenderEffect(() => res = untrack(() => {
835
- Owner.context = {
836
- [id]: props.value
837
- };
838
- return children(() => props.children);
839
- }), void 0);
845
+ createRenderEffect(
846
+ () => res = untrack(() => {
847
+ Owner.context = {
848
+ ...Owner.context,
849
+ [id]: props.value
850
+ };
851
+ return children(() => props.children);
852
+ }),
853
+ void 0
854
+ );
840
855
  return res;
841
856
  };
842
857
  }
@@ -1052,28 +1067,31 @@ function mergeProps(...sources) {
1052
1067
  sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
1053
1068
  }
1054
1069
  if (proxy) {
1055
- return new Proxy({
1056
- get(property) {
1057
- for (let i = sources.length - 1; i >= 0; i--) {
1058
- const v = resolveSource(sources[i])[property];
1059
- if (v !== void 0)
1060
- return v;
1061
- }
1062
- },
1063
- has(property) {
1064
- for (let i = sources.length - 1; i >= 0; i--) {
1065
- if (property in resolveSource(sources[i]))
1066
- return true;
1070
+ return new Proxy(
1071
+ {
1072
+ get(property) {
1073
+ for (let i = sources.length - 1; i >= 0; i--) {
1074
+ const v = resolveSource(sources[i])[property];
1075
+ if (v !== void 0)
1076
+ return v;
1077
+ }
1078
+ },
1079
+ has(property) {
1080
+ for (let i = sources.length - 1; i >= 0; i--) {
1081
+ if (property in resolveSource(sources[i]))
1082
+ return true;
1083
+ }
1084
+ return false;
1085
+ },
1086
+ keys() {
1087
+ const keys = [];
1088
+ for (let i = 0; i < sources.length; i++)
1089
+ keys.push(...Object.keys(resolveSource(sources[i])));
1090
+ return [...new Set(keys)];
1067
1091
  }
1068
- return false;
1069
1092
  },
1070
- keys() {
1071
- const keys = [];
1072
- for (let i = 0; i < sources.length; i++)
1073
- keys.push(...Object.keys(resolveSource(sources[i])));
1074
- return [...new Set(keys)];
1075
- }
1076
- }, propTraps);
1093
+ propTraps
1094
+ );
1077
1095
  }
1078
1096
  const target = {};
1079
1097
  const sourcesMap = {};
@@ -1120,29 +1138,37 @@ function splitProps(props, ...keys) {
1120
1138
  if ($PROXY in props) {
1121
1139
  const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);
1122
1140
  const res = keys.map((k) => {
1123
- return new Proxy({
1124
- get(property) {
1125
- return k.includes(property) ? props[property] : void 0;
1126
- },
1127
- has(property) {
1128
- return k.includes(property) && property in props;
1141
+ return new Proxy(
1142
+ {
1143
+ get(property) {
1144
+ return k.includes(property) ? props[property] : void 0;
1145
+ },
1146
+ has(property) {
1147
+ return k.includes(property) && property in props;
1148
+ },
1149
+ keys() {
1150
+ return k.filter((property) => property in props);
1151
+ }
1129
1152
  },
1130
- keys() {
1131
- return k.filter((property) => property in props);
1132
- }
1133
- }, propTraps);
1153
+ propTraps
1154
+ );
1134
1155
  });
1135
- res.push(new Proxy({
1136
- get(property) {
1137
- return blocked.has(property) ? void 0 : props[property];
1138
- },
1139
- has(property) {
1140
- return blocked.has(property) ? false : property in props;
1141
- },
1142
- keys() {
1143
- return Object.keys(props).filter((k) => !blocked.has(k));
1144
- }
1145
- }, propTraps));
1156
+ res.push(
1157
+ new Proxy(
1158
+ {
1159
+ get(property) {
1160
+ return blocked.has(property) ? void 0 : props[property];
1161
+ },
1162
+ has(property) {
1163
+ return blocked.has(property) ? false : property in props;
1164
+ },
1165
+ keys() {
1166
+ return Object.keys(props).filter((k) => !blocked.has(k));
1167
+ }
1168
+ },
1169
+ propTraps
1170
+ )
1171
+ );
1146
1172
  return res;
1147
1173
  }
1148
1174
  const otherObject = {};
@@ -1186,17 +1212,19 @@ function lazy(fn) {
1186
1212
  comp = s;
1187
1213
  }
1188
1214
  let Comp;
1189
- return createMemo(() => (Comp = comp()) && untrack(() => {
1190
- if (false)
1191
- ;
1192
- if (!ctx)
1193
- return Comp(props);
1194
- const c = sharedConfig.context;
1195
- setHydrateContext(ctx);
1196
- const r = Comp(props);
1197
- setHydrateContext(c);
1198
- return r;
1199
- }));
1215
+ return createMemo(
1216
+ () => (Comp = comp()) && untrack(() => {
1217
+ if (false)
1218
+ ;
1219
+ if (!ctx)
1220
+ return Comp(props);
1221
+ const c = sharedConfig.context;
1222
+ setHydrateContext(ctx);
1223
+ const r = Comp(props);
1224
+ setHydrateContext(c);
1225
+ return r;
1226
+ })
1227
+ );
1200
1228
  };
1201
1229
  wrap.preload = () => p || ((p = fn()).then((mod) => comp = () => mod.default), p);
1202
1230
  return wrap;
@@ -1224,60 +1252,119 @@ function Show(props) {
1224
1252
  const condition = createMemo(() => props.when, void 0, {
1225
1253
  equals: (a, b) => keyed ? a === b : !a === !b
1226
1254
  });
1227
- return createMemo(() => {
1228
- const c = condition();
1229
- if (c) {
1230
- const child = props.children;
1231
- const fn = typeof child === "function" && child.length > 0;
1232
- return fn ? untrack(() => child(keyed ? c : () => {
1233
- if (!untrack(condition))
1234
- throw narrowedError("Show");
1235
- return props.when;
1236
- })) : child;
1237
- }
1238
- return props.fallback;
1239
- }, void 0, void 0);
1255
+ return createMemo(
1256
+ () => {
1257
+ const c = condition();
1258
+ if (c) {
1259
+ const child = props.children;
1260
+ const fn = typeof child === "function" && child.length > 0;
1261
+ return fn ? untrack(
1262
+ () => child(
1263
+ keyed ? c : () => {
1264
+ if (!untrack(condition))
1265
+ throw narrowedError("Show");
1266
+ return props.when;
1267
+ }
1268
+ )
1269
+ ) : child;
1270
+ }
1271
+ return props.fallback;
1272
+ },
1273
+ void 0,
1274
+ void 0
1275
+ );
1240
1276
  }
1241
1277
  function Switch(props) {
1242
1278
  let keyed = false;
1243
1279
  const equals = (a, b) => a[0] === b[0] && (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
1244
- const conditions = children(() => props.children), evalConditions = createMemo(() => {
1245
- let conds = conditions();
1246
- if (!Array.isArray(conds))
1247
- conds = [conds];
1248
- for (let i = 0; i < conds.length; i++) {
1249
- const c = conds[i].when;
1250
- if (c) {
1251
- keyed = !!conds[i].keyed;
1252
- return [i, c, conds[i]];
1280
+ const conditions = children(() => props.children), evalConditions = createMemo(
1281
+ () => {
1282
+ let conds = conditions();
1283
+ if (!Array.isArray(conds))
1284
+ conds = [conds];
1285
+ for (let i = 0; i < conds.length; i++) {
1286
+ const c = conds[i].when;
1287
+ if (c) {
1288
+ keyed = !!conds[i].keyed;
1289
+ return [i, c, conds[i]];
1290
+ }
1253
1291
  }
1292
+ return [-1];
1293
+ },
1294
+ void 0,
1295
+ {
1296
+ equals
1254
1297
  }
1255
- return [-1];
1256
- }, void 0, {
1257
- equals
1258
- });
1259
- return createMemo(() => {
1260
- const [index, when, cond] = evalConditions();
1261
- if (index < 0)
1262
- return props.fallback;
1263
- const c = cond.children;
1264
- const fn = typeof c === "function" && c.length > 0;
1265
- return fn ? untrack(() => c(keyed ? when : () => {
1266
- if (untrack(evalConditions)[0] !== index)
1267
- throw narrowedError("Match");
1268
- return cond.when;
1269
- })) : c;
1270
- }, void 0, void 0);
1298
+ );
1299
+ return createMemo(
1300
+ () => {
1301
+ const [index, when, cond] = evalConditions();
1302
+ if (index < 0)
1303
+ return props.fallback;
1304
+ const c = cond.children;
1305
+ const fn = typeof c === "function" && c.length > 0;
1306
+ return fn ? untrack(
1307
+ () => c(
1308
+ keyed ? when : () => {
1309
+ if (untrack(evalConditions)[0] !== index)
1310
+ throw narrowedError("Match");
1311
+ return cond.when;
1312
+ }
1313
+ )
1314
+ ) : c;
1315
+ },
1316
+ void 0,
1317
+ void 0
1318
+ );
1271
1319
  }
1272
1320
  function Match(props) {
1273
1321
  return props;
1274
1322
  }
1275
1323
  var DEV = void 0;
1276
1324
 
1277
- // ../../node_modules/.pnpm/solid-js@1.7.8/node_modules/solid-js/web/dist/web.js
1278
- var 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"];
1279
- var Properties = /* @__PURE__ */ new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
1280
- var ChildProperties = /* @__PURE__ */ new Set(["innerHTML", "textContent", "innerText", "children"]);
1325
+ // ../../node_modules/.pnpm/solid-js@1.8.1/node_modules/solid-js/web/dist/web.js
1326
+ var booleans = [
1327
+ "allowfullscreen",
1328
+ "async",
1329
+ "autofocus",
1330
+ "autoplay",
1331
+ "checked",
1332
+ "controls",
1333
+ "default",
1334
+ "disabled",
1335
+ "formnovalidate",
1336
+ "hidden",
1337
+ "indeterminate",
1338
+ "ismap",
1339
+ "loop",
1340
+ "multiple",
1341
+ "muted",
1342
+ "nomodule",
1343
+ "novalidate",
1344
+ "open",
1345
+ "playsinline",
1346
+ "readonly",
1347
+ "required",
1348
+ "reversed",
1349
+ "seamless",
1350
+ "selected"
1351
+ ];
1352
+ var Properties = /* @__PURE__ */ new Set([
1353
+ "className",
1354
+ "value",
1355
+ "readOnly",
1356
+ "formNoValidate",
1357
+ "isMap",
1358
+ "noModule",
1359
+ "playsInline",
1360
+ ...booleans
1361
+ ]);
1362
+ var ChildProperties = /* @__PURE__ */ new Set([
1363
+ "innerHTML",
1364
+ "textContent",
1365
+ "innerText",
1366
+ "children"
1367
+ ]);
1281
1368
  var Aliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
1282
1369
  className: "class",
1283
1370
  htmlFor: "for"
@@ -1311,7 +1398,30 @@ function getPropAlias(prop, tagName) {
1311
1398
  const a = PropAliases[prop];
1312
1399
  return typeof a === "object" ? a[tagName] ? a["$"] : void 0 : a;
1313
1400
  }
1314
- var DelegatedEvents = /* @__PURE__ */ new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
1401
+ var DelegatedEvents = /* @__PURE__ */ new Set([
1402
+ "beforeinput",
1403
+ "click",
1404
+ "dblclick",
1405
+ "contextmenu",
1406
+ "focusin",
1407
+ "focusout",
1408
+ "input",
1409
+ "keydown",
1410
+ "keyup",
1411
+ "mousedown",
1412
+ "mousemove",
1413
+ "mouseout",
1414
+ "mouseover",
1415
+ "mouseup",
1416
+ "pointerdown",
1417
+ "pointermove",
1418
+ "pointerout",
1419
+ "pointerover",
1420
+ "pointerup",
1421
+ "touchend",
1422
+ "touchmove",
1423
+ "touchstart"
1424
+ ]);
1315
1425
  var SVGElements = /* @__PURE__ */ new Set([
1316
1426
  "altGlyph",
1317
1427
  "altGlyphDef",
@@ -1484,18 +1594,24 @@ function delegateEvents(eventNames, document2 = window.document) {
1484
1594
  }
1485
1595
  }
1486
1596
  function setAttribute(node, name, value) {
1597
+ if (sharedConfig.context)
1598
+ return;
1487
1599
  if (value == null)
1488
1600
  node.removeAttribute(name);
1489
1601
  else
1490
1602
  node.setAttribute(name, value);
1491
1603
  }
1492
1604
  function setAttributeNS(node, namespace, name, value) {
1605
+ if (sharedConfig.context)
1606
+ return;
1493
1607
  if (value == null)
1494
1608
  node.removeAttributeNS(namespace, name);
1495
1609
  else
1496
1610
  node.setAttributeNS(namespace, name, value);
1497
1611
  }
1498
1612
  function className(node, value) {
1613
+ if (sharedConfig.context)
1614
+ return;
1499
1615
  if (value == null)
1500
1616
  node.removeAttribute("class");
1501
1617
  else
@@ -1559,7 +1675,9 @@ function style(node, value, prev) {
1559
1675
  function spread(node, props = {}, isSVG, skipChildren) {
1560
1676
  const prevProps = {};
1561
1677
  if (!skipChildren) {
1562
- createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
1678
+ createRenderEffect(
1679
+ () => prevProps.children = insertExpression(node, props.children, prevProps.children)
1680
+ );
1563
1681
  }
1564
1682
  createRenderEffect(() => props.ref && props.ref(node));
1565
1683
  createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
@@ -1597,10 +1715,6 @@ function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = fals
1597
1715
  function getNextElement(template2) {
1598
1716
  let node, key;
1599
1717
  if (!sharedConfig.context || !(node = sharedConfig.registry.get(key = getHydrationKey()))) {
1600
- if (sharedConfig.context)
1601
- ;
1602
- if (!template2)
1603
- throw new Error("Unrecoverable Hydration Mismatch. No template for key: " + key);
1604
1718
  return template2();
1605
1719
  }
1606
1720
  if (sharedConfig.completed)
@@ -1652,7 +1766,8 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
1652
1766
  if (forceProp) {
1653
1767
  prop = prop.slice(5);
1654
1768
  isProp = true;
1655
- }
1769
+ } else if (sharedConfig.context)
1770
+ return value;
1656
1771
  if (prop === "class" || prop === "className")
1657
1772
  className(node, value);
1658
1773
  else if (isCE && !isProp && !isChildProp)
@@ -1755,10 +1870,13 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
1755
1870
  if (sharedConfig.context) {
1756
1871
  if (!array.length)
1757
1872
  return current;
1758
- for (let i = 0; i < array.length; i++) {
1759
- if (array[i].parentNode)
1760
- return current = array;
1761
- }
1873
+ if (marker === void 0)
1874
+ return [...parent.childNodes];
1875
+ let node = array[0];
1876
+ let nodes = [node];
1877
+ while ((node = node.nextSibling) !== marker)
1878
+ nodes.push(node);
1879
+ return current = nodes;
1762
1880
  }
1763
1881
  if (array.length === 0) {
1764
1882
  current = cleanChildren(parent, current, marker);
@@ -1804,7 +1922,11 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
1804
1922
  if (unwrap) {
1805
1923
  while (typeof item === "function")
1806
1924
  item = item();
1807
- dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
1925
+ dynamic = normalizeIncomingArray(
1926
+ normalized,
1927
+ Array.isArray(item) ? item : [item],
1928
+ Array.isArray(prev) ? prev : [prev]
1929
+ ) || dynamic;
1808
1930
  } else {
1809
1931
  normalized.push(item);
1810
1932
  dynamic = true;
@@ -1854,39 +1976,41 @@ function createElement(tagName, isSVG = false) {
1854
1976
  return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);
1855
1977
  }
1856
1978
  function Portal(props) {
1857
- const {
1858
- useShadow
1859
- } = props, marker = document.createTextNode(""), mount = () => props.mount || document.body, owner = getOwner();
1979
+ const { useShadow } = props, marker = document.createTextNode(""), mount = () => props.mount || document.body, owner = getOwner();
1860
1980
  let content;
1861
1981
  let hydrating = !!sharedConfig.context;
1862
- createEffect(() => {
1863
- if (hydrating)
1864
- getOwner().user = hydrating = false;
1865
- content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
1866
- const el = mount();
1867
- if (el instanceof HTMLHeadElement) {
1868
- const [clean, setClean] = createSignal(false);
1869
- const cleanup = () => setClean(true);
1870
- createRoot((dispose2) => insert(el, () => !clean() ? content() : dispose2(), null));
1871
- onCleanup(cleanup);
1872
- } else {
1873
- const container = createElement(props.isSVG ? "g" : "div", props.isSVG), renderRoot = useShadow && container.attachShadow ? container.attachShadow({
1874
- mode: "open"
1875
- }) : container;
1876
- Object.defineProperty(container, "_$host", {
1877
- get() {
1878
- return marker.parentNode;
1879
- },
1880
- configurable: true
1881
- });
1882
- insert(renderRoot, content);
1883
- el.appendChild(container);
1884
- props.ref && props.ref(container);
1885
- onCleanup(() => el.removeChild(container));
1982
+ createEffect(
1983
+ () => {
1984
+ if (hydrating)
1985
+ getOwner().user = hydrating = false;
1986
+ content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
1987
+ const el = mount();
1988
+ if (el instanceof HTMLHeadElement) {
1989
+ const [clean, setClean] = createSignal(false);
1990
+ const cleanup = () => setClean(true);
1991
+ createRoot((dispose2) => insert(el, () => !clean() ? content() : dispose2(), null));
1992
+ onCleanup(cleanup);
1993
+ } else {
1994
+ const container = createElement(props.isSVG ? "g" : "div", props.isSVG), renderRoot = useShadow && container.attachShadow ? container.attachShadow({
1995
+ mode: "open"
1996
+ }) : container;
1997
+ Object.defineProperty(container, "_$host", {
1998
+ get() {
1999
+ return marker.parentNode;
2000
+ },
2001
+ configurable: true
2002
+ });
2003
+ insert(renderRoot, content);
2004
+ el.appendChild(container);
2005
+ props.ref && props.ref(container);
2006
+ onCleanup(() => el.removeChild(container));
2007
+ }
2008
+ },
2009
+ void 0,
2010
+ {
2011
+ render: !hydrating
1886
2012
  }
1887
- }, void 0, {
1888
- render: !hydrating
1889
- });
2013
+ );
1890
2014
  return marker;
1891
2015
  }
1892
2016
  function Dynamic(props) {
@@ -1896,9 +2020,6 @@ function Dynamic(props) {
1896
2020
  const component = cached();
1897
2021
  switch (typeof component) {
1898
2022
  case "function":
1899
- Object.assign(component, {
1900
- [$DEVCOMP]: true
1901
- });
1902
2023
  return untrack(() => component(others));
1903
2024
  case "string":
1904
2025
  const isSvg = SVGElements.has(component);