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