@tanstack/react-query 5.0.0-alpha.85 → 5.0.0-alpha.87

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.
Files changed (414) hide show
  1. package/build/legacy/HydrationBoundary.cjs +58 -0
  2. package/build/legacy/HydrationBoundary.cjs.map +1 -0
  3. package/build/legacy/HydrationBoundary.d.cts +12 -0
  4. package/build/legacy/HydrationBoundary.d.ts +12 -0
  5. package/build/legacy/HydrationBoundary.js +24 -0
  6. package/build/legacy/HydrationBoundary.js.map +1 -0
  7. package/build/legacy/QueryClientProvider.cjs +69 -0
  8. package/build/legacy/QueryClientProvider.cjs.map +1 -0
  9. package/build/legacy/QueryClientProvider.d.cts +12 -0
  10. package/build/legacy/QueryClientProvider.d.ts +12 -0
  11. package/build/legacy/QueryClientProvider.js +33 -0
  12. package/build/legacy/QueryClientProvider.js.map +1 -0
  13. package/build/legacy/QueryErrorResetBoundary.cjs +64 -0
  14. package/build/legacy/QueryErrorResetBoundary.cjs.map +1 -0
  15. package/build/legacy/QueryErrorResetBoundary.d.cts +14 -0
  16. package/build/legacy/QueryErrorResetBoundary.d.ts +14 -0
  17. package/build/legacy/QueryErrorResetBoundary.js +29 -0
  18. package/build/legacy/QueryErrorResetBoundary.js.map +1 -0
  19. package/build/legacy/errorBoundaryUtils.cjs +65 -0
  20. package/build/legacy/errorBoundaryUtils.cjs.map +1 -0
  21. package/build/legacy/errorBoundaryUtils.d.cts +14 -0
  22. package/build/legacy/errorBoundaryUtils.d.ts +14 -0
  23. package/build/{lib → legacy}/errorBoundaryUtils.js +10 -9
  24. package/build/legacy/errorBoundaryUtils.js.map +1 -0
  25. package/build/legacy/index.cjs +74 -0
  26. package/build/legacy/index.cjs.map +1 -0
  27. package/build/legacy/index.d.cts +14 -0
  28. package/build/legacy/index.d.ts +14 -0
  29. package/build/legacy/index.js +39 -0
  30. package/build/legacy/index.js.map +1 -0
  31. package/build/legacy/isRestoring.cjs +45 -0
  32. package/build/legacy/isRestoring.cjs.map +1 -0
  33. package/build/legacy/isRestoring.d.cts +6 -0
  34. package/build/legacy/isRestoring.d.ts +6 -0
  35. package/build/legacy/isRestoring.js +10 -0
  36. package/build/legacy/isRestoring.js.map +1 -0
  37. package/build/legacy/queryOptions.cjs +31 -0
  38. package/build/legacy/queryOptions.cjs.map +1 -0
  39. package/build/legacy/queryOptions.d.cts +13 -0
  40. package/build/legacy/queryOptions.d.ts +13 -0
  41. package/build/legacy/queryOptions.js +7 -0
  42. package/build/legacy/queryOptions.js.map +1 -0
  43. package/build/legacy/suspense.cjs +46 -0
  44. package/build/legacy/suspense.cjs.map +1 -0
  45. package/build/legacy/suspense.d.cts +10 -0
  46. package/build/legacy/suspense.d.ts +10 -0
  47. package/build/{lib/suspense.legacy.js → legacy/suspense.js} +10 -8
  48. package/build/legacy/suspense.js.map +1 -0
  49. package/build/legacy/types.cjs +17 -0
  50. package/build/legacy/types.cjs.map +1 -0
  51. package/build/legacy/types.d.cts +28 -0
  52. package/build/legacy/types.d.ts +28 -0
  53. package/build/legacy/types.js +1 -0
  54. package/build/legacy/types.js.map +1 -0
  55. package/build/legacy/useBaseQuery.cjs +90 -0
  56. package/build/legacy/useBaseQuery.cjs.map +1 -0
  57. package/build/legacy/useBaseQuery.d.cts +92 -0
  58. package/build/legacy/useBaseQuery.d.ts +92 -0
  59. package/build/legacy/useBaseQuery.js +60 -0
  60. package/build/legacy/useBaseQuery.js.map +1 -0
  61. package/build/legacy/useInfiniteQuery.cjs +39 -0
  62. package/build/legacy/useInfiniteQuery.cjs.map +1 -0
  63. package/build/legacy/useInfiniteQuery.d.cts +6 -0
  64. package/build/legacy/useInfiniteQuery.d.ts +6 -0
  65. package/build/legacy/useInfiniteQuery.js +15 -0
  66. package/build/legacy/useInfiniteQuery.js.map +1 -0
  67. package/build/legacy/useIsFetching.cjs +54 -0
  68. package/build/legacy/useIsFetching.cjs.map +1 -0
  69. package/build/legacy/useIsFetching.d.cts +5 -0
  70. package/build/legacy/useIsFetching.d.ts +5 -0
  71. package/build/legacy/useIsFetching.js +20 -0
  72. package/build/legacy/useIsFetching.js.map +1 -0
  73. package/build/legacy/useMutation.cjs +75 -0
  74. package/build/legacy/useMutation.cjs.map +1 -0
  75. package/build/legacy/useMutation.d.cts +6 -0
  76. package/build/legacy/useMutation.d.ts +6 -0
  77. package/build/legacy/useMutation.js +41 -0
  78. package/build/legacy/useMutation.js.map +1 -0
  79. package/build/legacy/useMutationState.cjs +86 -0
  80. package/build/legacy/useMutationState.cjs.map +1 -0
  81. package/build/legacy/useMutationState.d.cts +10 -0
  82. package/build/legacy/useMutationState.d.ts +10 -0
  83. package/build/legacy/useMutationState.js +51 -0
  84. package/build/legacy/useMutationState.js.map +1 -0
  85. package/build/legacy/useQueries.cjs +126 -0
  86. package/build/legacy/useQueries.cjs.map +1 -0
  87. package/build/legacy/useQueries.d.cts +53 -0
  88. package/build/{lib → legacy}/useQueries.d.ts +8 -7
  89. package/build/legacy/useQueries.js +101 -0
  90. package/build/legacy/useQueries.js.map +1 -0
  91. package/build/legacy/useQuery.cjs +34 -0
  92. package/build/legacy/useQuery.cjs.map +1 -0
  93. package/build/legacy/useQuery.d.cts +8 -0
  94. package/build/legacy/useQuery.d.ts +8 -0
  95. package/build/legacy/useQuery.js +10 -0
  96. package/build/legacy/useQuery.js.map +1 -0
  97. package/build/legacy/utils.cjs +34 -0
  98. package/build/legacy/utils.cjs.map +1 -0
  99. package/build/legacy/utils.d.cts +3 -0
  100. package/build/legacy/utils.d.ts +3 -0
  101. package/build/legacy/utils.js +10 -0
  102. package/build/legacy/utils.js.map +1 -0
  103. package/build/modern/HydrationBoundary.cjs +58 -0
  104. package/build/modern/HydrationBoundary.cjs.map +1 -0
  105. package/build/modern/HydrationBoundary.d.cts +12 -0
  106. package/build/modern/HydrationBoundary.d.ts +12 -0
  107. package/build/modern/HydrationBoundary.js +24 -0
  108. package/build/modern/HydrationBoundary.js.map +1 -0
  109. package/build/modern/QueryClientProvider.cjs +69 -0
  110. package/build/modern/QueryClientProvider.cjs.map +1 -0
  111. package/build/modern/QueryClientProvider.d.cts +12 -0
  112. package/build/modern/QueryClientProvider.d.ts +12 -0
  113. package/build/modern/QueryClientProvider.js +33 -0
  114. package/build/modern/QueryClientProvider.js.map +1 -0
  115. package/build/modern/QueryErrorResetBoundary.cjs +64 -0
  116. package/build/modern/QueryErrorResetBoundary.cjs.map +1 -0
  117. package/build/modern/QueryErrorResetBoundary.d.cts +14 -0
  118. package/build/modern/QueryErrorResetBoundary.d.ts +14 -0
  119. package/build/modern/QueryErrorResetBoundary.js +29 -0
  120. package/build/modern/QueryErrorResetBoundary.js.map +1 -0
  121. package/build/modern/errorBoundaryUtils.cjs +65 -0
  122. package/build/modern/errorBoundaryUtils.cjs.map +1 -0
  123. package/build/modern/errorBoundaryUtils.d.cts +14 -0
  124. package/build/modern/errorBoundaryUtils.d.ts +14 -0
  125. package/build/{lib/errorBoundaryUtils.legacy.js → modern/errorBoundaryUtils.js} +10 -9
  126. package/build/modern/errorBoundaryUtils.js.map +1 -0
  127. package/build/modern/index.cjs +74 -0
  128. package/build/modern/index.cjs.map +1 -0
  129. package/build/modern/index.d.cts +14 -0
  130. package/build/modern/index.d.ts +14 -0
  131. package/build/modern/index.js +39 -0
  132. package/build/modern/index.js.map +1 -0
  133. package/build/modern/isRestoring.cjs +45 -0
  134. package/build/modern/isRestoring.cjs.map +1 -0
  135. package/build/modern/isRestoring.d.cts +6 -0
  136. package/build/modern/isRestoring.d.ts +6 -0
  137. package/build/modern/isRestoring.js +10 -0
  138. package/build/modern/isRestoring.js.map +1 -0
  139. package/build/modern/queryOptions.cjs +31 -0
  140. package/build/modern/queryOptions.cjs.map +1 -0
  141. package/build/modern/queryOptions.d.cts +13 -0
  142. package/build/modern/queryOptions.d.ts +13 -0
  143. package/build/modern/queryOptions.js +7 -0
  144. package/build/modern/queryOptions.js.map +1 -0
  145. package/build/modern/suspense.cjs +46 -0
  146. package/build/modern/suspense.cjs.map +1 -0
  147. package/build/modern/suspense.d.cts +10 -0
  148. package/build/modern/suspense.d.ts +10 -0
  149. package/build/{lib → modern}/suspense.js +10 -8
  150. package/build/modern/suspense.js.map +1 -0
  151. package/build/modern/types.cjs +17 -0
  152. package/build/modern/types.cjs.map +1 -0
  153. package/build/modern/types.d.cts +28 -0
  154. package/build/modern/types.d.ts +28 -0
  155. package/build/modern/types.js +1 -0
  156. package/build/modern/types.js.map +1 -0
  157. package/build/modern/useBaseQuery.cjs +90 -0
  158. package/build/modern/useBaseQuery.cjs.map +1 -0
  159. package/build/modern/useBaseQuery.d.cts +92 -0
  160. package/build/modern/useBaseQuery.d.ts +92 -0
  161. package/build/modern/useBaseQuery.js +60 -0
  162. package/build/modern/useBaseQuery.js.map +1 -0
  163. package/build/modern/useInfiniteQuery.cjs +39 -0
  164. package/build/modern/useInfiniteQuery.cjs.map +1 -0
  165. package/build/modern/useInfiniteQuery.d.cts +6 -0
  166. package/build/modern/useInfiniteQuery.d.ts +6 -0
  167. package/build/modern/useInfiniteQuery.js +15 -0
  168. package/build/modern/useInfiniteQuery.js.map +1 -0
  169. package/build/modern/useIsFetching.cjs +54 -0
  170. package/build/modern/useIsFetching.cjs.map +1 -0
  171. package/build/modern/useIsFetching.d.cts +5 -0
  172. package/build/modern/useIsFetching.d.ts +5 -0
  173. package/build/modern/useIsFetching.js +20 -0
  174. package/build/modern/useIsFetching.js.map +1 -0
  175. package/build/modern/useMutation.cjs +75 -0
  176. package/build/modern/useMutation.cjs.map +1 -0
  177. package/build/modern/useMutation.d.cts +6 -0
  178. package/build/modern/useMutation.d.ts +6 -0
  179. package/build/modern/useMutation.js +41 -0
  180. package/build/modern/useMutation.js.map +1 -0
  181. package/build/modern/useMutationState.cjs +86 -0
  182. package/build/modern/useMutationState.cjs.map +1 -0
  183. package/build/modern/useMutationState.d.cts +10 -0
  184. package/build/modern/useMutationState.d.ts +10 -0
  185. package/build/modern/useMutationState.js +51 -0
  186. package/build/modern/useMutationState.js.map +1 -0
  187. package/build/modern/useQueries.cjs +123 -0
  188. package/build/modern/useQueries.cjs.map +1 -0
  189. package/build/modern/useQueries.d.cts +53 -0
  190. package/build/modern/useQueries.d.ts +53 -0
  191. package/build/modern/useQueries.js +98 -0
  192. package/build/modern/useQueries.js.map +1 -0
  193. package/build/modern/useQuery.cjs +34 -0
  194. package/build/modern/useQuery.cjs.map +1 -0
  195. package/build/modern/useQuery.d.cts +8 -0
  196. package/build/modern/useQuery.d.ts +8 -0
  197. package/build/modern/useQuery.js +10 -0
  198. package/build/modern/useQuery.js.map +1 -0
  199. package/build/modern/utils.cjs +34 -0
  200. package/build/modern/utils.cjs.map +1 -0
  201. package/build/modern/utils.d.cts +3 -0
  202. package/build/modern/utils.d.ts +3 -0
  203. package/build/modern/utils.js +10 -0
  204. package/build/modern/utils.js.map +1 -0
  205. package/package.json +18 -16
  206. package/src/__tests__/useMutation.test.tsx +16 -17
  207. package/src/__tests__/useQuery.test.tsx +27 -56
  208. package/src/__tests__/utils.tsx +6 -3
  209. package/build/codemods/__testfixtures__/default-import.input.tsx +0 -94
  210. package/build/codemods/__testfixtures__/default-import.output.tsx +0 -96
  211. package/build/codemods/__testfixtures__/named-import.input.tsx +0 -96
  212. package/build/codemods/__testfixtures__/named-import.output.tsx +0 -98
  213. package/build/codemods/__testfixtures__/namespaced-import.input.tsx +0 -86
  214. package/build/codemods/__testfixtures__/namespaced-import.output.tsx +0 -88
  215. package/build/codemods/__testfixtures__/parameter-is-identifier.input.tsx +0 -49
  216. package/build/codemods/__testfixtures__/parameter-is-identifier.output.tsx +0 -49
  217. package/build/codemods/__testfixtures__/parameter-is-object-expression.input.tsx +0 -128
  218. package/build/codemods/__testfixtures__/parameter-is-object-expression.output.tsx +0 -175
  219. package/build/codemods/__testfixtures__/replace-import-specifier.input.tsx +0 -10
  220. package/build/codemods/__testfixtures__/replace-import-specifier.output.tsx +0 -10
  221. package/build/codemods/__testfixtures__/type-arguments.input.tsx +0 -25
  222. package/build/codemods/__testfixtures__/type-arguments.output.tsx +0 -31
  223. package/build/codemods/__tests__/key-transformation.test.js +0 -32
  224. package/build/codemods/__tests__/replace-import-specifier.test.js +0 -12
  225. package/build/codemods/remove-overloads/__testfixtures__/default-import.input.tsx +0 -199
  226. package/build/codemods/remove-overloads/__testfixtures__/default-import.output.tsx +0 -484
  227. package/build/codemods/remove-overloads/__tests__/remove-overloads.test.js +0 -6
  228. package/build/lib/HydrationBoundary.cjs +0 -50
  229. package/build/lib/HydrationBoundary.cjs.map +0 -1
  230. package/build/lib/HydrationBoundary.d.ts +0 -10
  231. package/build/lib/HydrationBoundary.d.ts.map +0 -1
  232. package/build/lib/HydrationBoundary.js +0 -29
  233. package/build/lib/HydrationBoundary.js.map +0 -1
  234. package/build/lib/HydrationBoundary.legacy.cjs +0 -50
  235. package/build/lib/HydrationBoundary.legacy.cjs.map +0 -1
  236. package/build/lib/HydrationBoundary.legacy.js +0 -29
  237. package/build/lib/HydrationBoundary.legacy.js.map +0 -1
  238. package/build/lib/QueryClientProvider.cjs +0 -54
  239. package/build/lib/QueryClientProvider.cjs.map +0 -1
  240. package/build/lib/QueryClientProvider.d.ts +0 -10
  241. package/build/lib/QueryClientProvider.d.ts.map +0 -1
  242. package/build/lib/QueryClientProvider.js +0 -31
  243. package/build/lib/QueryClientProvider.js.map +0 -1
  244. package/build/lib/QueryClientProvider.legacy.cjs +0 -54
  245. package/build/lib/QueryClientProvider.legacy.cjs.map +0 -1
  246. package/build/lib/QueryClientProvider.legacy.js +0 -31
  247. package/build/lib/QueryClientProvider.legacy.js.map +0 -1
  248. package/build/lib/QueryErrorResetBoundary.cjs +0 -60
  249. package/build/lib/QueryErrorResetBoundary.cjs.map +0 -1
  250. package/build/lib/QueryErrorResetBoundary.d.ts +0 -12
  251. package/build/lib/QueryErrorResetBoundary.d.ts.map +0 -1
  252. package/build/lib/QueryErrorResetBoundary.js +0 -38
  253. package/build/lib/QueryErrorResetBoundary.js.map +0 -1
  254. package/build/lib/QueryErrorResetBoundary.legacy.cjs +0 -60
  255. package/build/lib/QueryErrorResetBoundary.legacy.cjs.map +0 -1
  256. package/build/lib/QueryErrorResetBoundary.legacy.js +0 -38
  257. package/build/lib/QueryErrorResetBoundary.legacy.js.map +0 -1
  258. package/build/lib/__tests__/HydrationBoundary.test.d.ts +0 -2
  259. package/build/lib/__tests__/HydrationBoundary.test.d.ts.map +0 -1
  260. package/build/lib/__tests__/QueryClientProvider.test.d.ts +0 -2
  261. package/build/lib/__tests__/QueryClientProvider.test.d.ts.map +0 -1
  262. package/build/lib/__tests__/QueryResetErrorBoundary.test.d.ts +0 -7
  263. package/build/lib/__tests__/QueryResetErrorBoundary.test.d.ts.map +0 -1
  264. package/build/lib/__tests__/ssr-hydration.test.d.ts +0 -2
  265. package/build/lib/__tests__/ssr-hydration.test.d.ts.map +0 -1
  266. package/build/lib/__tests__/ssr.test.d.ts +0 -2
  267. package/build/lib/__tests__/ssr.test.d.ts.map +0 -1
  268. package/build/lib/__tests__/suspense.test.d.ts +0 -2
  269. package/build/lib/__tests__/suspense.test.d.ts.map +0 -1
  270. package/build/lib/__tests__/useInfiniteQuery.test.d.ts +0 -2
  271. package/build/lib/__tests__/useInfiniteQuery.test.d.ts.map +0 -1
  272. package/build/lib/__tests__/useInfiniteQuery.type.test.d.ts +0 -2
  273. package/build/lib/__tests__/useInfiniteQuery.type.test.d.ts.map +0 -1
  274. package/build/lib/__tests__/useIsFetching.test.d.ts +0 -2
  275. package/build/lib/__tests__/useIsFetching.test.d.ts.map +0 -1
  276. package/build/lib/__tests__/useMutation.test.d.ts +0 -2
  277. package/build/lib/__tests__/useMutation.test.d.ts.map +0 -1
  278. package/build/lib/__tests__/useMutationState.test.d.ts +0 -2
  279. package/build/lib/__tests__/useMutationState.test.d.ts.map +0 -1
  280. package/build/lib/__tests__/useQueries.test.d.ts +0 -2
  281. package/build/lib/__tests__/useQueries.test.d.ts.map +0 -1
  282. package/build/lib/__tests__/useQuery.test.d.ts +0 -2
  283. package/build/lib/__tests__/useQuery.test.d.ts.map +0 -1
  284. package/build/lib/__tests__/useQuery.types.test.d.ts +0 -2
  285. package/build/lib/__tests__/useQuery.types.test.d.ts.map +0 -1
  286. package/build/lib/__tests__/utils.d.ts +0 -30
  287. package/build/lib/__tests__/utils.d.ts.map +0 -1
  288. package/build/lib/errorBoundaryUtils.cjs +0 -51
  289. package/build/lib/errorBoundaryUtils.cjs.map +0 -1
  290. package/build/lib/errorBoundaryUtils.d.ts +0 -11
  291. package/build/lib/errorBoundaryUtils.d.ts.map +0 -1
  292. package/build/lib/errorBoundaryUtils.js.map +0 -1
  293. package/build/lib/errorBoundaryUtils.legacy.cjs +0 -51
  294. package/build/lib/errorBoundaryUtils.legacy.cjs.map +0 -1
  295. package/build/lib/errorBoundaryUtils.legacy.js.map +0 -1
  296. package/build/lib/index.cjs +0 -40
  297. package/build/lib/index.cjs.map +0 -1
  298. package/build/lib/index.d.ts +0 -18
  299. package/build/lib/index.d.ts.map +0 -1
  300. package/build/lib/index.js +0 -13
  301. package/build/lib/index.js.map +0 -1
  302. package/build/lib/index.legacy.cjs +0 -40
  303. package/build/lib/index.legacy.cjs.map +0 -1
  304. package/build/lib/index.legacy.js +0 -13
  305. package/build/lib/index.legacy.js.map +0 -1
  306. package/build/lib/isRestoring.cjs +0 -31
  307. package/build/lib/isRestoring.cjs.map +0 -1
  308. package/build/lib/isRestoring.d.ts +0 -4
  309. package/build/lib/isRestoring.d.ts.map +0 -1
  310. package/build/lib/isRestoring.js +0 -9
  311. package/build/lib/isRestoring.js.map +0 -1
  312. package/build/lib/isRestoring.legacy.cjs +0 -31
  313. package/build/lib/isRestoring.legacy.cjs.map +0 -1
  314. package/build/lib/isRestoring.legacy.js +0 -9
  315. package/build/lib/isRestoring.legacy.js.map +0 -1
  316. package/build/lib/queryOptions.cjs +0 -8
  317. package/build/lib/queryOptions.cjs.map +0 -1
  318. package/build/lib/queryOptions.d.ts +0 -11
  319. package/build/lib/queryOptions.d.ts.map +0 -1
  320. package/build/lib/queryOptions.js +0 -6
  321. package/build/lib/queryOptions.js.map +0 -1
  322. package/build/lib/queryOptions.legacy.cjs +0 -8
  323. package/build/lib/queryOptions.legacy.cjs.map +0 -1
  324. package/build/lib/queryOptions.legacy.js +0 -6
  325. package/build/lib/queryOptions.legacy.js.map +0 -1
  326. package/build/lib/suspense.cjs +0 -22
  327. package/build/lib/suspense.cjs.map +0 -1
  328. package/build/lib/suspense.d.ts +0 -7
  329. package/build/lib/suspense.d.ts.map +0 -1
  330. package/build/lib/suspense.js.map +0 -1
  331. package/build/lib/suspense.legacy.cjs +0 -22
  332. package/build/lib/suspense.legacy.cjs.map +0 -1
  333. package/build/lib/suspense.legacy.js.map +0 -1
  334. package/build/lib/types.d.ts +0 -27
  335. package/build/lib/types.d.ts.map +0 -1
  336. package/build/lib/useBaseQuery.cjs +0 -80
  337. package/build/lib/useBaseQuery.cjs.map +0 -1
  338. package/build/lib/useBaseQuery.d.ts +0 -4
  339. package/build/lib/useBaseQuery.d.ts.map +0 -1
  340. package/build/lib/useBaseQuery.js +0 -59
  341. package/build/lib/useBaseQuery.js.map +0 -1
  342. package/build/lib/useBaseQuery.legacy.cjs +0 -80
  343. package/build/lib/useBaseQuery.legacy.cjs.map +0 -1
  344. package/build/lib/useBaseQuery.legacy.js +0 -59
  345. package/build/lib/useBaseQuery.legacy.js.map +0 -1
  346. package/build/lib/useInfiniteQuery.cjs +0 -15
  347. package/build/lib/useInfiniteQuery.cjs.map +0 -1
  348. package/build/lib/useInfiniteQuery.d.ts +0 -4
  349. package/build/lib/useInfiniteQuery.d.ts.map +0 -1
  350. package/build/lib/useInfiniteQuery.js +0 -13
  351. package/build/lib/useInfiniteQuery.js.map +0 -1
  352. package/build/lib/useInfiniteQuery.legacy.cjs +0 -15
  353. package/build/lib/useInfiniteQuery.legacy.cjs.map +0 -1
  354. package/build/lib/useInfiniteQuery.legacy.js +0 -13
  355. package/build/lib/useInfiniteQuery.legacy.js.map +0 -1
  356. package/build/lib/useIsFetching.cjs +0 -34
  357. package/build/lib/useIsFetching.cjs.map +0 -1
  358. package/build/lib/useIsFetching.d.ts +0 -3
  359. package/build/lib/useIsFetching.d.ts.map +0 -1
  360. package/build/lib/useIsFetching.js +0 -13
  361. package/build/lib/useIsFetching.js.map +0 -1
  362. package/build/lib/useIsFetching.legacy.cjs +0 -34
  363. package/build/lib/useIsFetching.legacy.cjs.map +0 -1
  364. package/build/lib/useIsFetching.legacy.js +0 -13
  365. package/build/lib/useIsFetching.legacy.js.map +0 -1
  366. package/build/lib/useMutation.cjs +0 -54
  367. package/build/lib/useMutation.cjs.map +0 -1
  368. package/build/lib/useMutation.d.ts +0 -4
  369. package/build/lib/useMutation.d.ts.map +0 -1
  370. package/build/lib/useMutation.js +0 -33
  371. package/build/lib/useMutation.js.map +0 -1
  372. package/build/lib/useMutation.legacy.cjs +0 -54
  373. package/build/lib/useMutation.legacy.cjs.map +0 -1
  374. package/build/lib/useMutation.legacy.js +0 -33
  375. package/build/lib/useMutation.legacy.js.map +0 -1
  376. package/build/lib/useMutationState.cjs +0 -60
  377. package/build/lib/useMutationState.cjs.map +0 -1
  378. package/build/lib/useMutationState.d.ts +0 -9
  379. package/build/lib/useMutationState.d.ts.map +0 -1
  380. package/build/lib/useMutationState.js +0 -38
  381. package/build/lib/useMutationState.js.map +0 -1
  382. package/build/lib/useMutationState.legacy.cjs +0 -60
  383. package/build/lib/useMutationState.legacy.cjs.map +0 -1
  384. package/build/lib/useMutationState.legacy.js +0 -38
  385. package/build/lib/useMutationState.legacy.js.map +0 -1
  386. package/build/lib/useQueries.cjs +0 -99
  387. package/build/lib/useQueries.cjs.map +0 -1
  388. package/build/lib/useQueries.d.ts.map +0 -1
  389. package/build/lib/useQueries.js +0 -78
  390. package/build/lib/useQueries.js.map +0 -1
  391. package/build/lib/useQueries.legacy.cjs +0 -102
  392. package/build/lib/useQueries.legacy.cjs.map +0 -1
  393. package/build/lib/useQueries.legacy.js +0 -81
  394. package/build/lib/useQueries.legacy.js.map +0 -1
  395. package/build/lib/useQuery.cjs +0 -14
  396. package/build/lib/useQuery.cjs.map +0 -1
  397. package/build/lib/useQuery.d.ts +0 -6
  398. package/build/lib/useQuery.d.ts.map +0 -1
  399. package/build/lib/useQuery.js +0 -12
  400. package/build/lib/useQuery.js.map +0 -1
  401. package/build/lib/useQuery.legacy.cjs +0 -14
  402. package/build/lib/useQuery.legacy.cjs.map +0 -1
  403. package/build/lib/useQuery.legacy.js +0 -12
  404. package/build/lib/useQuery.legacy.js.map +0 -1
  405. package/build/lib/utils.cjs +0 -12
  406. package/build/lib/utils.cjs.map +0 -1
  407. package/build/lib/utils.d.ts +0 -2
  408. package/build/lib/utils.d.ts.map +0 -1
  409. package/build/lib/utils.js +0 -10
  410. package/build/lib/utils.js.map +0 -1
  411. package/build/lib/utils.legacy.cjs +0 -12
  412. package/build/lib/utils.legacy.cjs.map +0 -1
  413. package/build/lib/utils.legacy.js +0 -10
  414. package/build/lib/utils.legacy.js.map +0 -1
