@tanstack/solid-query-devtools 6.0.0-alpha.1 → 6.0.0-beta.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.
package/build/index.cjs CHANGED
@@ -14,7 +14,7 @@ var __export = (target, all) => {
14
14
  __defProp(target, name, { get: all[name], enumerable: true });
15
15
  };
16
16
 
17
- // ../../node_modules/.pnpm/@solidjs+signals@0.13.6/node_modules/@solidjs/signals/dist/prod.js
17
+ // ../../node_modules/.pnpm/@solidjs+signals@0.13.9/node_modules/@solidjs/signals/dist/prod.js
18
18
  function actualInsertIntoHeap(e, t) {
19
19
  const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
20
20
  if (n >= e.o) e.o = n + 1;
@@ -342,39 +342,125 @@ function assignOrMergeLane(e, t) {
342
342
  }
343
343
  e.q = t;
344
344
  }
345
+ function unlinkSubs(e) {
346
+ const t = e.m;
347
+ const n = e.D;
348
+ const i = e.p;
349
+ const r = e.Ie;
350
+ if (i !== null) i.Ie = r;
351
+ else t.pe = r;
352
+ if (r !== null) r.p = i;
353
+ else {
354
+ t.I = i;
355
+ if (i === null) {
356
+ t.he?.();
357
+ t.L && !t.Ae && !(t.O & REACTIVE_ZOMBIE) && unobserved(t);
358
+ }
359
+ }
360
+ return n;
361
+ }
362
+ function unobserved(e) {
363
+ deleteFromHeap(e, e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
364
+ let t = e.C;
365
+ while (t !== null) {
366
+ t = unlinkSubs(t);
367
+ }
368
+ e.C = null;
369
+ disposeChildren(e, true);
370
+ }
371
+ function markDisposal(e) {
372
+ let t = e.Pe;
373
+ while (t) {
374
+ t.O |= REACTIVE_ZOMBIE;
375
+ if (t.O & REACTIVE_IN_HEAP) {
376
+ deleteFromHeap(t, dirtyQueue);
377
+ insertIntoHeap(t, zombieQueue);
378
+ }
379
+ markDisposal(t);
380
+ t = t.ge;
381
+ }
382
+ }
383
+ function disposeChildren(e, t = false, n) {
384
+ if (e.O & REACTIVE_DISPOSED) return;
385
+ if (t) e.O = REACTIVE_DISPOSED;
386
+ if (t && e.L) e.Ce = null;
387
+ let i = n ? e.De : e.Pe;
388
+ while (i) {
389
+ const e2 = i.ge;
390
+ if (i.C) {
391
+ const e3 = i;
392
+ deleteFromHeap(e3, e3.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
393
+ let t2 = e3.C;
394
+ do {
395
+ t2 = unlinkSubs(t2);
396
+ } while (t2 !== null);
397
+ e3.C = null;
398
+ e3.Ne = null;
399
+ }
400
+ disposeChildren(i, true);
401
+ i = e2;
402
+ }
403
+ if (n) {
404
+ e.De = null;
405
+ } else {
406
+ e.Pe = null;
407
+ e.ye = 0;
408
+ }
409
+ runDisposal(e, n);
410
+ }
411
+ function runDisposal(e, t) {
412
+ let n = t ? e.ve : e.me;
413
+ if (!n) return;
414
+ if (Array.isArray(n)) {
415
+ for (let e2 = 0; e2 < n.length; e2++) {
416
+ const t2 = n[e2];
417
+ t2.call(t2);
418
+ }
419
+ } else {
420
+ n.call(n);
421
+ }
422
+ t ? e.ve = null : e.me = null;
423
+ }
424
+ function cleanup(e) {
425
+ if (!context) return e;
426
+ if (!context.me) context.me = e;
427
+ else if (Array.isArray(context.me)) context.me.push(e);
428
+ else context.me = [context.me, e];
429
+ return e;
430
+ }
345
431
  function addPendingSource(e, t) {
346
- if (e.Ie === t || e.pe?.has(t)) return false;
347
- if (!e.Ie) {
348
- e.Ie = t;
432
+ if (e.be === t || e.Le?.has(t)) return false;
433
+ if (!e.be) {
434
+ e.be = t;
349
435
  return true;
350
436
  }
351
- if (!e.pe) {
352
- e.pe = /* @__PURE__ */ new Set([e.Ie, t]);
437
+ if (!e.Le) {
438
+ e.Le = /* @__PURE__ */ new Set([e.be, t]);
353
439
  } else {
354
- e.pe.add(t);
440
+ e.Le.add(t);
355
441
  }
356
- e.Ie = void 0;
442
+ e.be = void 0;
357
443
  return true;
358
444
  }
359
445
  function removePendingSource(e, t) {
360
- if (e.Ie) {
361
- if (e.Ie !== t) return false;
362
- e.Ie = void 0;
446
+ if (e.be) {
447
+ if (e.be !== t) return false;
448
+ e.be = void 0;
363
449
  return true;
364
450
  }
365
- if (!e.pe?.delete(t)) return false;
366
- if (e.pe.size === 1) {
367
- e.Ie = e.pe.values().next().value;
368
- e.pe = void 0;
369
- } else if (e.pe.size === 0) {
370
- e.pe = void 0;
451
+ if (!e.Le?.delete(t)) return false;
452
+ if (e.Le.size === 1) {
453
+ e.be = e.Le.values().next().value;
454
+ e.Le = void 0;
455
+ } else if (e.Le.size === 0) {
456
+ e.Le = void 0;
371
457
  }
372
458
  return true;
373
459
  }
374
460
  function clearPendingSources(e) {
375
- e.Ie = void 0;
376
- e.pe?.clear();
377
- e.pe = void 0;
461
+ e.be = void 0;
462
+ e.Le?.clear();
463
+ e.Le = void 0;
378
464
  }
379
465
  function setPendingError(e, t, n) {
380
466
  if (!t) {
@@ -403,7 +489,7 @@ function settlePendingSource(e) {
403
489
  if (n.has(i) || !removePendingSource(i, e)) return;
404
490
  n.add(i);
405
491
  i.Ee = clock;
406
- const r = i.Ie ?? i.pe?.values().next().value;
492
+ const r = i.be ?? i.Le?.values().next().value;
407
493
  if (r) {
408
494
  setPendingError(i, r);
409
495
  updatePendingSignal(i);
@@ -411,7 +497,7 @@ function settlePendingSource(e) {
411
497
  i.Se &= ~STATUS_PENDING;
412
498
  setPendingError(i);
413
499
  updatePendingSignal(i);
414
- if (i.he) {
500
+ if (i.Ue) {
415
501
  if (i.W === EFFECT_TRACKED) {
416
502
  const e2 = i;
417
503
  if (!e2.H) {
@@ -425,7 +511,7 @@ function settlePendingSource(e) {
425
511
  }
426
512
  t = true;
427
513
  }
428
- i.he = false;
514
+ i.Ue = false;
429
515
  }
430
516
  forEachDependent(i, settle);
431
517
  };
@@ -437,19 +523,19 @@ function handleAsync(e, t, n) {
437
523
  const r = i && untrack(() => t[Symbol.asyncIterator]);
438
524
  const s = !r && i && untrack(() => typeof t.then === "function");
439
525
  if (!s && !r) {
440
- e.Ae = null;
526
+ e.Ce = null;
441
527
  return t;
442
528
  }
443
- e.Ae = t;
529
+ e.Ce = t;
444
530
  let o;
445
531
  const handleError = (n2) => {
446
- if (e.Ae !== t) return;
532
+ if (e.Ce !== t) return;
447
533
  globalQueue.initTransition(resolveTransition(e));
448
534
  notifyStatus(e, n2 instanceof NotReadyError ? STATUS_PENDING : STATUS_ERROR, n2);
449
535
  e.Ee = clock;
450
536
  };
451
537
  const asyncWrite = (i2, r2) => {
452
- if (e.Ae !== t) return;
538
+ if (e.Ce !== t) return;
453
539
  if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY)) return;
454
540
  globalQueue.initTransition(resolveTransition(e));
455
541
  clearStatus(e);
@@ -464,12 +550,12 @@ function handleAsync(e, t, n) {
464
550
  e.Ee = clock;
465
551
  } else if (s2) {
466
552
  const t2 = e.J;
467
- const n2 = e.Ne;
553
+ const n2 = e.ke;
468
554
  if (!n2 || !n2(i2, t2)) {
469
555
  e.J = i2;
470
556
  e.Ee = clock;
471
- if (e.Pe) {
472
- setSignal(e.Pe, i2);
557
+ if (e.Ge) {
558
+ setSignal(e.Ge, i2);
473
559
  }
474
560
  insertSubs(e, true);
475
561
  }
@@ -503,33 +589,53 @@ function handleAsync(e, t, n) {
503
589
  if (r) {
504
590
  const n2 = t[Symbol.asyncIterator]();
505
591
  let i2 = false;
592
+ let r2 = false;
593
+ cleanup(() => {
594
+ if (r2) return;
595
+ r2 = true;
596
+ try {
597
+ const e2 = n2.return?.();
598
+ if (e2 && typeof e2.then === "function") {
599
+ e2.then(void 0, () => {
600
+ });
601
+ }
602
+ } catch {
603
+ }
604
+ });
506
605
  const iterate = () => {
507
- let e2, t2 = false, r3 = true;
606
+ let s3, u = false, c = true;
508
607
  n2.next().then(
509
608
  (n3) => {
510
- if (r3) {
511
- e2 = n3;
512
- t2 = true;
609
+ if (c) {
610
+ s3 = n3;
611
+ u = true;
612
+ if (n3.done) r2 = true;
613
+ } else if (e.Ce !== t) {
614
+ return;
513
615
  } else if (!n3.done) asyncWrite(n3.value, iterate);
514
616
  else {
617
+ r2 = true;
515
618
  schedule();
516
619
  flush();
517
620
  }
518
621
  },
519
- (e3) => {
520
- if (!r3) handleError(e3);
622
+ (n3) => {
623
+ if (!c && e.Ce === t) {
624
+ r2 = true;
625
+ handleError(n3);
626
+ }
521
627
  }
522
628
  );
523
- r3 = false;
524
- if (t2 && !e2.done) {
525
- o = e2.value;
629
+ c = false;
630
+ if (u && !s3.done) {
631
+ o = s3.value;
526
632
  i2 = true;
527
633
  return iterate();
528
634
  }
529
- return t2 && e2.done;
635
+ return u && s3.done;
530
636
  };
531
- const r2 = iterate();
532
- if (!i2 && !r2) {
637
+ const s2 = iterate();
638
+ if (!i2 && !s2) {
533
639
  globalQueue.initTransition(resolveTransition(e));
534
640
  throw new NotReadyError(context);
535
641
  }
@@ -538,11 +644,11 @@ function handleAsync(e, t, n) {
538
644
  }
539
645
  function clearStatus(e, t = false) {
540
646
  clearPendingSources(e);
541
- e.he = false;
647
+ e.Ue = false;
542
648
  e.Se = t ? 0 : e.Se & STATUS_UNINITIALIZED;
543
649
  setPendingError(e);
544
650
  updatePendingSignal(e);
545
- e.ge?.();
651
+ e.xe?.();
546
652
  }
547
653
  function notifyStatus(e, t, n, i, r) {
548
654
  if (t === STATUS_ERROR && !(n instanceof StatusError) && !(n instanceof NotReadyError))
@@ -568,117 +674,40 @@ function notifyStatus(e, t, n, i, r) {
568
674
  }
569
675
  const a = i || c;
570
676
  const f = i || u ? void 0 : r;
571
- if (e.ge) {
677
+ if (e.xe) {
572
678
  if (i && t === STATUS_PENDING) {
573
679
  return;
574
680
  }
575
681
  if (a) {
576
- e.ge(t, n);
682
+ e.xe(t, n);
577
683
  } else {
578
- e.ge();
684
+ e.xe();
579
685
  }
580
686
  return;
581
687
  }
582
688
  forEachDependent(e, (e2) => {
583
689
  e2.Ee = clock;
584
- if (t === STATUS_PENDING && s && e2.Ie !== s && !e2.pe?.has(s) || t !== STATUS_PENDING && (e2.le !== n || e2.Ie || e2.pe)) {
690
+ if (t === STATUS_PENDING && s && e2.be !== s && !e2.Le?.has(s) || t !== STATUS_PENDING && (e2.le !== n || e2.be || e2.Le)) {
585
691
  if (!a && !e2.K) globalQueue.se.push(e2);
586
692
  notifyStatus(e2, t, n, a, f);
587
693
  }
588
694
  });
589
695
  }
590
- function markDisposal(e) {
591
- let t = e.Ce;
592
- while (t) {
593
- t.O |= REACTIVE_ZOMBIE;
594
- if (t.O & REACTIVE_IN_HEAP) {
595
- deleteFromHeap(t, dirtyQueue);
596
- insertIntoHeap(t, zombieQueue);
597
- }
598
- markDisposal(t);
599
- t = t.De;
600
- }
601
- }
602
- function disposeChildren(e, t = false, n) {
603
- if (e.O & REACTIVE_DISPOSED) return;
604
- if (t) e.O = REACTIVE_DISPOSED;
605
- let i = n ? e.me : e.Ce;
606
- while (i) {
607
- const e2 = i.De;
608
- if (i.C) {
609
- const e3 = i;
610
- deleteFromHeap(e3, e3.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
611
- let t2 = e3.C;
612
- do {
613
- t2 = unlinkSubs(t2);
614
- } while (t2 !== null);
615
- e3.C = null;
616
- e3.ye = null;
617
- }
618
- disposeChildren(i, true);
619
- i = e2;
620
- }
621
- if (n) {
622
- e.me = null;
623
- } else {
624
- e.Ce = null;
625
- e.ve = 0;
626
- }
627
- runDisposal(e, n);
628
- }
629
- function runDisposal(e, t) {
630
- let n = t ? e.we : e.be;
631
- if (!n) return;
632
- if (Array.isArray(n)) {
633
- for (let e2 = 0; e2 < n.length; e2++) {
634
- const t2 = n[e2];
635
- t2.call(t2);
636
- }
637
- } else {
638
- n.call(n);
639
- }
640
- t ? e.we = null : e.be = null;
641
- }
642
- function unlinkSubs(e) {
643
- const t = e.m;
644
- const n = e.D;
645
- const i = e.p;
646
- const r = e.Ue;
647
- if (i !== null) i.Ue = r;
648
- else t.ke = r;
649
- if (r !== null) r.p = i;
650
- else {
651
- t.I = i;
652
- if (i === null) {
653
- t.Ge?.();
654
- t.L && !t.xe && !(t.O & REACTIVE_ZOMBIE) && unobserved(t);
655
- }
656
- }
657
- return n;
658
- }
659
- function unobserved(e) {
660
- deleteFromHeap(e, e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
661
- let t = e.C;
662
- while (t !== null) {
663
- t = unlinkSubs(t);
664
- }
665
- e.C = null;
666
- disposeChildren(e, true);
667
- }
668
696
  function recompute(e, t = false) {
669
697
  const n = e.W;
670
698
  if (!t) {
671
699
  if (e.K && (!n || activeTransition) && activeTransition !== e.K)
672
700
  globalQueue.initTransition(e.K);
673
701
  deleteFromHeap(e, e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
702
+ e.Ce = null;
674
703
  if (e.K || n === EFFECT_TRACKED) disposeChildren(e);
675
704
  else {
676
705
  markDisposal(e);
677
- e.we = e.be;
678
- e.me = e.Ce;
679
- e.be = null;
680
- e.Ce = null;
681
- e.ve = 0;
706
+ e.ve = e.me;
707
+ e.De = e.Pe;
708
+ e.me = null;
709
+ e.Pe = null;
710
+ e.ye = 0;
682
711
  }
683
712
  }
684
713
  const i = !!(e.O & REACTIVE_OPTIMISTIC_DIRTY);
@@ -686,7 +715,7 @@ function recompute(e, t = false) {
686
715
  const s = !!(e.Se & STATUS_PENDING);
687
716
  const o = context;
688
717
  context = e;
689
- e.ye = null;
718
+ e.Ne = null;
690
719
  e.O = REACTIVE_RECOMPUTING_DEPS;
691
720
  e.Ee = clock;
692
721
  let u = e.X === NOT_PENDING ? e.J : e.X;
@@ -715,7 +744,7 @@ function recompute(e, t = false) {
715
744
  updatePendingSignal(t3.te);
716
745
  }
717
746
  }
718
- if (t2 instanceof NotReadyError) e.he = true;
747
+ if (t2 instanceof NotReadyError) e.Ue = true;
719
748
  notifyStatus(
720
749
  e,
721
750
  t2 instanceof NotReadyError ? STATUS_PENDING : STATUS_ERROR,
@@ -729,7 +758,7 @@ function recompute(e, t = false) {
729
758
  context = o;
730
759
  }
731
760
  if (!e.le) {
732
- const o2 = e.ye;
761
+ const o2 = e.Ne;
733
762
  let a2 = o2 !== null ? o2.D : e.C;
734
763
  if (a2 !== null) {
735
764
  do {
@@ -739,7 +768,7 @@ function recompute(e, t = false) {
739
768
  else e.C = null;
740
769
  }
741
770
  const f2 = r ? e.ee : e.X === NOT_PENDING ? e.J : e.X;
742
- const l = !e.Ne || !e.Ne(f2, u);
771
+ const l = !e.ke || !e.ke(f2, u);
743
772
  if (l) {
744
773
  const o3 = r ? e.ee : void 0;
745
774
  if (t || n && activeTransition !== e.K || i) {
@@ -780,7 +809,7 @@ function setSignal(e, t) {
780
809
  const i = e.ee !== void 0 && e.ee !== NOT_PENDING;
781
810
  const r = n ? i ? e.ee : e.J : e.X === NOT_PENDING ? e.J : e.X;
782
811
  if (typeof t === "function") t = t(r);
783
- const s = !e.Ne || !e.Ne(r, t) || !!(e.Se & STATUS_UNINITIALIZED);
812
+ const s = !e.ke || !e.ke(r, t) || !!(e.Se & STATUS_UNINITIALIZED);
784
813
  if (!s) {
785
814
  if (n && i && e.L) {
786
815
  insertSubs(e, true);
@@ -804,8 +833,8 @@ function setSignal(e, t) {
804
833
  e.X = t;
805
834
  }
806
835
  updatePendingSignal(e);
807
- if (e.Pe) {
808
- setSignal(e.Pe, t);
836
+ if (e.Ge) {
837
+ setSignal(e.Ge, t);
809
838
  }
810
839
  e.Ee = clock;
811
840
  insertSubs(e, n);
@@ -816,7 +845,7 @@ function computePendingState(e) {
816
845
  const t = e;
817
846
  const n = e.V;
818
847
  if (n && e.X !== NOT_PENDING) {
819
- return !n.Ae && !(n.Se & STATUS_PENDING);
848
+ return !n.Ce && !(n.Se & STATUS_PENDING);
820
849
  }
821
850
  if (e.ee !== void 0 && e.ee !== NOT_PENDING) {
822
851
  if (t.Se & STATUS_PENDING && !(t.Se & STATUS_UNINITIALIZED)) return true;
@@ -851,7 +880,7 @@ function updatePendingSignal(e) {
851
880
  }
852
881
  }
853
882
  function isWrappable(e) {
854
- return e != null && typeof e === "object" && !Object.isFrozen(e);
883
+ return e != null && typeof e === "object" && !Object.isFrozen(e) && !(typeof Node !== "undefined" && e instanceof Node);
855
884
  }
856
885
  function updatePath(e, t, n = 0) {
857
886
  let i, r = e;
@@ -907,7 +936,7 @@ function updatePath(e, t, n = 0) {
907
936
  }
908
937
  var NotReadyError, StatusError, REACTIVE_NONE, REACTIVE_CHECK, REACTIVE_DIRTY, REACTIVE_RECOMPUTING_DEPS, REACTIVE_IN_HEAP, REACTIVE_IN_HEAP_HEIGHT, REACTIVE_ZOMBIE, REACTIVE_DISPOSED, REACTIVE_OPTIMISTIC_DIRTY, REACTIVE_SNAPSHOT_STALE, STATUS_PENDING, STATUS_ERROR, STATUS_UNINITIALIZED, EFFECT_RENDER, EFFECT_USER, EFFECT_TRACKED, NOT_PENDING, transitions, dirtyQueue, zombieQueue, clock, activeTransition, scheduled, projectionWriteActive, stashedOptimisticReads, Queue, GlobalQueue, globalQueue, signalLanes, activeLanes, externalSourceConfig, tracking, context, currentOptimisticLane, DELETE;
909
938
  var init_prod = __esm({
910
- "../../node_modules/.pnpm/@solidjs+signals@0.13.6/node_modules/@solidjs/signals/dist/prod.js"() {
939
+ "../../node_modules/.pnpm/@solidjs+signals@0.13.9/node_modules/@solidjs/signals/dist/prod.js"() {
911
940
  NotReadyError = class extends Error {
912
941
  source;
913
942
  constructor(e) {
@@ -1203,7 +1232,7 @@ function isHydrating(node) {
1203
1232
  }
1204
1233
  var effect, isServer, isDev;
1205
1234
  var init_web = __esm({
1206
- "../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.4_@solidjs+signals@0.13.6_solid-js@2.0.0-beta.4/node_modules/@solidjs/web/dist/web.js"() {
1235
+ "../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.4_@solidjs+signals@0.13.9_solid-js@2.0.0-beta.5/node_modules/@solidjs/web/dist/web.js"() {
1207
1236
  init_prod();
1208
1237
  effect = (fn, effectFn, initial) => solidJs.createRenderEffect(fn, effectFn, initial, {
1209
1238
  transparent: true
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isDev, isServer } from './chunk/AU2REB6C.js';
1
+ import { isDev, isServer } from './chunk/P6IZ7GTW.js';
2
2
  import { createSignal, omit, sharedConfig, onSettled, createMemo, untrack } from 'solid-js';
3
3
 
4
4
  function clientOnly(fn) {
@@ -19,10 +19,10 @@ function clientOnly(fn) {
19
19
  }
20
20
 
21
21
  // src/index.tsx
22
- var SolidQueryDevtools = isDev ? clientOnly(() => import('./devtools/BK5V6NH3.js')) : function() {
22
+ var SolidQueryDevtools = isDev ? clientOnly(() => import('./devtools/IWG4ZJJU.js')) : function() {
23
23
  return null;
24
24
  };
25
- var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import('./devtoolsPanel/A5BO2WVY.js')) : function() {
25
+ var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import('./devtoolsPanel/NAMW3JP3.js')) : function() {
26
26
  return null;
27
27
  };
28
28