@tanstack/react-query-devtools 4.29.22 → 4.29.25

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.
@@ -44,261 +44,6 @@
44
44
  return _extends.apply(this, arguments);
45
45
  }
46
46
 
47
- var shim = {exports: {}};
48
-
49
- var useSyncExternalStoreShim_development = {};
50
-
51
- /**
52
- * @license React
53
- * use-sync-external-store-shim.development.js
54
- *
55
- * Copyright (c) Facebook, Inc. and its affiliates.
56
- *
57
- * This source code is licensed under the MIT license found in the
58
- * LICENSE file in the root directory of this source tree.
59
- */
60
-
61
- var hasRequiredUseSyncExternalStoreShim_development;
62
-
63
- function requireUseSyncExternalStoreShim_development () {
64
- if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
65
- hasRequiredUseSyncExternalStoreShim_development = 1;
66
-
67
- {
68
- (function() {
69
-
70
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
71
- if (
72
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
73
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
74
- 'function'
75
- ) {
76
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
77
- }
78
- var React = React__default["default"];
79
-
80
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
81
-
82
- function error(format) {
83
- {
84
- {
85
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
86
- args[_key2 - 1] = arguments[_key2];
87
- }
88
-
89
- printWarning('error', format, args);
90
- }
91
- }
92
- }
93
-
94
- function printWarning(level, format, args) {
95
- // When changing this logic, you might want to also
96
- // update consoleWithStackDev.www.js as well.
97
- {
98
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
99
- var stack = ReactDebugCurrentFrame.getStackAddendum();
100
-
101
- if (stack !== '') {
102
- format += '%s';
103
- args = args.concat([stack]);
104
- } // eslint-disable-next-line react-internal/safe-string-coercion
105
-
106
-
107
- var argsWithFormat = args.map(function (item) {
108
- return String(item);
109
- }); // Careful: RN currently depends on this prefix
110
-
111
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
112
- // breaks IE9: https://github.com/facebook/react/issues/13610
113
- // eslint-disable-next-line react-internal/no-production-logging
114
-
115
- Function.prototype.apply.call(console[level], console, argsWithFormat);
116
- }
117
- }
118
-
119
- /**
120
- * inlined Object.is polyfill to avoid requiring consumers ship their own
121
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
122
- */
123
- function is(x, y) {
124
- return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
125
- ;
126
- }
127
-
128
- var objectIs = typeof Object.is === 'function' ? Object.is : is;
129
-
130
- // dispatch for CommonJS interop named imports.
131
-
132
- var useState = React.useState,
133
- useEffect = React.useEffect,
134
- useLayoutEffect = React.useLayoutEffect,
135
- useDebugValue = React.useDebugValue;
136
- var didWarnOld18Alpha = false;
137
- var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works
138
- // because of a very particular set of implementation details and assumptions
139
- // -- change any one of them and it will break. The most important assumption
140
- // is that updates are always synchronous, because concurrent rendering is
141
- // only available in versions of React that also have a built-in
142
- // useSyncExternalStore API. And we only use this shim when the built-in API
143
- // does not exist.
144
- //
145
- // Do not assume that the clever hacks used by this hook also work in general.
146
- // The point of this shim is to replace the need for hacks by other libraries.
147
-
148
- function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
149
- // React do not expose a way to check if we're hydrating. So users of the shim
150
- // will need to track that themselves and return the correct value
151
- // from `getSnapshot`.
152
- getServerSnapshot) {
153
- {
154
- if (!didWarnOld18Alpha) {
155
- if (React.startTransition !== undefined) {
156
- didWarnOld18Alpha = true;
157
-
158
- error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');
159
- }
160
- }
161
- } // Read the current snapshot from the store on every render. Again, this
162
- // breaks the rules of React, and only works here because of specific
163
- // implementation details, most importantly that updates are
164
- // always synchronous.
165
-
166
-
167
- var value = getSnapshot();
168
-
169
- {
170
- if (!didWarnUncachedGetSnapshot) {
171
- var cachedValue = getSnapshot();
172
-
173
- if (!objectIs(value, cachedValue)) {
174
- error('The result of getSnapshot should be cached to avoid an infinite loop');
175
-
176
- didWarnUncachedGetSnapshot = true;
177
- }
178
- }
179
- } // Because updates are synchronous, we don't queue them. Instead we force a
180
- // re-render whenever the subscribed state changes by updating an some
181
- // arbitrary useState hook. Then, during render, we call getSnapshot to read
182
- // the current value.
183
- //
184
- // Because we don't actually use the state returned by the useState hook, we
185
- // can save a bit of memory by storing other stuff in that slot.
186
- //
187
- // To implement the early bailout, we need to track some things on a mutable
188
- // object. Usually, we would put that in a useRef hook, but we can stash it in
189
- // our useState hook instead.
190
- //
191
- // To force a re-render, we call forceUpdate({inst}). That works because the
192
- // new object always fails an equality check.
193
-
194
-
195
- var _useState = useState({
196
- inst: {
197
- value: value,
198
- getSnapshot: getSnapshot
199
- }
200
- }),
201
- inst = _useState[0].inst,
202
- forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated
203
- // in the layout phase so we can access it during the tearing check that
204
- // happens on subscribe.
205
-
206
-
207
- useLayoutEffect(function () {
208
- inst.value = value;
209
- inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the
210
- // commit phase if there was an interleaved mutation. In concurrent mode
211
- // this can happen all the time, but even in synchronous mode, an earlier
212
- // effect may have mutated the store.
213
-
214
- if (checkIfSnapshotChanged(inst)) {
215
- // Force a re-render.
216
- forceUpdate({
217
- inst: inst
218
- });
219
- }
220
- }, [subscribe, value, getSnapshot]);
221
- useEffect(function () {
222
- // Check for changes right before subscribing. Subsequent changes will be
223
- // detected in the subscription handler.
224
- if (checkIfSnapshotChanged(inst)) {
225
- // Force a re-render.
226
- forceUpdate({
227
- inst: inst
228
- });
229
- }
230
-
231
- var handleStoreChange = function () {
232
- // TODO: Because there is no cross-renderer API for batching updates, it's
233
- // up to the consumer of this library to wrap their subscription event
234
- // with unstable_batchedUpdates. Should we try to detect when this isn't
235
- // the case and print a warning in development?
236
- // The store changed. Check if the snapshot changed since the last time we
237
- // read from the store.
238
- if (checkIfSnapshotChanged(inst)) {
239
- // Force a re-render.
240
- forceUpdate({
241
- inst: inst
242
- });
243
- }
244
- }; // Subscribe to the store and return a clean-up function.
245
-
246
-
247
- return subscribe(handleStoreChange);
248
- }, [subscribe]);
249
- useDebugValue(value);
250
- return value;
251
- }
252
-
253
- function checkIfSnapshotChanged(inst) {
254
- var latestGetSnapshot = inst.getSnapshot;
255
- var prevValue = inst.value;
256
-
257
- try {
258
- var nextValue = latestGetSnapshot();
259
- return !objectIs(prevValue, nextValue);
260
- } catch (error) {
261
- return true;
262
- }
263
- }
264
-
265
- function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
266
- // Note: The shim does not use getServerSnapshot, because pre-18 versions of
267
- // React do not expose a way to check if we're hydrating. So users of the shim
268
- // will need to track that themselves and return the correct value
269
- // from `getSnapshot`.
270
- return getSnapshot();
271
- }
272
-
273
- var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
274
-
275
- var isServerEnvironment = !canUseDOM;
276
-
277
- var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
278
- var useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
279
-
280
- useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
281
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
282
- if (
283
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
284
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
285
- 'function'
286
- ) {
287
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
288
- }
289
-
290
- })();
291
- }
292
- return useSyncExternalStoreShim_development;
293
- }
294
-
295
- (function (module) {
296
-
297
- {
298
- module.exports = requireUseSyncExternalStoreShim_development();
299
- }
300
- } (shim));
301
-
302
47
  /**
303
48
  * match-sorter-utils
304
49
  *
@@ -997,6 +742,261 @@
997
742
  };
998
743
  }
999
744
 
745
+ var shim = {exports: {}};
746
+
747
+ var useSyncExternalStoreShim_development = {};
748
+
749
+ /**
750
+ * @license React
751
+ * use-sync-external-store-shim.development.js
752
+ *
753
+ * Copyright (c) Facebook, Inc. and its affiliates.
754
+ *
755
+ * This source code is licensed under the MIT license found in the
756
+ * LICENSE file in the root directory of this source tree.
757
+ */
758
+
759
+ var hasRequiredUseSyncExternalStoreShim_development;
760
+
761
+ function requireUseSyncExternalStoreShim_development () {
762
+ if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
763
+ hasRequiredUseSyncExternalStoreShim_development = 1;
764
+
765
+ {
766
+ (function() {
767
+
768
+ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
769
+ if (
770
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
771
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
772
+ 'function'
773
+ ) {
774
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
775
+ }
776
+ var React = React__default["default"];
777
+
778
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
779
+
780
+ function error(format) {
781
+ {
782
+ {
783
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
784
+ args[_key2 - 1] = arguments[_key2];
785
+ }
786
+
787
+ printWarning('error', format, args);
788
+ }
789
+ }
790
+ }
791
+
792
+ function printWarning(level, format, args) {
793
+ // When changing this logic, you might want to also
794
+ // update consoleWithStackDev.www.js as well.
795
+ {
796
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
797
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
798
+
799
+ if (stack !== '') {
800
+ format += '%s';
801
+ args = args.concat([stack]);
802
+ } // eslint-disable-next-line react-internal/safe-string-coercion
803
+
804
+
805
+ var argsWithFormat = args.map(function (item) {
806
+ return String(item);
807
+ }); // Careful: RN currently depends on this prefix
808
+
809
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
810
+ // breaks IE9: https://github.com/facebook/react/issues/13610
811
+ // eslint-disable-next-line react-internal/no-production-logging
812
+
813
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
814
+ }
815
+ }
816
+
817
+ /**
818
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
819
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
820
+ */
821
+ function is(x, y) {
822
+ return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
823
+ ;
824
+ }
825
+
826
+ var objectIs = typeof Object.is === 'function' ? Object.is : is;
827
+
828
+ // dispatch for CommonJS interop named imports.
829
+
830
+ var useState = React.useState,
831
+ useEffect = React.useEffect,
832
+ useLayoutEffect = React.useLayoutEffect,
833
+ useDebugValue = React.useDebugValue;
834
+ var didWarnOld18Alpha = false;
835
+ var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works
836
+ // because of a very particular set of implementation details and assumptions
837
+ // -- change any one of them and it will break. The most important assumption
838
+ // is that updates are always synchronous, because concurrent rendering is
839
+ // only available in versions of React that also have a built-in
840
+ // useSyncExternalStore API. And we only use this shim when the built-in API
841
+ // does not exist.
842
+ //
843
+ // Do not assume that the clever hacks used by this hook also work in general.
844
+ // The point of this shim is to replace the need for hacks by other libraries.
845
+
846
+ function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
847
+ // React do not expose a way to check if we're hydrating. So users of the shim
848
+ // will need to track that themselves and return the correct value
849
+ // from `getSnapshot`.
850
+ getServerSnapshot) {
851
+ {
852
+ if (!didWarnOld18Alpha) {
853
+ if (React.startTransition !== undefined) {
854
+ didWarnOld18Alpha = true;
855
+
856
+ error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');
857
+ }
858
+ }
859
+ } // Read the current snapshot from the store on every render. Again, this
860
+ // breaks the rules of React, and only works here because of specific
861
+ // implementation details, most importantly that updates are
862
+ // always synchronous.
863
+
864
+
865
+ var value = getSnapshot();
866
+
867
+ {
868
+ if (!didWarnUncachedGetSnapshot) {
869
+ var cachedValue = getSnapshot();
870
+
871
+ if (!objectIs(value, cachedValue)) {
872
+ error('The result of getSnapshot should be cached to avoid an infinite loop');
873
+
874
+ didWarnUncachedGetSnapshot = true;
875
+ }
876
+ }
877
+ } // Because updates are synchronous, we don't queue them. Instead we force a
878
+ // re-render whenever the subscribed state changes by updating an some
879
+ // arbitrary useState hook. Then, during render, we call getSnapshot to read
880
+ // the current value.
881
+ //
882
+ // Because we don't actually use the state returned by the useState hook, we
883
+ // can save a bit of memory by storing other stuff in that slot.
884
+ //
885
+ // To implement the early bailout, we need to track some things on a mutable
886
+ // object. Usually, we would put that in a useRef hook, but we can stash it in
887
+ // our useState hook instead.
888
+ //
889
+ // To force a re-render, we call forceUpdate({inst}). That works because the
890
+ // new object always fails an equality check.
891
+
892
+
893
+ var _useState = useState({
894
+ inst: {
895
+ value: value,
896
+ getSnapshot: getSnapshot
897
+ }
898
+ }),
899
+ inst = _useState[0].inst,
900
+ forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated
901
+ // in the layout phase so we can access it during the tearing check that
902
+ // happens on subscribe.
903
+
904
+
905
+ useLayoutEffect(function () {
906
+ inst.value = value;
907
+ inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the
908
+ // commit phase if there was an interleaved mutation. In concurrent mode
909
+ // this can happen all the time, but even in synchronous mode, an earlier
910
+ // effect may have mutated the store.
911
+
912
+ if (checkIfSnapshotChanged(inst)) {
913
+ // Force a re-render.
914
+ forceUpdate({
915
+ inst: inst
916
+ });
917
+ }
918
+ }, [subscribe, value, getSnapshot]);
919
+ useEffect(function () {
920
+ // Check for changes right before subscribing. Subsequent changes will be
921
+ // detected in the subscription handler.
922
+ if (checkIfSnapshotChanged(inst)) {
923
+ // Force a re-render.
924
+ forceUpdate({
925
+ inst: inst
926
+ });
927
+ }
928
+
929
+ var handleStoreChange = function () {
930
+ // TODO: Because there is no cross-renderer API for batching updates, it's
931
+ // up to the consumer of this library to wrap their subscription event
932
+ // with unstable_batchedUpdates. Should we try to detect when this isn't
933
+ // the case and print a warning in development?
934
+ // The store changed. Check if the snapshot changed since the last time we
935
+ // read from the store.
936
+ if (checkIfSnapshotChanged(inst)) {
937
+ // Force a re-render.
938
+ forceUpdate({
939
+ inst: inst
940
+ });
941
+ }
942
+ }; // Subscribe to the store and return a clean-up function.
943
+
944
+
945
+ return subscribe(handleStoreChange);
946
+ }, [subscribe]);
947
+ useDebugValue(value);
948
+ return value;
949
+ }
950
+
951
+ function checkIfSnapshotChanged(inst) {
952
+ var latestGetSnapshot = inst.getSnapshot;
953
+ var prevValue = inst.value;
954
+
955
+ try {
956
+ var nextValue = latestGetSnapshot();
957
+ return !objectIs(prevValue, nextValue);
958
+ } catch (error) {
959
+ return true;
960
+ }
961
+ }
962
+
963
+ function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
964
+ // Note: The shim does not use getServerSnapshot, because pre-18 versions of
965
+ // React do not expose a way to check if we're hydrating. So users of the shim
966
+ // will need to track that themselves and return the correct value
967
+ // from `getSnapshot`.
968
+ return getSnapshot();
969
+ }
970
+
971
+ var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
972
+
973
+ var isServerEnvironment = !canUseDOM;
974
+
975
+ var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
976
+ var useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
977
+
978
+ useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
979
+ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
980
+ if (
981
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
982
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
983
+ 'function'
984
+ ) {
985
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
986
+ }
987
+
988
+ })();
989
+ }
990
+ return useSyncExternalStoreShim_development;
991
+ }
992
+
993
+ (function (module) {
994
+
995
+ {
996
+ module.exports = requireUseSyncExternalStoreShim_development();
997
+ }
998
+ } (shim));
999
+
1000
1000
  const getItem = key => {
1001
1001
  try {
1002
1002
  const itemValue = localStorage.getItem(key);