@@ -1,484 +0,0 @@
1
- import * as React from 'react'
2
- import {
3
- useIsFetching,
4
- useIsMutating,
5
- useQueryClient,
6
- } from '@tanstack/react-query'
7
- import { queryKeysFromAnotherModule } from '../another/module'
8
-
9
- export const WithKnownParameters = () => {
10
- useIsFetching({
11
- queryKey: ['foo', 'bar']
12
- })
13
- useIsFetching({
14
- queryKey: ['foo', 'bar'],
15
- type: 'all',
16
- exact: true
17
- })
18
- useIsFetching({
19
- queryKey: ['foo', 'bar'],
20
- type: 'all',
21
- exact: true
22
- }, { context: undefined })
23
- useIsFetching({
24
- queryKey: ['foo', 'bar'],
25
- type: 'all',
26
- exact: true
27
- })
28
- useIsFetching({
29
- queryKey: ['foo', 'bar'],
30
- type: 'all',
31
- exact: true
32
- }, { context: undefined })
33
- useIsFetching({ queryKey: ['foo', 'bar'], type: 'all', exact: true })
34
- useIsFetching({ queryKey: ['foo', 'bar'], type: 'all', exact: true }, { context: undefined })
35
-
36
- useIsMutating({
37
- mutationKey: ['foo', 'bar']
38
- })
39
- useIsMutating({
40
- mutationKey: ['foo', 'bar'],
41
- exact: true
42
- })
43
- useIsMutating({
44
- mutationKey: ['foo', 'bar'],
45
- exact: true
46
- }, { context: undefined })
47
- useIsMutating({ mutationKey: ['foo', 'bar'], exact: true })
48
- useIsMutating({ mutationKey: ['foo', 'bar'], exact: true }, { context: undefined })
49
-
50
- // QueryClient methods
51
- // --- Instantiated hook call.
52
- const queryClient = useQueryClient()
53
- queryClient.cancelQueries({
54
- queryKey: ['foo', 'bar']
55
- })
56
- queryClient.cancelQueries({
57
- queryKey: ['foo', 'bar'],
58
- type: 'all',
59
- exact: true
60
- })
61
- queryClient.cancelQueries({
62
- queryKey: ['foo', 'bar'],
63
- type: 'all',
64
- exact: true
65
- }, { silent: true })
66
- queryClient.cancelQueries({
67
- queryKey: ['foo', 'bar'],
68
- type: 'all',
69
- exact: true
70
- })
71
- queryClient.cancelQueries({
72
- queryKey: ['foo', 'bar'],
73
- type: 'all',
74
- exact: true
75
- }, { silent: true })
76
- queryClient.cancelQueries({ queryKey: ['foo', 'bar'], type: 'all', exact: true })
77
- queryClient.cancelQueries({ queryKey: ['foo', 'bar'], type: 'all', exact: true }, { silent: true })
78
-
79
- queryClient.getQueriesData({
80
- queryKey: ['foo', 'bar']
81
- })
82
- queryClient.getQueriesData({ queryKey: ['foo', 'bar'], type: 'all', exact: true })
83
-
84
- queryClient.invalidateQueries({
85
- queryKey: ['foo', 'bar']
86
- })
87
- queryClient.invalidateQueries({
88
- queryKey: ['foo', 'bar'],
89
- type: 'all',
90
- exact: true
91
- })
92
- queryClient.invalidateQueries({
93
- queryKey: ['foo', 'bar'],
94
- type: 'all',
95
- exact: true
96
- }, { cancelRefetch: false, throwOnError: true })
97
- queryClient.invalidateQueries({
98
- queryKey: ['foo', 'bar'],
99
- type: 'all',
100
- exact: true
101
- })
102
- queryClient.invalidateQueries({
103
- queryKey: ['foo', 'bar'],
104
- type: 'all',
105
- exact: true
106
- }, { cancelRefetch: false, throwOnError: true })
107
- queryClient.invalidateQueries({ queryKey: ['foo', 'bar'], type: 'all', exact: true })
108
- queryClient.invalidateQueries({ queryKey: ['foo', 'bar'], type: 'all', exact: true }, { cancelRefetch: false, throwOnError: true })
109
-
110
- queryClient.isFetching({
111
- queryKey: ['foo', 'bar']
112
- })
113
- queryClient.isFetching({
114
- queryKey: ['foo', 'bar'],
115
- type: 'all',
116
- exact: true
117
- })
118
- queryClient.isFetching({
119
- queryKey: ['foo', 'bar'],
120
- type: 'all',
121
- exact: true
122
- })
123
- queryClient.isFetching({ queryKey: ['foo', 'bar'], type: 'all', exact: true })
124
-
125
- queryClient.refetchQueries({
126
- queryKey: ['foo', 'bar']
127
- })
128
- queryClient.refetchQueries({
129
- queryKey: ['foo', 'bar'],
130
- type: 'all',
131
- exact: true
132
- })
133
- queryClient.refetchQueries({
134
- queryKey: ['foo', 'bar'],
135
- type: 'all',
136
- exact: true
137
- }, { cancelRefetch: false, throwOnError: true })
138
- queryClient.refetchQueries({
139
- queryKey: ['foo', 'bar'],
140
- type: 'all',
141
- exact: true
142
- })
143
- queryClient.refetchQueries({
144
- queryKey: ['foo', 'bar'],
145
- type: 'all',
146
- exact: true
147
- }, { cancelRefetch: false, throwOnError: true })
148
- queryClient.refetchQueries({ queryKey: ['foo', 'bar'], type: 'all', exact: true })
149
- queryClient.refetchQueries({ queryKey: ['foo', 'bar'], type: 'all', exact: true }, { cancelRefetch: false, throwOnError: true })
150
-
151
- queryClient.removeQueries({
152
- queryKey: ['foo', 'bar']
153
- })
154
- queryClient.removeQueries({
155
- queryKey: ['foo', 'bar'],
156
- type: 'all',
157
- exact: true
158
- })
159
- queryClient.removeQueries({ queryKey: ['foo', 'bar'], type: 'all', exact: true })
160
-
161
- queryClient.resetQueries({
162
- queryKey: ['foo', 'bar']
163
- })
164
- queryClient.resetQueries({
165
- queryKey: ['foo', 'bar'],
166
- type: 'all',
167
- exact: true
168
- })
169
- queryClient.resetQueries({
170
- queryKey: ['foo', 'bar'],
171
- type: 'all',
172
- exact: true
173
- }, { cancelRefetch: false, throwOnError: true })
174
- queryClient.resetQueries({
175
- queryKey: ['foo', 'bar'],
176
- type: 'all',
177
- exact: true
178
- })
179
- queryClient.resetQueries({
180
- queryKey: ['foo', 'bar'],
181
- type: 'all',
182
- exact: true
183
- }, { cancelRefetch: false, throwOnError: true })
184
- queryClient.resetQueries({ queryKey: ['foo', 'bar'], exact: true })
185
- queryClient.resetQueries({ queryKey: ['foo', 'bar'], exact: true }, { cancelRefetch: false, throwOnError: true })
186
-
187
- queryClient.setQueriesData(['foo', 'bar'], null)
188
- queryClient.setQueriesData(['foo', 'bar'], null, { updatedAt: 1000 })
189
- queryClient.setQueriesData({ queryKey: ['foo', 'bar'] }, null)
190
- queryClient.setQueriesData({ queryKey: ['foo', 'bar'] }, null, { updatedAt: 1000 })
191
-
192
- queryClient.fetchQuery({
193
- queryKey: ['foo', 'bar']
194
- })
195
- queryClient.fetchQuery({
196
- queryKey: ['foo', 'bar'],
197
- staleTime: 1000
198
- })
199
- queryClient.fetchQuery({
200
- queryKey: ['foo', 'bar'],
201
- queryFn: () => 'data',
202
- staleTime: 1000
203
- })
204
- queryClient.fetchQuery({
205
- queryKey: ['foo', 'bar'],
206
- queryFn: () => 'data',
207
- staleTime: 1000
208
- })
209
- queryClient.fetchQuery({
210
- queryKey: ['foo', 'bar'],
211
- queryFn: function myFn() { return 'data' },
212
- staleTime: 1000
213
- })
214
- queryClient.fetchQuery({ queryKey: ['foo', 'bar'], queryFn: () => 'data', retry: true })
215
-
216
- const queryCache = queryClient.getQueryCache()
217
-
218
- queryCache.find({
219
- queryKey: ['foo', 'bar']
220
- })
221
- queryCache.find({
222
- queryKey: ['foo', 'bar'],
223
- type: 'all',
224
- exact: true
225
- })
226
- queryCache.find({
227
- queryKey: ['foo', 'bar'],
228
- type: 'all',
229
- exact: true
230
- })
231
-
232
- queryCache.findAll({
233
- queryKey: ['foo', 'bar']
234
- })
235
- queryCache.findAll({
236
- queryKey: ['foo', 'bar'],
237
- type: 'all',
238
- exact: true
239
- })
240
- queryCache.findAll({
241
- queryKey: ['foo', 'bar'],
242
- type: 'all',
243
- exact: true
244
- })
245
- queryCache.findAll({ queryKey: ['foo', 'bar'], type: 'all', exact: true })
246
-
247
- return <div>Example Component</div>
248
- }
249
-
250
- const globalQueryKey = ['module', 'level']
251
-
252
- export const WithIdentifiers = () => {
253
- const queryKey = ['foo', 'bar']
254
- const mutationKey = ['posts', 'articles']
255
- const filters = { type: 'all', exact: true } as const
256
- const options = { context: undefined } as const
257
- const mutationOptions = { exact: true, fetching: false } as const
258
- const cancelOptions = { silent: true } as const
259
- const invalidateOptions = { cancelRefetch: true, throwOnError: true } as const
260
- const refetchOptions = { cancelRefetch: false, throwOnError: true } as const
261
- const resetOptions = { cancelRefetch: false, throwOnError: true } as const
262
- const fetchOptions = { queryFn: () => 'data', retry: true } as const
263
- const queryFn = () => 'data'
264
-
265
- useIsFetching({
266
- queryKey: queryKey
267
- })
268
- useIsFetching({
269
- queryKey: queryKey,
270
- ...filters
271
- })
272
- useIsFetching({
273
- queryKey: queryKey,
274
- ...filters
275
- }, options)
276
- useIsFetching({
277
- queryKey: queryKey,
278
- type: 'all',
279
- exact: true
280
- })
281
- useIsFetching({
282
- queryKey: queryKey,
283
- type: 'all',
284
- exact: true
285
- }, { context: undefined })
286
- useIsFetching({
287
- queryKey: queryKey,
288
- ...filters
289
- }, options)
290
- useIsFetching({ queryKey: queryKey, ...filters })
291
- useIsFetching({ queryKey: queryKey, ...filters }, { context: undefined })
292
-
293
- useIsMutating({
294
- mutationKey: mutationKey
295
- })
296
- useIsMutating({
297
- mutationKey: mutationKey,
298
- exact: true,
299
- status: 'idle'
300
- })
301
- useIsMutating({
302
- mutationKey: mutationKey,
303
- ...mutationOptions,
304
- exact: false
305
- })
306
- useIsMutating({ mutationKey, ...mutationOptions })
307
- useIsMutating({ mutationKey: ['foo', 'bar'], exact: true, status: 'idle' })
308
-
309
- // QueryClient methods
310
- // --- Instantiated hook call.
311
- const queryClient = useQueryClient()
312
- queryClient.cancelQueries({
313
- queryKey: queryKey
314
- })
315
- queryClient.cancelQueries({
316
- queryKey: queryKey,
317
- ...filters
318
- })
319
- queryClient.cancelQueries({
320
- queryKey: queryKey,
321
- ...filters
322
- }, cancelOptions)
323
- queryClient.cancelQueries({
324
- queryKey: queryKey,
325
- type: 'all',
326
- exact: true
327
- })
328
- queryClient.cancelQueries({
329
- queryKey: queryKey,
330
- type: 'all',
331
- exact: true
332
- }, { revert: true })
333
- queryClient.cancelQueries({
334
- queryKey: queryKey,
335
- ...filters
336
- }, cancelOptions)
337
- queryClient.cancelQueries({ queryKey: queryKey, type: 'all', exact: true })
338
- queryClient.cancelQueries({ queryKey: ['foo', 'bar'], ...filters }, cancelOptions)
339
-
340
- queryClient.getQueriesData({
341
- queryKey: globalQueryKey
342
- })
343
- queryClient.getQueriesData({ queryKey: globalQueryKey, ...filters })
344
- queryClient.getQueriesData({ queryKey: ['foo', 'bar'], type: 'all' })
345
-
346
- queryClient.invalidateQueries({
347
- queryKey: queryKey
348
- })
349
- queryClient.invalidateQueries({
350
- queryKey: queryKey,
351
- ...filters
352
- })
353
- queryClient.invalidateQueries({
354
- queryKey: queryKey,
355
- ...filters
356
- }, invalidateOptions)
357
- queryClient.invalidateQueries({
358
- queryKey: queryKey,
359
- stale: true,
360
- ...filters
361
- })
362
- queryClient.invalidateQueries({
363
- queryKey: queryKey,
364
- stale: true,
365
- ...filters
366
- }, invalidateOptions)
367
- queryClient.invalidateQueries({ queryKey: globalQueryKey, ...filters, stale: true })
368
- queryClient.invalidateQueries({ queryKey: globalQueryKey, ...filters, stale: true }, invalidateOptions)
369
-
370
- queryClient.isFetching({
371
- queryKey: globalQueryKey
372
- })
373
- queryClient.isFetching({
374
- queryKey: globalQueryKey,
375
- ...filters
376
- })
377
- queryClient.isFetching({
378
- queryKey: globalQueryKey,
379
- type: 'all',
380
- exact: true
381
- })
382
- queryClient.isFetching({
383
- queryKey: globalQueryKey,
384
- ...filters
385
- })
386
- queryClient.isFetching({ queryKey: globalQueryKey, ...filters, stale: true })
387
- // Stays as it is because the code couldn't infer the type of the "queryKeysFromAnotherModule" identifier.
388
- queryClient.isFetching(queryKeysFromAnotherModule)
389
-
390
- queryClient.refetchQueries({
391
- queryKey: queryKey
392
- })
393
- queryClient.refetchQueries({
394
- queryKey: queryKey,
395
- ...filters
396
- })
397
- queryClient.refetchQueries({
398
- queryKey: queryKey,
399
- ...filters
400
- }, refetchOptions)
401
- queryClient.refetchQueries({
402
- queryKey: queryKey,
403
- ...filters
404
- }, { ...refetchOptions, cancelRefetch: true })
405
- queryClient.refetchQueries({ queryKey: queryKey, ...filters })
406
- queryClient.refetchQueries({ queryKey: queryKey, ...filters }, { ...refetchOptions, cancelRefetch: true })
407
- // Stays as it is because the code couldn't infer the type of the "queryKeysFromAnotherModule" identifier.
408
- queryClient.refetchQueries(queryKeysFromAnotherModule)
409
- queryClient.refetchQueries(queryKeysFromAnotherModule, filters)
410
- queryClient.refetchQueries(queryKeysFromAnotherModule, filters, refetchOptions)
411
-
412
- queryClient.removeQueries({
413
- queryKey: queryKey
414
- })
415
- queryClient.removeQueries({
416
- queryKey: queryKey,
417
- ...filters
418
- })
419
- queryClient.removeQueries({
420
- queryKey: queryKey,
421
- ...filters,
422
- stale: true
423
- })
424
- queryClient.removeQueries({ queryKey, ...filters, stale: true })
425
- // Stays as it is because the code couldn't infer the type of the "queryKeysFromAnotherModule" identifier.
426
- queryClient.removeQueries(queryKeysFromAnotherModule)
427
- queryClient.removeQueries(queryKeysFromAnotherModule, filters)
428
-
429
- queryClient.resetQueries({
430
- queryKey: queryKey
431
- })
432
- queryClient.resetQueries({
433
- queryKey: queryKey,
434
- ...filters
435
- })
436
- queryClient.resetQueries({
437
- queryKey: queryKey,
438
- ...filters
439
- }, resetOptions)
440
- queryClient.resetQueries({
441
- queryKey: queryKey,
442
- ...filters,
443
- stale: true
444
- })
445
- queryClient.resetQueries({
446
- queryKey: queryKey,
447
- ...filters,
448
- stale: true
449
- }, resetOptions)
450
- queryClient.resetQueries({ queryKey, ...filters, stale: true })
451
- queryClient.resetQueries({ queryKey, ...filters, stale: true }, resetOptions)
452
- // Stays as it is because the code couldn't infer the type of the "queryKeysFromAnotherModule" identifier.
453
- queryClient.resetQueries(queryKeysFromAnotherModule)
454
- queryClient.resetQueries(queryKeysFromAnotherModule, filters)
455
- queryClient.resetQueries(queryKeysFromAnotherModule, filters, resetOptions)
456
-
457
- queryClient.fetchQuery({
458
- queryKey: queryKey
459
- })
460
- queryClient.fetchQuery({
461
- queryKey: queryKey,
462
- ...fetchOptions
463
- })
464
- queryClient.fetchQuery({
465
- queryKey: queryKey,
466
- networkMode: 'always',
467
- ...fetchOptions
468
- })
469
- queryClient.fetchQuery({
470
- queryKey: queryKey,
471
- queryFn: queryFn,
472
- ...fetchOptions
473
- })
474
- queryClient.fetchQuery({
475
- queryKey: queryKey,
476
- queryFn: () => 'data',
477
- networkMode: 'always',
478
- ...fetchOptions
479
- })
480
- // Stays as it is because the code couldn't infer the type of the "queryKeysFromAnotherModule" identifier.
481
- queryClient.fetchQuery(queryKeysFromAnotherModule)
482
- queryClient.fetchQuery(queryKeysFromAnotherModule, fetchOptions)
483
- queryClient.fetchQuery(queryKeysFromAnotherModule, queryFn, fetchOptions)
484
- }
@@ -1,6 +0,0 @@
1
- // eslint-disable-next-line @typescript-eslint/no-var-requires
2
- const defineTest = require('jscodeshift/dist/testUtils').defineTest
3
-
4
- defineTest(__dirname, 'remove-overloads', null, 'default-import', {
5
- parser: 'tsx',
6
- })
@@ -1,50 +0,0 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- var React = require('react');
5
- var queryCore = require('@tanstack/query-core');
6
- var QueryClientProvider = require('./QueryClientProvider.cjs');
7
-
8
- function _interopNamespaceDefault(e) {
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n.default = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
26
-
27
- const HydrationBoundary = ({
28
- children,
29
- options = {},
30
- state,
31
- queryClient
32
- }) => {
33
- const client = QueryClientProvider.useQueryClient(queryClient);
34
- const optionsRef = React__namespace.useRef(options);
35
- optionsRef.current = options;
36
-
37
- // Running hydrate again with the same queries is safe,
38
- // it wont overwrite or initialize existing queries,
39
- // relying on useMemo here is only a performance optimization.
40
- // hydrate can and should be run *during* render here for SSR to work properly
41
- React__namespace.useMemo(() => {
42
- if (state) {
43
- queryCore.hydrate(client, state, optionsRef.current);
44
- }
45
- }, [client, state]);
46
- return children;
47
- };
48
-
49
- exports.HydrationBoundary = HydrationBoundary;
50
- //# sourceMappingURL=HydrationBoundary.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HydrationBoundary.cjs","sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type { HydrateOptions, QueryClient } from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n optionsRef.current = options\n\n // Running hydrate again with the same queries is safe,\n // it wont overwrite or initialize existing queries,\n // relying on useMemo here is only a performance optimization.\n // hydrate can and should be run *during* render here for SSR to work properly\n React.useMemo(() => {\n if (state) {\n hydrate(client, state, optionsRef.current)\n }\n }, [client, state])\n\n return children as React.ReactElement\n}\n"],"names":["queryClient"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAcO;;;;AAILA;AACsB;AACtB;AAEA;;;AAGA;AACA;AACA;AACA;;AAEE;;AAEA;AACF;AAEA;AACF;;"}
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
- import type { HydrateOptions, QueryClient } from '@tanstack/query-core';
3
- export interface HydrationBoundaryProps {
4
- state?: unknown;
5
- options?: HydrateOptions;
6
- children?: React.ReactNode;
7
- queryClient?: QueryClient;
8
- }
9
- export declare const HydrationBoundary: ({ children, options, state, queryClient, }: HydrationBoundaryProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
10
- //# sourceMappingURL=HydrationBoundary.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HydrationBoundary.d.ts","sourceRoot":"","sources":["../../src/HydrationBoundary.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAEvE,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED,eAAO,MAAM,iBAAiB,+CAK3B,sBAAsB,uEAiBxB,CAAA"}
@@ -1,29 +0,0 @@
1
- 'use client';
2
- import * as React from 'react';
3
- import { hydrate } from '@tanstack/query-core';
4
- import { useQueryClient } from './QueryClientProvider.js';
5
-
6
- const HydrationBoundary = ({
7
- children,
8
- options = {},
9
- state,
10
- queryClient
11
- }) => {
12
- const client = useQueryClient(queryClient);
13
- const optionsRef = React.useRef(options);
14
- optionsRef.current = options;
15
-
16
- // Running hydrate again with the same queries is safe,
17
- // it wont overwrite or initialize existing queries,
18
- // relying on useMemo here is only a performance optimization.
19
- // hydrate can and should be run *during* render here for SSR to work properly
20
- React.useMemo(() => {
21
- if (state) {
22
- hydrate(client, state, optionsRef.current);
23
- }
24
- }, [client, state]);
25
- return children;
26
- };
27
-
28
- export { HydrationBoundary };
29
- //# sourceMappingURL=HydrationBoundary.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HydrationBoundary.js","sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type { HydrateOptions, QueryClient } from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n optionsRef.current = options\n\n // Running hydrate again with the same queries is safe,\n // it wont overwrite or initialize existing queries,\n // relying on useMemo here is only a performance optimization.\n // hydrate can and should be run *during* render here for SSR to work properly\n React.useMemo(() => {\n if (state) {\n hydrate(client, state, optionsRef.current)\n }\n }, [client, state])\n\n return children as React.ReactElement\n}\n"],"names":["queryClient"],"mappings":";;;;;AAcO;;;;AAILA;AACsB;AACtB;AAEA;;;AAGA;AACA;AACA;AACA;;AAEE;;AAEA;AACF;AAEA;AACF;;"}
@@ -1,50 +0,0 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- var React = require('react');
5
- var queryCore = require('@tanstack/query-core');
6
- var QueryClientProvider = require('./QueryClientProvider.legacy.cjs');
7
-
8
- function _interopNamespaceDefault(e) {
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n.default = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
26
-
27
- const HydrationBoundary = ({
28
- children,
29
- options = {},
30
- state,
31
- queryClient
32
- }) => {
33
- const client = QueryClientProvider.useQueryClient(queryClient);
34
- const optionsRef = React__namespace.useRef(options);
35
- optionsRef.current = options;
36
-
37
- // Running hydrate again with the same queries is safe,
38
- // it wont overwrite or initialize existing queries,
39
- // relying on useMemo here is only a performance optimization.
40
- // hydrate can and should be run *during* render here for SSR to work properly
41
- React__namespace.useMemo(() => {
42
- if (state) {
43
- queryCore.hydrate(client, state, optionsRef.current);
44
- }
45
- }, [client, state]);
46
- return children;
47
- };
48
-
49
- exports.HydrationBoundary = HydrationBoundary;
50
- //# sourceMappingURL=HydrationBoundary.legacy.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HydrationBoundary.legacy.cjs","sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type { HydrateOptions, QueryClient } from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n optionsRef.current = options\n\n // Running hydrate again with the same queries is safe,\n // it wont overwrite or initialize existing queries,\n // relying on useMemo here is only a performance optimization.\n // hydrate can and should be run *during* render here for SSR to work properly\n React.useMemo(() => {\n if (state) {\n hydrate(client, state, optionsRef.current)\n }\n }, [client, state])\n\n return children as React.ReactElement\n}\n"],"names":["queryClient"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAcO;;;;AAILA;AACsB;AACtB;AAEA;;;AAGA;AACA;AACA;AACA;;AAEE;;AAEA;AACF;AAEA;AACF;;"}
@@ -1,29 +0,0 @@
1
- 'use client';
2
- import * as React from 'react';
3
- import { hydrate } from '@tanstack/query-core';
4
- import { useQueryClient } from './QueryClientProvider.legacy.js';
5
-
6
- const HydrationBoundary = ({
7
- children,
8
- options = {},
9
- state,
10
- queryClient
11
- }) => {
12
- const client = useQueryClient(queryClient);
13
- const optionsRef = React.useRef(options);
14
- optionsRef.current = options;
15
-
16
- // Running hydrate again with the same queries is safe,
17
- // it wont overwrite or initialize existing queries,
18
- // relying on useMemo here is only a performance optimization.
19
- // hydrate can and should be run *during* render here for SSR to work properly
20
- React.useMemo(() => {
21
- if (state) {
22
- hydrate(client, state, optionsRef.current);
23
- }
24
- }, [client, state]);
25
- return children;
26
- };
27
-
28
- export { HydrationBoundary };
29
- //# sourceMappingURL=HydrationBoundary.legacy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HydrationBoundary.legacy.js","sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type { HydrateOptions, QueryClient } from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n optionsRef.current = options\n\n // Running hydrate again with the same queries is safe,\n // it wont overwrite or initialize existing queries,\n // relying on useMemo here is only a performance optimization.\n // hydrate can and should be run *during* render here for SSR to work properly\n React.useMemo(() => {\n if (state) {\n hydrate(client, state, optionsRef.current)\n }\n }, [client, state])\n\n return children as React.ReactElement\n}\n"],"names":["queryClient"],"mappings":";;;;;AAcO;;;;AAILA;AACsB;AACtB;AAEA;;;AAGA;AACA;AACA;AACA;;AAEE;;AAEA;AACF;AAEA;AACF;;"}