@suspensive/react-query-4 3.19.2 → 3.19.4

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 (326) hide show
  1. package/dist/IsFetching.cjs +18 -2
  2. package/dist/IsFetching.cjs.map +1 -0
  3. package/dist/IsFetching.d.cts +18 -2
  4. package/dist/IsFetching.d.cts.map +1 -0
  5. package/dist/IsFetching.d.mts +18 -2
  6. package/dist/IsFetching.d.mts.map +1 -0
  7. package/dist/IsFetching.mjs +17 -2
  8. package/dist/IsFetching.mjs.map +1 -0
  9. package/dist/Mutation.cjs +14 -2
  10. package/dist/Mutation.cjs.map +1 -0
  11. package/dist/Mutation.d.cts +14 -2
  12. package/dist/Mutation.d.cts.map +1 -0
  13. package/dist/Mutation.d.mts +14 -2
  14. package/dist/Mutation.d.mts.map +1 -0
  15. package/dist/Mutation.mjs +13 -2
  16. package/dist/Mutation.mjs.map +1 -0
  17. package/dist/PrefetchInfiniteQuery.cjs +20 -2
  18. package/dist/PrefetchInfiniteQuery.cjs.map +1 -0
  19. package/dist/PrefetchInfiniteQuery.d.cts +16 -2
  20. package/dist/PrefetchInfiniteQuery.d.cts.map +1 -0
  21. package/dist/PrefetchInfiniteQuery.d.mts +16 -2
  22. package/dist/PrefetchInfiniteQuery.d.mts.map +1 -0
  23. package/dist/PrefetchInfiniteQuery.mjs +19 -2
  24. package/dist/PrefetchInfiniteQuery.mjs.map +1 -0
  25. package/dist/PrefetchQuery.cjs +20 -2
  26. package/dist/PrefetchQuery.cjs.map +1 -0
  27. package/dist/PrefetchQuery.d.cts +16 -2
  28. package/dist/PrefetchQuery.d.cts.map +1 -0
  29. package/dist/PrefetchQuery.d.mts +16 -2
  30. package/dist/PrefetchQuery.d.mts.map +1 -0
  31. package/dist/PrefetchQuery.mjs +19 -2
  32. package/dist/PrefetchQuery.mjs.map +1 -0
  33. package/dist/QueriesHydration.cjs +117 -2
  34. package/dist/QueriesHydration.cjs.map +1 -0
  35. package/dist/QueriesHydration.d.cts +105 -2
  36. package/dist/QueriesHydration.d.cts.map +1 -0
  37. package/dist/QueriesHydration.d.mts +105 -2
  38. package/dist/QueriesHydration.d.mts.map +1 -0
  39. package/dist/QueriesHydration.mjs +116 -2
  40. package/dist/QueriesHydration.mjs.map +1 -0
  41. package/dist/QueryClientConsumer.cjs +14 -2
  42. package/dist/QueryClientConsumer.cjs.map +1 -0
  43. package/dist/QueryClientConsumer.d.cts +18 -2
  44. package/dist/QueryClientConsumer.d.cts.map +1 -0
  45. package/dist/QueryClientConsumer.d.mts +18 -2
  46. package/dist/QueryClientConsumer.d.mts.map +1 -0
  47. package/dist/QueryClientConsumer.mjs +13 -2
  48. package/dist/QueryClientConsumer.mjs.map +1 -0
  49. package/dist/SuspenseInfiniteQuery.cjs +30 -2
  50. package/dist/SuspenseInfiniteQuery.cjs.map +1 -0
  51. package/dist/SuspenseInfiniteQuery.d.cts +31 -2
  52. package/dist/SuspenseInfiniteQuery.d.cts.map +1 -0
  53. package/dist/SuspenseInfiniteQuery.d.mts +31 -3
  54. package/dist/SuspenseInfiniteQuery.d.mts.map +1 -0
  55. package/dist/SuspenseInfiniteQuery.mjs +29 -2
  56. package/dist/SuspenseInfiniteQuery.mjs.map +1 -0
  57. package/dist/SuspenseQueries.cjs +26 -2
  58. package/dist/SuspenseQueries.cjs.map +1 -0
  59. package/dist/SuspenseQueries.d.cts +30 -2
  60. package/dist/SuspenseQueries.d.cts.map +1 -0
  61. package/dist/SuspenseQueries.d.mts +30 -2
  62. package/dist/SuspenseQueries.d.mts.map +1 -0
  63. package/dist/SuspenseQueries.mjs +25 -2
  64. package/dist/SuspenseQueries.mjs.map +1 -0
  65. package/dist/SuspenseQuery.cjs +30 -2
  66. package/dist/SuspenseQuery.cjs.map +1 -0
  67. package/dist/SuspenseQuery.d.cts +30 -2
  68. package/dist/SuspenseQuery.d.cts.map +1 -0
  69. package/dist/SuspenseQuery.d.mts +30 -2
  70. package/dist/SuspenseQuery.d.mts.map +1 -0
  71. package/dist/SuspenseQuery.mjs +29 -2
  72. package/dist/SuspenseQuery.mjs.map +1 -0
  73. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/asyncToGenerator.cjs +29 -0
  74. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/asyncToGenerator.mjs +28 -0
  75. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.cjs +14 -0
  76. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.mjs +14 -0
  77. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectSpread2.cjs +27 -0
  78. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectSpread2.mjs +27 -0
  79. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutProperties.cjs +15 -0
  80. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutProperties.mjs +15 -0
  81. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutPropertiesLoose.cjs +14 -0
  82. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutPropertiesLoose.mjs +13 -0
  83. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPrimitive.cjs +16 -0
  84. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPrimitive.mjs +16 -0
  85. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPropertyKey.cjs +11 -0
  86. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPropertyKey.mjs +11 -0
  87. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/typeof.cjs +18 -0
  88. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/typeof.mjs +12 -0
  89. package/dist/components/ClientOnly.cjs +12 -2
  90. package/dist/components/ClientOnly.cjs.map +1 -0
  91. package/dist/components/ClientOnly.mjs +12 -2
  92. package/dist/components/ClientOnly.mjs.map +1 -0
  93. package/dist/createGetQueryClient.cjs +63 -2
  94. package/dist/createGetQueryClient.cjs.map +1 -0
  95. package/dist/createGetQueryClient.d.cts +53 -2
  96. package/dist/createGetQueryClient.d.cts.map +1 -0
  97. package/dist/createGetQueryClient.d.mts +53 -2
  98. package/dist/createGetQueryClient.d.mts.map +1 -0
  99. package/dist/createGetQueryClient.mjs +62 -2
  100. package/dist/createGetQueryClient.mjs.map +1 -0
  101. package/dist/index.cjs +19 -18
  102. package/dist/index.d.cts +18 -18
  103. package/dist/index.d.mts +18 -18
  104. package/dist/index.mjs +18 -18
  105. package/dist/infiniteQueryOptions.cjs +17 -2
  106. package/dist/infiniteQueryOptions.cjs.map +1 -0
  107. package/dist/infiniteQueryOptions.d.cts +28 -2
  108. package/dist/infiniteQueryOptions.d.cts.map +1 -0
  109. package/dist/infiniteQueryOptions.d.mts +28 -2
  110. package/dist/infiniteQueryOptions.d.mts.map +1 -0
  111. package/dist/infiniteQueryOptions.mjs +16 -2
  112. package/dist/infiniteQueryOptions.mjs.map +1 -0
  113. package/dist/mutationOptions.cjs +9 -2
  114. package/dist/mutationOptions.cjs.map +1 -0
  115. package/dist/mutationOptions.d.cts +7 -2
  116. package/dist/mutationOptions.d.cts.map +1 -0
  117. package/dist/mutationOptions.d.mts +7 -2
  118. package/dist/mutationOptions.d.mts.map +1 -0
  119. package/dist/mutationOptions.mjs +7 -2
  120. package/dist/mutationOptions.mjs.map +1 -0
  121. package/dist/queryOptions.cjs +17 -2
  122. package/dist/queryOptions.cjs.map +1 -0
  123. package/dist/queryOptions.d.cts +28 -2
  124. package/dist/queryOptions.d.cts.map +1 -0
  125. package/dist/queryOptions.d.mts +28 -2
  126. package/dist/queryOptions.d.mts.map +1 -0
  127. package/dist/queryOptions.mjs +16 -2
  128. package/dist/queryOptions.mjs.map +1 -0
  129. package/dist/usePrefetchInfiniteQuery.cjs +15 -2
  130. package/dist/usePrefetchInfiniteQuery.cjs.map +1 -0
  131. package/dist/usePrefetchInfiniteQuery.d.cts +11 -2
  132. package/dist/usePrefetchInfiniteQuery.d.cts.map +1 -0
  133. package/dist/usePrefetchInfiniteQuery.d.mts +11 -2
  134. package/dist/usePrefetchInfiniteQuery.d.mts.map +1 -0
  135. package/dist/usePrefetchInfiniteQuery.mjs +14 -2
  136. package/dist/usePrefetchInfiniteQuery.mjs.map +1 -0
  137. package/dist/usePrefetchQuery.cjs +15 -2
  138. package/dist/usePrefetchQuery.cjs.map +1 -0
  139. package/dist/usePrefetchQuery.d.cts +11 -2
  140. package/dist/usePrefetchQuery.d.cts.map +1 -0
  141. package/dist/usePrefetchQuery.d.mts +11 -2
  142. package/dist/usePrefetchQuery.d.mts.map +1 -0
  143. package/dist/usePrefetchQuery.mjs +14 -2
  144. package/dist/usePrefetchQuery.mjs.map +1 -0
  145. package/dist/useSuspenseInfiniteQuery.cjs +17 -2
  146. package/dist/useSuspenseInfiniteQuery.cjs.map +1 -0
  147. package/dist/useSuspenseInfiniteQuery.d.cts +17 -2
  148. package/dist/useSuspenseInfiniteQuery.d.cts.map +1 -0
  149. package/dist/useSuspenseInfiniteQuery.d.mts +17 -2
  150. package/dist/useSuspenseInfiniteQuery.d.mts.map +1 -0
  151. package/dist/useSuspenseInfiniteQuery.mjs +16 -2
  152. package/dist/useSuspenseInfiniteQuery.mjs.map +1 -0
  153. package/dist/useSuspenseQueries.cjs +17 -2
  154. package/dist/useSuspenseQueries.cjs.map +1 -0
  155. package/dist/useSuspenseQueries.d.cts +36 -2
  156. package/dist/useSuspenseQueries.d.cts.map +1 -0
  157. package/dist/useSuspenseQueries.d.mts +36 -2
  158. package/dist/useSuspenseQueries.d.mts.map +1 -0
  159. package/dist/useSuspenseQueries.mjs +16 -2
  160. package/dist/useSuspenseQueries.mjs.map +1 -0
  161. package/dist/useSuspenseQuery.cjs +17 -2
  162. package/dist/useSuspenseQuery.cjs.map +1 -0
  163. package/dist/useSuspenseQuery.d.cts +36 -2
  164. package/dist/useSuspenseQuery.d.cts.map +1 -0
  165. package/dist/useSuspenseQuery.d.mts +36 -2
  166. package/dist/useSuspenseQuery.d.mts.map +1 -0
  167. package/dist/useSuspenseQuery.mjs +16 -2
  168. package/dist/useSuspenseQuery.mjs.map +1 -0
  169. package/package.json +4 -4
  170. package/src/createGetQueryClient.spec.tsx +25 -77
  171. package/dist/ClientOnly-BdmzVYnI.mjs +0 -15
  172. package/dist/ClientOnly-BdmzVYnI.mjs.map +0 -1
  173. package/dist/ClientOnly-Dvf8t__-.cjs +0 -20
  174. package/dist/ClientOnly-Dvf8t__-.cjs.map +0 -1
  175. package/dist/IsFetching-BYkNw1cs.mjs +0 -18
  176. package/dist/IsFetching-BYkNw1cs.mjs.map +0 -1
  177. package/dist/IsFetching-BfIQ3Qek.d.mts +0 -19
  178. package/dist/IsFetching-BfIQ3Qek.d.mts.map +0 -1
  179. package/dist/IsFetching-BhOgGqrs.cjs +0 -23
  180. package/dist/IsFetching-BhOgGqrs.cjs.map +0 -1
  181. package/dist/IsFetching-CuftXnaJ.d.cts +0 -19
  182. package/dist/IsFetching-CuftXnaJ.d.cts.map +0 -1
  183. package/dist/Mutation-CGUYEkKX.cjs +0 -19
  184. package/dist/Mutation-CGUYEkKX.cjs.map +0 -1
  185. package/dist/Mutation-CGpbCg54.d.mts +0 -14
  186. package/dist/Mutation-CGpbCg54.d.mts.map +0 -1
  187. package/dist/Mutation-DGmP7HQI.d.cts +0 -14
  188. package/dist/Mutation-DGmP7HQI.d.cts.map +0 -1
  189. package/dist/Mutation-DUJhz3rT.mjs +0 -14
  190. package/dist/Mutation-DUJhz3rT.mjs.map +0 -1
  191. package/dist/PrefetchInfiniteQuery-BewcG5rR.d.cts +0 -17
  192. package/dist/PrefetchInfiniteQuery-BewcG5rR.d.cts.map +0 -1
  193. package/dist/PrefetchInfiniteQuery-D-3dZMEz.d.mts +0 -17
  194. package/dist/PrefetchInfiniteQuery-D-3dZMEz.d.mts.map +0 -1
  195. package/dist/PrefetchInfiniteQuery-RS3Qz-7B.mjs +0 -20
  196. package/dist/PrefetchInfiniteQuery-RS3Qz-7B.mjs.map +0 -1
  197. package/dist/PrefetchInfiniteQuery-cCSXqKVR.cjs +0 -25
  198. package/dist/PrefetchInfiniteQuery-cCSXqKVR.cjs.map +0 -1
  199. package/dist/PrefetchQuery-0pdYNtpS.cjs +0 -25
  200. package/dist/PrefetchQuery-0pdYNtpS.cjs.map +0 -1
  201. package/dist/PrefetchQuery-Ddbt43Fk.d.cts +0 -17
  202. package/dist/PrefetchQuery-Ddbt43Fk.d.cts.map +0 -1
  203. package/dist/PrefetchQuery-DqgbVdjY.d.mts +0 -17
  204. package/dist/PrefetchQuery-DqgbVdjY.d.mts.map +0 -1
  205. package/dist/PrefetchQuery-uh4idoXK.mjs +0 -20
  206. package/dist/PrefetchQuery-uh4idoXK.mjs.map +0 -1
  207. package/dist/QueriesHydration-DPogKsc4.d.mts +0 -106
  208. package/dist/QueriesHydration-DPogKsc4.d.mts.map +0 -1
  209. package/dist/QueriesHydration-DnlRrHJ3.d.cts +0 -106
  210. package/dist/QueriesHydration-DnlRrHJ3.d.cts.map +0 -1
  211. package/dist/QueriesHydration-GQxJe_Vu.mjs +0 -143
  212. package/dist/QueriesHydration-GQxJe_Vu.mjs.map +0 -1
  213. package/dist/QueriesHydration-dcSAzQNT.cjs +0 -148
  214. package/dist/QueriesHydration-dcSAzQNT.cjs.map +0 -1
  215. package/dist/QueryClientConsumer-5PZLv_8g.d.mts +0 -18
  216. package/dist/QueryClientConsumer-5PZLv_8g.d.mts.map +0 -1
  217. package/dist/QueryClientConsumer-e7PyaFF3.mjs +0 -14
  218. package/dist/QueryClientConsumer-e7PyaFF3.mjs.map +0 -1
  219. package/dist/QueryClientConsumer-mF0OUwkq.cjs +0 -19
  220. package/dist/QueryClientConsumer-mF0OUwkq.cjs.map +0 -1
  221. package/dist/QueryClientConsumer-pihgMOoA.d.cts +0 -18
  222. package/dist/QueryClientConsumer-pihgMOoA.d.cts.map +0 -1
  223. package/dist/SuspenseInfiniteQuery-BimBkaCe.mjs +0 -30
  224. package/dist/SuspenseInfiniteQuery-BimBkaCe.mjs.map +0 -1
  225. package/dist/SuspenseInfiniteQuery-BtRviR-Z.d.mts +0 -32
  226. package/dist/SuspenseInfiniteQuery-BtRviR-Z.d.mts.map +0 -1
  227. package/dist/SuspenseInfiniteQuery-DSYC5XON.d.cts +0 -32
  228. package/dist/SuspenseInfiniteQuery-DSYC5XON.d.cts.map +0 -1
  229. package/dist/SuspenseInfiniteQuery-oVQE2P2T.cjs +0 -35
  230. package/dist/SuspenseInfiniteQuery-oVQE2P2T.cjs.map +0 -1
  231. package/dist/SuspenseQueries-BPvriygJ.d.cts +0 -31
  232. package/dist/SuspenseQueries-BPvriygJ.d.cts.map +0 -1
  233. package/dist/SuspenseQueries-Brk6gtMw.cjs +0 -31
  234. package/dist/SuspenseQueries-Brk6gtMw.cjs.map +0 -1
  235. package/dist/SuspenseQueries-C0mF_XD_.mjs +0 -26
  236. package/dist/SuspenseQueries-C0mF_XD_.mjs.map +0 -1
  237. package/dist/SuspenseQueries-CHFS9e4y.d.mts +0 -31
  238. package/dist/SuspenseQueries-CHFS9e4y.d.mts.map +0 -1
  239. package/dist/SuspenseQuery-BWI24top.mjs +0 -30
  240. package/dist/SuspenseQuery-BWI24top.mjs.map +0 -1
  241. package/dist/SuspenseQuery-D4IZU_Co.d.cts +0 -31
  242. package/dist/SuspenseQuery-D4IZU_Co.d.cts.map +0 -1
  243. package/dist/SuspenseQuery-DE4NKrqP.cjs +0 -35
  244. package/dist/SuspenseQuery-DE4NKrqP.cjs.map +0 -1
  245. package/dist/SuspenseQuery-VjYG_b1z.d.mts +0 -31
  246. package/dist/SuspenseQuery-VjYG_b1z.d.mts.map +0 -1
  247. package/dist/components/ClientOnly.d.cts +0 -13
  248. package/dist/components/ClientOnly.d.cts.map +0 -1
  249. package/dist/components/ClientOnly.d.mts +0 -13
  250. package/dist/components/ClientOnly.d.mts.map +0 -1
  251. package/dist/createGetQueryClient-B0yrcyXF.mjs +0 -63
  252. package/dist/createGetQueryClient-B0yrcyXF.mjs.map +0 -1
  253. package/dist/createGetQueryClient-DTKVVwpJ.d.mts +0 -54
  254. package/dist/createGetQueryClient-DTKVVwpJ.d.mts.map +0 -1
  255. package/dist/createGetQueryClient-iXoXO7so.d.cts +0 -54
  256. package/dist/createGetQueryClient-iXoXO7so.d.cts.map +0 -1
  257. package/dist/createGetQueryClient-nXvPqrrS.cjs +0 -68
  258. package/dist/createGetQueryClient-nXvPqrrS.cjs.map +0 -1
  259. package/dist/infiniteQueryOptions-2KFmTqEY.mjs +0 -17
  260. package/dist/infiniteQueryOptions-2KFmTqEY.mjs.map +0 -1
  261. package/dist/infiniteQueryOptions-BVac5B-c.cjs +0 -22
  262. package/dist/infiniteQueryOptions-BVac5B-c.cjs.map +0 -1
  263. package/dist/infiniteQueryOptions-Be7VYTUR.d.cts +0 -29
  264. package/dist/infiniteQueryOptions-Be7VYTUR.d.cts.map +0 -1
  265. package/dist/infiniteQueryOptions-Bpz4mFYH.d.mts +0 -29
  266. package/dist/infiniteQueryOptions-Bpz4mFYH.d.mts.map +0 -1
  267. package/dist/mutationOptions-BIOn3zne.cjs +0 -14
  268. package/dist/mutationOptions-BIOn3zne.cjs.map +0 -1
  269. package/dist/mutationOptions-BZS10WEJ.d.mts +0 -7
  270. package/dist/mutationOptions-BZS10WEJ.d.mts.map +0 -1
  271. package/dist/mutationOptions-C4emetVL.mjs +0 -8
  272. package/dist/mutationOptions-C4emetVL.mjs.map +0 -1
  273. package/dist/mutationOptions-Eid3aM1W.d.cts +0 -7
  274. package/dist/mutationOptions-Eid3aM1W.d.cts.map +0 -1
  275. package/dist/objectSpread2-BFPIJj0i.mjs +0 -67
  276. package/dist/objectSpread2-CpqxxdM2.cjs +0 -73
  277. package/dist/objectWithoutProperties-BYP50gyF.mjs +0 -25
  278. package/dist/objectWithoutProperties-CYXRK7DS.cjs +0 -31
  279. package/dist/queryOptions-92vSd4eV.cjs +0 -22
  280. package/dist/queryOptions-92vSd4eV.cjs.map +0 -1
  281. package/dist/queryOptions-DILe-4vk.d.mts +0 -29
  282. package/dist/queryOptions-DILe-4vk.d.mts.map +0 -1
  283. package/dist/queryOptions-DNGHeGX5.d.cts +0 -29
  284. package/dist/queryOptions-DNGHeGX5.d.cts.map +0 -1
  285. package/dist/queryOptions-Dnf4-wlk.mjs +0 -17
  286. package/dist/queryOptions-Dnf4-wlk.mjs.map +0 -1
  287. package/dist/usePrefetchInfiniteQuery-B0_Ladyp.d.mts +0 -12
  288. package/dist/usePrefetchInfiniteQuery-B0_Ladyp.d.mts.map +0 -1
  289. package/dist/usePrefetchInfiniteQuery-BmZtlLeD.cjs +0 -20
  290. package/dist/usePrefetchInfiniteQuery-BmZtlLeD.cjs.map +0 -1
  291. package/dist/usePrefetchInfiniteQuery-CQSN-P9m.mjs +0 -15
  292. package/dist/usePrefetchInfiniteQuery-CQSN-P9m.mjs.map +0 -1
  293. package/dist/usePrefetchInfiniteQuery-CRwRctQH.d.cts +0 -12
  294. package/dist/usePrefetchInfiniteQuery-CRwRctQH.d.cts.map +0 -1
  295. package/dist/usePrefetchQuery-38O319FT.d.mts +0 -12
  296. package/dist/usePrefetchQuery-38O319FT.d.mts.map +0 -1
  297. package/dist/usePrefetchQuery-93Pltnzl.d.cts +0 -12
  298. package/dist/usePrefetchQuery-93Pltnzl.d.cts.map +0 -1
  299. package/dist/usePrefetchQuery-CtrJciA6.mjs +0 -15
  300. package/dist/usePrefetchQuery-CtrJciA6.mjs.map +0 -1
  301. package/dist/usePrefetchQuery-woiivAJc.cjs +0 -20
  302. package/dist/usePrefetchQuery-woiivAJc.cjs.map +0 -1
  303. package/dist/useSuspenseInfiniteQuery-Bh0nh8Kc.d.mts +0 -17
  304. package/dist/useSuspenseInfiniteQuery-Bh0nh8Kc.d.mts.map +0 -1
  305. package/dist/useSuspenseInfiniteQuery-CA0jmgbX.cjs +0 -22
  306. package/dist/useSuspenseInfiniteQuery-CA0jmgbX.cjs.map +0 -1
  307. package/dist/useSuspenseInfiniteQuery-DUxKOkCo.mjs +0 -17
  308. package/dist/useSuspenseInfiniteQuery-DUxKOkCo.mjs.map +0 -1
  309. package/dist/useSuspenseInfiniteQuery-xXu-A7cX.d.cts +0 -17
  310. package/dist/useSuspenseInfiniteQuery-xXu-A7cX.d.cts.map +0 -1
  311. package/dist/useSuspenseQueries-Bf0lSTWB.mjs +0 -17
  312. package/dist/useSuspenseQueries-Bf0lSTWB.mjs.map +0 -1
  313. package/dist/useSuspenseQueries-CHPLAyeb.d.cts +0 -37
  314. package/dist/useSuspenseQueries-CHPLAyeb.d.cts.map +0 -1
  315. package/dist/useSuspenseQueries-DqBaOI3L.cjs +0 -22
  316. package/dist/useSuspenseQueries-DqBaOI3L.cjs.map +0 -1
  317. package/dist/useSuspenseQueries-pfI8hFSM.d.mts +0 -37
  318. package/dist/useSuspenseQueries-pfI8hFSM.d.mts.map +0 -1
  319. package/dist/useSuspenseQuery-41ONxa6i.cjs +0 -22
  320. package/dist/useSuspenseQuery-41ONxa6i.cjs.map +0 -1
  321. package/dist/useSuspenseQuery-CVWQeHhd.mjs +0 -17
  322. package/dist/useSuspenseQuery-CVWQeHhd.mjs.map +0 -1
  323. package/dist/useSuspenseQuery-DG0Jz1Da.d.mts +0 -37
  324. package/dist/useSuspenseQuery-DG0Jz1Da.d.mts.map +0 -1
  325. package/dist/useSuspenseQuery-DiNomNWA.d.cts +0 -37
  326. package/dist/useSuspenseQuery-DiNomNWA.d.cts.map +0 -1
@@ -1,25 +0,0 @@
1
- const require_usePrefetchInfiniteQuery = require('./usePrefetchInfiniteQuery-BmZtlLeD.cjs');
2
- let react_jsx_runtime = require("react/jsx-runtime");
3
-
4
- //#region src/PrefetchInfiniteQuery.tsx
5
- /**
6
- * A component that allows you to use `usePrefetchInfiniteQuery` in JSX, avoiding the limitations of React hooks.
7
- * @see {@link https://suspensive.org/docs/react-query/PrefetchInfiniteQuery Suspensive Docs}
8
- * @example
9
- * ```tsx
10
- * <PrefetchInfiniteQuery queryKey={['queryKey']} queryFn={queryFn} />
11
- * ```
12
- */
13
- function PrefetchInfiniteQuery(options) {
14
- require_usePrefetchInfiniteQuery.usePrefetchInfiniteQuery(options);
15
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {});
16
- }
17
-
18
- //#endregion
19
- Object.defineProperty(exports, 'PrefetchInfiniteQuery', {
20
- enumerable: true,
21
- get: function () {
22
- return PrefetchInfiniteQuery;
23
- }
24
- });
25
- //# sourceMappingURL=PrefetchInfiniteQuery-cCSXqKVR.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PrefetchInfiniteQuery-cCSXqKVR.cjs","names":[],"sources":["../src/PrefetchInfiniteQuery.tsx"],"sourcesContent":["'use client'\n\nimport { type FetchInfiniteQueryOptions, type QueryKey } from '@tanstack/react-query'\nimport { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery'\n\n/**\n * A component that allows you to use `usePrefetchInfiniteQuery` in JSX, avoiding the limitations of React hooks.\n * @see {@link https://suspensive.org/docs/react-query/PrefetchInfiniteQuery Suspensive Docs}\n * @example\n * ```tsx\n * <PrefetchInfiniteQuery queryKey={['queryKey']} queryFn={queryFn} />\n * ```\n */\nexport function PrefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(options: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>) {\n usePrefetchInfiniteQuery(options)\n return <></>\n}\n"],"mappings":";;;;;;;;;;;;AAaA,SAAgB,sBAKd,SAA4E;AAC5E,2DAAyB,QAAQ;AACjC,QAAO,0EAAK"}
@@ -1,25 +0,0 @@
1
- const require_usePrefetchQuery = require('./usePrefetchQuery-woiivAJc.cjs');
2
- let react_jsx_runtime = require("react/jsx-runtime");
3
-
4
- //#region src/PrefetchQuery.tsx
5
- /**
6
- * A component that allows you to use usePrefetchQuery in JSX, avoiding the limitations of React hooks.
7
- * @see {@link https://suspensive.org/docs/react-query/PrefetchQuery Suspensive Docs}
8
- * @example
9
- * ```tsx
10
- * <PrefetchQuery queryKey={['queryKey']} queryFn={queryFn} />
11
- * ```
12
- */
13
- function PrefetchQuery(options) {
14
- require_usePrefetchQuery.usePrefetchQuery(options);
15
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {});
16
- }
17
-
18
- //#endregion
19
- Object.defineProperty(exports, 'PrefetchQuery', {
20
- enumerable: true,
21
- get: function () {
22
- return PrefetchQuery;
23
- }
24
- });
25
- //# sourceMappingURL=PrefetchQuery-0pdYNtpS.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PrefetchQuery-0pdYNtpS.cjs","names":[],"sources":["../src/PrefetchQuery.tsx"],"sourcesContent":["'use client'\n\nimport { type FetchQueryOptions, type QueryKey } from '@tanstack/react-query'\nimport { usePrefetchQuery } from './usePrefetchQuery'\n\n/**\n * A component that allows you to use usePrefetchQuery in JSX, avoiding the limitations of React hooks.\n * @see {@link https://suspensive.org/docs/react-query/PrefetchQuery Suspensive Docs}\n * @example\n * ```tsx\n * <PrefetchQuery queryKey={['queryKey']} queryFn={queryFn} />\n * ```\n */\nexport function PrefetchQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>) {\n usePrefetchQuery(options)\n return <></>\n}\n"],"mappings":";;;;;;;;;;;;AAaA,SAAgB,cAKd,SAAoE;AACpE,2CAAiB,QAAQ;AACzB,QAAO,0EAAK"}
@@ -1,17 +0,0 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
- import { FetchQueryOptions, QueryKey } from "@tanstack/react-query";
3
-
4
- //#region src/PrefetchQuery.d.ts
5
-
6
- /**
7
- * A component that allows you to use usePrefetchQuery in JSX, avoiding the limitations of React hooks.
8
- * @see {@link https://suspensive.org/docs/react-query/PrefetchQuery Suspensive Docs}
9
- * @example
10
- * ```tsx
11
- * <PrefetchQuery queryKey={['queryKey']} queryFn={queryFn} />
12
- * ```
13
- */
14
- declare function PrefetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>): react_jsx_runtime0.JSX.Element;
15
- //#endregion
16
- export { PrefetchQuery as t };
17
- //# sourceMappingURL=PrefetchQuery-Ddbt43Fk.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PrefetchQuery-Ddbt43Fk.d.cts","names":[],"sources":["../src/PrefetchQuery.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAaA;;;;;AAK2C,iBAL3B,aAK2B,CAAA,eAAA,OAAA,EAAA,SAAA,OAAA,EAAA,QAFjC,YAEiC,EAAA,kBADvB,QACuB,GADZ,QACY,CAAA,CAAA,OAAA,EAAhC,iBAAgC,CAAd,YAAc,EAAA,MAAA,EAAQ,KAAR,EAAe,SAAf,CAAA,CAAA,EAAyB,kBAAA,CAAA,GAAA,CAAA,OAAzB"}
@@ -1,17 +0,0 @@
1
- import { FetchQueryOptions, QueryKey } from "@tanstack/react-query";
2
- import * as react_jsx_runtime8 from "react/jsx-runtime";
3
-
4
- //#region src/PrefetchQuery.d.ts
5
-
6
- /**
7
- * A component that allows you to use usePrefetchQuery in JSX, avoiding the limitations of React hooks.
8
- * @see {@link https://suspensive.org/docs/react-query/PrefetchQuery Suspensive Docs}
9
- * @example
10
- * ```tsx
11
- * <PrefetchQuery queryKey={['queryKey']} queryFn={queryFn} />
12
- * ```
13
- */
14
- declare function PrefetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>): react_jsx_runtime8.JSX.Element;
15
- //#endregion
16
- export { PrefetchQuery as t };
17
- //# sourceMappingURL=PrefetchQuery-DqgbVdjY.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PrefetchQuery-DqgbVdjY.d.mts","names":[],"sources":["../src/PrefetchQuery.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAaA;;;;;AAK2C,iBAL3B,aAK2B,CAAA,eAAA,OAAA,EAAA,SAAA,OAAA,EAAA,QAFjC,YAEiC,EAAA,kBADvB,QACuB,GADZ,QACY,CAAA,CAAA,OAAA,EAAhC,iBAAgC,CAAd,YAAc,EAAA,MAAA,EAAQ,KAAR,EAAe,SAAf,CAAA,CAAA,EAAyB,kBAAA,CAAA,GAAA,CAAA,OAAzB"}
@@ -1,20 +0,0 @@
1
- import { t as usePrefetchQuery } from "./usePrefetchQuery-CtrJciA6.mjs";
2
- import { Fragment, jsx } from "react/jsx-runtime";
3
-
4
- //#region src/PrefetchQuery.tsx
5
- /**
6
- * A component that allows you to use usePrefetchQuery in JSX, avoiding the limitations of React hooks.
7
- * @see {@link https://suspensive.org/docs/react-query/PrefetchQuery Suspensive Docs}
8
- * @example
9
- * ```tsx
10
- * <PrefetchQuery queryKey={['queryKey']} queryFn={queryFn} />
11
- * ```
12
- */
13
- function PrefetchQuery(options) {
14
- usePrefetchQuery(options);
15
- return /* @__PURE__ */ jsx(Fragment, {});
16
- }
17
-
18
- //#endregion
19
- export { PrefetchQuery as t };
20
- //# sourceMappingURL=PrefetchQuery-uh4idoXK.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PrefetchQuery-uh4idoXK.mjs","names":[],"sources":["../src/PrefetchQuery.tsx"],"sourcesContent":["'use client'\n\nimport { type FetchQueryOptions, type QueryKey } from '@tanstack/react-query'\nimport { usePrefetchQuery } from './usePrefetchQuery'\n\n/**\n * A component that allows you to use usePrefetchQuery in JSX, avoiding the limitations of React hooks.\n * @see {@link https://suspensive.org/docs/react-query/PrefetchQuery Suspensive Docs}\n * @example\n * ```tsx\n * <PrefetchQuery queryKey={['queryKey']} queryFn={queryFn} />\n * ```\n */\nexport function PrefetchQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>) {\n usePrefetchQuery(options)\n return <></>\n}\n"],"mappings":";;;;;;;;;;;;AAaA,SAAgB,cAKd,SAAoE;AACpE,kBAAiB,QAAQ;AACzB,QAAO,iCAAK"}
@@ -1,106 +0,0 @@
1
- import { HydrateProps, OmitKeyof, QueryClient, QueryOptions, UseInfiniteQueryOptions, WithRequired } from "@tanstack/react-query";
2
- import * as react_jsx_runtime2 from "react/jsx-runtime";
3
- import { ReactNode } from "react";
4
-
5
- //#region src/QueriesHydration.d.ts
6
-
7
- /**
8
- * A server component that fetches multiple queries on the server and hydrates them to the client.
9
- *
10
- * @experimental This component is experimental and may be changed or removed in the future.
11
- *
12
- * @description
13
- * QueriesHydration is designed for React Server Components (RSC).
14
- * It pre-fetches multiple queries on the server side and automatically hydrates
15
- * the data to the client, enabling seamless data synchronization between server and client.
16
- *
17
- * When errors occur during server-side fetching, the component gracefully falls back
18
- * to client-side rendering, ensuring your application remains resilient.
19
- *
20
- * @example
21
- * ```tsx
22
- * // app/page.tsx (Server Component)
23
- * import { Suspense } from 'react'
24
- * import { QueriesHydration } from '@suspensive/react-query'
25
- * import { queryOptions } from '@tanstack/react-query'
26
- *
27
- * const userQueryOptions = (userId: string) => queryOptions({
28
- * queryKey: ['user', userId],
29
- * queryFn: () => fetchUser(userId)
30
- * })
31
- *
32
- * const postsQueryOptions = () => queryOptions({
33
- * queryKey: ['posts'],
34
- * queryFn: () => fetchPosts()
35
- * })
36
- *
37
- * export default function Page({ userId }: { userId: string }) {
38
- * return (
39
- * <>
40
- * <Suspense fallback={<div>Loading user...</div>}>
41
- * <QueriesHydration queries={[userQueryOptions(userId)]}>
42
- * <UserProfile />
43
- * </QueriesHydration>
44
- * </Suspense>
45
- *
46
- * <Suspense fallback={<div>Loading posts...</div>}>
47
- * <QueriesHydration queries={[postsQueryOptions()]}>
48
- * <PostsList />
49
- * </QueriesHydration>
50
- * </Suspense>
51
- * </>
52
- * )
53
- * }
54
- * ```
55
- *
56
- * @example
57
- * ```tsx
58
- * // With custom error fallback
59
- * <Suspense fallback={<div>Loading user...</div>}>
60
- * <QueriesHydration
61
- * queries={[userQueryOptions(userId)]}
62
- * skipSsrOnError={{ fallback: <div>Fetching on client...</div> }}
63
- * >
64
- * <UserProfile />
65
- * </QueriesHydration>
66
- * </Suspense>
67
- * ```
68
- *
69
- * @see {@link https://suspensive.org/docs/react-query/QueriesHydration Documentation}
70
- */
71
- declare function QueriesHydration({
72
- queries,
73
- children,
74
- queryClient,
75
- skipSsrOnError,
76
- timeout,
77
- ...props
78
- }: {
79
- /**
80
- * The QueryClient instance to use for fetching queries.
81
- */
82
- queryClient?: QueryClient;
83
- /**
84
- * An array of query options or infinite query options to be fetched on the server. Each query must include a `queryKey`.
85
- * You can mix regular queries and infinite queries in the same array.
86
- */
87
- queries: (WithRequired<QueryOptions<any, any, any, any>, 'queryKey'> | WithRequired<UseInfiniteQueryOptions<any, any, any, any, any>, 'queryKey'>)[];
88
- /**
89
- * Controls error handling behavior:
90
- * - `true` (default): Skips SSR and falls back to client-side rendering when server fetch fails
91
- * - `false`: Proceeds with SSR without hydration (retry fetching on client component server rendering)
92
- * - `{ fallback: ReactNode }`: Skips SSR with custom fallback UI during client-side rendering
93
- */
94
- skipSsrOnError?: boolean | {
95
- fallback: ReactNode;
96
- };
97
- /**
98
- * The timeout in milliseconds for the query.
99
- * If the query takes longer than the timeout, it will be considered as an error.
100
- * When not set, no timeout is applied.
101
- */
102
- timeout?: number;
103
- } & OmitKeyof<HydrateProps, 'state'>): Promise<react_jsx_runtime2.JSX.Element>;
104
- //#endregion
105
- export { QueriesHydration as t };
106
- //# sourceMappingURL=QueriesHydration-DPogKsc4.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QueriesHydration-DPogKsc4.d.mts","names":[],"sources":["../src/QueriesHydration.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AA6EA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAsB,gBAAA;;;;;;;;;;;gBAWN;;;;;YAMV,aAAa,gDACb,aAAa;;;;;;;;cAWD;;;;;;;;IAQd,UAAU,yBAAsB,QAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1,106 +0,0 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
2
- import { HydrateProps, OmitKeyof, QueryClient, QueryOptions, UseInfiniteQueryOptions, WithRequired } from "@tanstack/react-query";
3
- import { ReactNode } from "react";
4
-
5
- //#region src/QueriesHydration.d.ts
6
-
7
- /**
8
- * A server component that fetches multiple queries on the server and hydrates them to the client.
9
- *
10
- * @experimental This component is experimental and may be changed or removed in the future.
11
- *
12
- * @description
13
- * QueriesHydration is designed for React Server Components (RSC).
14
- * It pre-fetches multiple queries on the server side and automatically hydrates
15
- * the data to the client, enabling seamless data synchronization between server and client.
16
- *
17
- * When errors occur during server-side fetching, the component gracefully falls back
18
- * to client-side rendering, ensuring your application remains resilient.
19
- *
20
- * @example
21
- * ```tsx
22
- * // app/page.tsx (Server Component)
23
- * import { Suspense } from 'react'
24
- * import { QueriesHydration } from '@suspensive/react-query'
25
- * import { queryOptions } from '@tanstack/react-query'
26
- *
27
- * const userQueryOptions = (userId: string) => queryOptions({
28
- * queryKey: ['user', userId],
29
- * queryFn: () => fetchUser(userId)
30
- * })
31
- *
32
- * const postsQueryOptions = () => queryOptions({
33
- * queryKey: ['posts'],
34
- * queryFn: () => fetchPosts()
35
- * })
36
- *
37
- * export default function Page({ userId }: { userId: string }) {
38
- * return (
39
- * <>
40
- * <Suspense fallback={<div>Loading user...</div>}>
41
- * <QueriesHydration queries={[userQueryOptions(userId)]}>
42
- * <UserProfile />
43
- * </QueriesHydration>
44
- * </Suspense>
45
- *
46
- * <Suspense fallback={<div>Loading posts...</div>}>
47
- * <QueriesHydration queries={[postsQueryOptions()]}>
48
- * <PostsList />
49
- * </QueriesHydration>
50
- * </Suspense>
51
- * </>
52
- * )
53
- * }
54
- * ```
55
- *
56
- * @example
57
- * ```tsx
58
- * // With custom error fallback
59
- * <Suspense fallback={<div>Loading user...</div>}>
60
- * <QueriesHydration
61
- * queries={[userQueryOptions(userId)]}
62
- * skipSsrOnError={{ fallback: <div>Fetching on client...</div> }}
63
- * >
64
- * <UserProfile />
65
- * </QueriesHydration>
66
- * </Suspense>
67
- * ```
68
- *
69
- * @see {@link https://suspensive.org/docs/react-query/QueriesHydration Documentation}
70
- */
71
- declare function QueriesHydration({
72
- queries,
73
- children,
74
- queryClient,
75
- skipSsrOnError,
76
- timeout,
77
- ...props
78
- }: {
79
- /**
80
- * The QueryClient instance to use for fetching queries.
81
- */
82
- queryClient?: QueryClient;
83
- /**
84
- * An array of query options or infinite query options to be fetched on the server. Each query must include a `queryKey`.
85
- * You can mix regular queries and infinite queries in the same array.
86
- */
87
- queries: (WithRequired<QueryOptions<any, any, any, any>, 'queryKey'> | WithRequired<UseInfiniteQueryOptions<any, any, any, any, any>, 'queryKey'>)[];
88
- /**
89
- * Controls error handling behavior:
90
- * - `true` (default): Skips SSR and falls back to client-side rendering when server fetch fails
91
- * - `false`: Proceeds with SSR without hydration (retry fetching on client component server rendering)
92
- * - `{ fallback: ReactNode }`: Skips SSR with custom fallback UI during client-side rendering
93
- */
94
- skipSsrOnError?: boolean | {
95
- fallback: ReactNode;
96
- };
97
- /**
98
- * The timeout in milliseconds for the query.
99
- * If the query takes longer than the timeout, it will be considered as an error.
100
- * When not set, no timeout is applied.
101
- */
102
- timeout?: number;
103
- } & OmitKeyof<HydrateProps, 'state'>): Promise<react_jsx_runtime1.JSX.Element>;
104
- //#endregion
105
- export { QueriesHydration as t };
106
- //# sourceMappingURL=QueriesHydration-DnlRrHJ3.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QueriesHydration-DnlRrHJ3.d.cts","names":[],"sources":["../src/QueriesHydration.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AA6EA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAsB,gBAAA;;;;;;;;;;;gBAWN;;;;;YAMV,aAAa,gDACb,aAAa;;;;;;;;cAWD;;;;;;;;IAQd,UAAU,yBAAsB,QAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1,143 +0,0 @@
1
- import { t as _objectWithoutProperties } from "./objectWithoutProperties-BYP50gyF.mjs";
2
- import { t as ClientOnly } from "./ClientOnly-BdmzVYnI.mjs";
3
- import { t as _objectSpread2 } from "./objectSpread2-BFPIJj0i.mjs";
4
- import { Hydrate, QueryClient, dehydrate } from "@tanstack/react-query";
5
- import { jsx } from "react/jsx-runtime";
6
-
7
- //#region \0@oxc-project+runtime@0.101.0/helpers/asyncToGenerator.js
8
- function asyncGeneratorStep(n, t, e, r, o, a, c) {
9
- try {
10
- var i = n[a](c), u = i.value;
11
- } catch (n$1) {
12
- e(n$1);
13
- return;
14
- }
15
- i.done ? t(u) : Promise.resolve(u).then(r, o);
16
- }
17
- function _asyncToGenerator(n) {
18
- return function() {
19
- var t = this, e = arguments;
20
- return new Promise(function(r, o) {
21
- var a = n.apply(t, e);
22
- function _next(n$1) {
23
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n$1);
24
- }
25
- function _throw(n$1) {
26
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n$1);
27
- }
28
- _next(void 0);
29
- });
30
- };
31
- }
32
-
33
- //#endregion
34
- //#region src/QueriesHydration.tsx
35
- const _excluded = [
36
- "queries",
37
- "children",
38
- "queryClient",
39
- "skipSsrOnError",
40
- "timeout"
41
- ];
42
- /**
43
- * A server component that fetches multiple queries on the server and hydrates them to the client.
44
- *
45
- * @experimental This component is experimental and may be changed or removed in the future.
46
- *
47
- * @description
48
- * QueriesHydration is designed for React Server Components (RSC).
49
- * It pre-fetches multiple queries on the server side and automatically hydrates
50
- * the data to the client, enabling seamless data synchronization between server and client.
51
- *
52
- * When errors occur during server-side fetching, the component gracefully falls back
53
- * to client-side rendering, ensuring your application remains resilient.
54
- *
55
- * @example
56
- * ```tsx
57
- * // app/page.tsx (Server Component)
58
- * import { Suspense } from 'react'
59
- * import { QueriesHydration } from '@suspensive/react-query'
60
- * import { queryOptions } from '@tanstack/react-query'
61
- *
62
- * const userQueryOptions = (userId: string) => queryOptions({
63
- * queryKey: ['user', userId],
64
- * queryFn: () => fetchUser(userId)
65
- * })
66
- *
67
- * const postsQueryOptions = () => queryOptions({
68
- * queryKey: ['posts'],
69
- * queryFn: () => fetchPosts()
70
- * })
71
- *
72
- * export default function Page({ userId }: { userId: string }) {
73
- * return (
74
- * <>
75
- * <Suspense fallback={<div>Loading user...</div>}>
76
- * <QueriesHydration queries={[userQueryOptions(userId)]}>
77
- * <UserProfile />
78
- * </QueriesHydration>
79
- * </Suspense>
80
- *
81
- * <Suspense fallback={<div>Loading posts...</div>}>
82
- * <QueriesHydration queries={[postsQueryOptions()]}>
83
- * <PostsList />
84
- * </QueriesHydration>
85
- * </Suspense>
86
- * </>
87
- * )
88
- * }
89
- * ```
90
- *
91
- * @example
92
- * ```tsx
93
- * // With custom error fallback
94
- * <Suspense fallback={<div>Loading user...</div>}>
95
- * <QueriesHydration
96
- * queries={[userQueryOptions(userId)]}
97
- * skipSsrOnError={{ fallback: <div>Fetching on client...</div> }}
98
- * >
99
- * <UserProfile />
100
- * </QueriesHydration>
101
- * </Suspense>
102
- * ```
103
- *
104
- * @see {@link https://suspensive.org/docs/react-query/QueriesHydration Documentation}
105
- */
106
- function QueriesHydration(_x) {
107
- return _QueriesHydration.apply(this, arguments);
108
- }
109
- function _QueriesHydration() {
110
- _QueriesHydration = _asyncToGenerator(function* (_ref) {
111
- let { queries, children, queryClient = new QueryClient(), skipSsrOnError = true, timeout } = _ref, props = _objectWithoutProperties(_ref, _excluded);
112
- const timeoutController = timeout != null && timeout >= 0 ? createTimeoutController(timeout, `QueriesHydration: timeout after ${timeout} ms)`) : void 0;
113
- try {
114
- const queriesPromise = Promise.all(queries.map((query) => "getNextPageParam" in query ? queryClient.fetchInfiniteQuery(query) : queryClient.fetchQuery(query)));
115
- yield timeoutController != null ? Promise.race([queriesPromise, timeoutController.promise]) : queriesPromise;
116
- timeoutController === null || timeoutController === void 0 || timeoutController.clear();
117
- } catch (_unused) {
118
- timeoutController === null || timeoutController === void 0 || timeoutController.clear();
119
- if (skipSsrOnError) return /* @__PURE__ */ jsx(ClientOnly, {
120
- fallback: skipSsrOnError === true ? void 0 : skipSsrOnError.fallback,
121
- children
122
- });
123
- }
124
- return /* @__PURE__ */ jsx(Hydrate, _objectSpread2(_objectSpread2({}, props), {}, {
125
- state: dehydrate(queryClient),
126
- children
127
- }));
128
- });
129
- return _QueriesHydration.apply(this, arguments);
130
- }
131
- const createTimeoutController = (ms, errorMessage) => {
132
- let timerId;
133
- return {
134
- promise: new Promise((_, reject) => {
135
- timerId = setTimeout(() => reject(new Error(errorMessage)), ms);
136
- }),
137
- clear: () => timerId != null && clearTimeout(timerId)
138
- };
139
- };
140
-
141
- //#endregion
142
- export { QueriesHydration as t };
143
- //# sourceMappingURL=QueriesHydration-GQxJe_Vu.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QueriesHydration-GQxJe_Vu.mjs","names":["timerId: ReturnType<typeof setTimeout> | undefined"],"sources":["../src/QueriesHydration.tsx"],"sourcesContent":["import {\n Hydrate,\n type HydrateProps,\n type OmitKeyof,\n QueryClient,\n type QueryOptions,\n type UseInfiniteQueryOptions,\n type WithRequired,\n dehydrate,\n} from '@tanstack/react-query'\nimport type { ReactNode } from 'react'\nimport { ClientOnly } from './components/ClientOnly'\n\n/**\n * A server component that fetches multiple queries on the server and hydrates them to the client.\n *\n * @experimental This component is experimental and may be changed or removed in the future.\n *\n * @description\n * QueriesHydration is designed for React Server Components (RSC).\n * It pre-fetches multiple queries on the server side and automatically hydrates\n * the data to the client, enabling seamless data synchronization between server and client.\n *\n * When errors occur during server-side fetching, the component gracefully falls back\n * to client-side rendering, ensuring your application remains resilient.\n *\n * @example\n * ```tsx\n * // app/page.tsx (Server Component)\n * import { Suspense } from 'react'\n * import { QueriesHydration } from '@suspensive/react-query'\n * import { queryOptions } from '@tanstack/react-query'\n *\n * const userQueryOptions = (userId: string) => queryOptions({\n * queryKey: ['user', userId],\n * queryFn: () => fetchUser(userId)\n * })\n *\n * const postsQueryOptions = () => queryOptions({\n * queryKey: ['posts'],\n * queryFn: () => fetchPosts()\n * })\n *\n * export default function Page({ userId }: { userId: string }) {\n * return (\n * <>\n * <Suspense fallback={<div>Loading user...</div>}>\n * <QueriesHydration queries={[userQueryOptions(userId)]}>\n * <UserProfile />\n * </QueriesHydration>\n * </Suspense>\n *\n * <Suspense fallback={<div>Loading posts...</div>}>\n * <QueriesHydration queries={[postsQueryOptions()]}>\n * <PostsList />\n * </QueriesHydration>\n * </Suspense>\n * </>\n * )\n * }\n * ```\n *\n * @example\n * ```tsx\n * // With custom error fallback\n * <Suspense fallback={<div>Loading user...</div>}>\n * <QueriesHydration\n * queries={[userQueryOptions(userId)]}\n * skipSsrOnError={{ fallback: <div>Fetching on client...</div> }}\n * >\n * <UserProfile />\n * </QueriesHydration>\n * </Suspense>\n * ```\n *\n * @see {@link https://suspensive.org/docs/react-query/QueriesHydration Documentation}\n */\nexport async function QueriesHydration({\n queries,\n children,\n queryClient = new QueryClient(),\n skipSsrOnError = true,\n timeout,\n ...props\n}: {\n /**\n * The QueryClient instance to use for fetching queries.\n */\n queryClient?: QueryClient\n /**\n * An array of query options or infinite query options to be fetched on the server. Each query must include a `queryKey`.\n * You can mix regular queries and infinite queries in the same array.\n */\n queries: (\n | WithRequired<QueryOptions<any, any, any, any>, 'queryKey'>\n | WithRequired<UseInfiniteQueryOptions<any, any, any, any, any>, 'queryKey'>\n )[]\n /**\n * Controls error handling behavior:\n * - `true` (default): Skips SSR and falls back to client-side rendering when server fetch fails\n * - `false`: Proceeds with SSR without hydration (retry fetching on client component server rendering)\n * - `{ fallback: ReactNode }`: Skips SSR with custom fallback UI during client-side rendering\n */\n skipSsrOnError?:\n | boolean\n | {\n fallback: ReactNode\n }\n /**\n * The timeout in milliseconds for the query.\n * If the query takes longer than the timeout, it will be considered as an error.\n * When not set, no timeout is applied.\n */\n timeout?: number\n} & OmitKeyof<HydrateProps, 'state'>) {\n const timeoutController =\n timeout != null && timeout >= 0\n ? createTimeoutController(timeout, `QueriesHydration: timeout after ${timeout} ms)`)\n : undefined\n try {\n const queriesPromise = Promise.all(\n queries.map((query) =>\n 'getNextPageParam' in query ? queryClient.fetchInfiniteQuery(query) : queryClient.fetchQuery(query)\n )\n )\n await (timeoutController != null ? Promise.race([queriesPromise, timeoutController.promise]) : queriesPromise)\n timeoutController?.clear()\n } catch {\n timeoutController?.clear()\n if (skipSsrOnError) {\n return (\n <ClientOnly fallback={skipSsrOnError === true ? undefined : skipSsrOnError.fallback}>{children}</ClientOnly>\n )\n }\n }\n return (\n <Hydrate {...props} state={dehydrate(queryClient)}>\n {children}\n </Hydrate>\n )\n}\n\nconst createTimeoutController = (ms: number, errorMessage: string) => {\n let timerId: ReturnType<typeof setTimeout> | undefined\n return {\n promise: new Promise<never>((_, reject) => {\n timerId = setTimeout(() => reject(new Error(errorMessage)), ms)\n }),\n clear: () => timerId != null && clearTimeout(timerId),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EE;CACA;CACA;CACA;CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AALF,SAAsB,iBAAiB;;;;wDAqCD;MArCC,EACrC,SACA,UACA,cAAc,IAAI,aAAa,EAC/B,iBAAiB,MACjB,kBACG;EAgCH,MAAM,oBACJ,WAAW,QAAQ,WAAW,IAC1B,wBAAwB,SAAS,mCAAmC,QAAQ,MAAM,GAClF;AACN,MAAI;GACF,MAAM,iBAAiB,QAAQ,IAC7B,QAAQ,KAAK,UACX,sBAAsB,QAAQ,YAAY,mBAAmB,MAAM,GAAG,YAAY,WAAW,MAAM,CACpG,CACF;AACD,SAAO,qBAAqB,OAAO,QAAQ,KAAK,CAAC,gBAAgB,kBAAkB,QAAQ,CAAC,GAAG;AAC/F,mFAAmB,OAAO;oBACpB;AACN,mFAAmB,OAAO;AAC1B,OAAI,eACF,QACE,oBAAC;IAAW,UAAU,mBAAmB,OAAO,SAAY,eAAe;IAAW;KAAsB;;AAIlH,SACE,oBAAC,2CAAY;GAAO,OAAO,UAAU,YAAY;GAC9C;KACO;;;;AAId,MAAM,2BAA2B,IAAY,iBAAyB;CACpE,IAAIA;AACJ,QAAO;EACL,SAAS,IAAI,SAAgB,GAAG,WAAW;AACzC,aAAU,iBAAiB,OAAO,IAAI,MAAM,aAAa,CAAC,EAAE,GAAG;IAC/D;EACF,aAAa,WAAW,QAAQ,aAAa,QAAQ;EACtD"}
@@ -1,148 +0,0 @@
1
- const require_objectWithoutProperties = require('./objectWithoutProperties-CYXRK7DS.cjs');
2
- const require_ClientOnly = require('./ClientOnly-Dvf8t__-.cjs');
3
- const require_objectSpread2 = require('./objectSpread2-CpqxxdM2.cjs');
4
- let __tanstack_react_query = require("@tanstack/react-query");
5
- let react_jsx_runtime = require("react/jsx-runtime");
6
-
7
- //#region \0@oxc-project+runtime@0.101.0/helpers/asyncToGenerator.js
8
- function asyncGeneratorStep(n, t, e, r, o, a, c) {
9
- try {
10
- var i = n[a](c), u = i.value;
11
- } catch (n$1) {
12
- e(n$1);
13
- return;
14
- }
15
- i.done ? t(u) : Promise.resolve(u).then(r, o);
16
- }
17
- function _asyncToGenerator(n) {
18
- return function() {
19
- var t = this, e = arguments;
20
- return new Promise(function(r, o) {
21
- var a = n.apply(t, e);
22
- function _next(n$1) {
23
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n$1);
24
- }
25
- function _throw(n$1) {
26
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n$1);
27
- }
28
- _next(void 0);
29
- });
30
- };
31
- }
32
-
33
- //#endregion
34
- //#region src/QueriesHydration.tsx
35
- const _excluded = [
36
- "queries",
37
- "children",
38
- "queryClient",
39
- "skipSsrOnError",
40
- "timeout"
41
- ];
42
- /**
43
- * A server component that fetches multiple queries on the server and hydrates them to the client.
44
- *
45
- * @experimental This component is experimental and may be changed or removed in the future.
46
- *
47
- * @description
48
- * QueriesHydration is designed for React Server Components (RSC).
49
- * It pre-fetches multiple queries on the server side and automatically hydrates
50
- * the data to the client, enabling seamless data synchronization between server and client.
51
- *
52
- * When errors occur during server-side fetching, the component gracefully falls back
53
- * to client-side rendering, ensuring your application remains resilient.
54
- *
55
- * @example
56
- * ```tsx
57
- * // app/page.tsx (Server Component)
58
- * import { Suspense } from 'react'
59
- * import { QueriesHydration } from '@suspensive/react-query'
60
- * import { queryOptions } from '@tanstack/react-query'
61
- *
62
- * const userQueryOptions = (userId: string) => queryOptions({
63
- * queryKey: ['user', userId],
64
- * queryFn: () => fetchUser(userId)
65
- * })
66
- *
67
- * const postsQueryOptions = () => queryOptions({
68
- * queryKey: ['posts'],
69
- * queryFn: () => fetchPosts()
70
- * })
71
- *
72
- * export default function Page({ userId }: { userId: string }) {
73
- * return (
74
- * <>
75
- * <Suspense fallback={<div>Loading user...</div>}>
76
- * <QueriesHydration queries={[userQueryOptions(userId)]}>
77
- * <UserProfile />
78
- * </QueriesHydration>
79
- * </Suspense>
80
- *
81
- * <Suspense fallback={<div>Loading posts...</div>}>
82
- * <QueriesHydration queries={[postsQueryOptions()]}>
83
- * <PostsList />
84
- * </QueriesHydration>
85
- * </Suspense>
86
- * </>
87
- * )
88
- * }
89
- * ```
90
- *
91
- * @example
92
- * ```tsx
93
- * // With custom error fallback
94
- * <Suspense fallback={<div>Loading user...</div>}>
95
- * <QueriesHydration
96
- * queries={[userQueryOptions(userId)]}
97
- * skipSsrOnError={{ fallback: <div>Fetching on client...</div> }}
98
- * >
99
- * <UserProfile />
100
- * </QueriesHydration>
101
- * </Suspense>
102
- * ```
103
- *
104
- * @see {@link https://suspensive.org/docs/react-query/QueriesHydration Documentation}
105
- */
106
- function QueriesHydration(_x) {
107
- return _QueriesHydration.apply(this, arguments);
108
- }
109
- function _QueriesHydration() {
110
- _QueriesHydration = _asyncToGenerator(function* (_ref) {
111
- let { queries, children, queryClient = new __tanstack_react_query.QueryClient(), skipSsrOnError = true, timeout } = _ref, props = require_objectWithoutProperties._objectWithoutProperties(_ref, _excluded);
112
- const timeoutController = timeout != null && timeout >= 0 ? createTimeoutController(timeout, `QueriesHydration: timeout after ${timeout} ms)`) : void 0;
113
- try {
114
- const queriesPromise = Promise.all(queries.map((query) => "getNextPageParam" in query ? queryClient.fetchInfiniteQuery(query) : queryClient.fetchQuery(query)));
115
- yield timeoutController != null ? Promise.race([queriesPromise, timeoutController.promise]) : queriesPromise;
116
- timeoutController === null || timeoutController === void 0 || timeoutController.clear();
117
- } catch (_unused) {
118
- timeoutController === null || timeoutController === void 0 || timeoutController.clear();
119
- if (skipSsrOnError) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ClientOnly.ClientOnly, {
120
- fallback: skipSsrOnError === true ? void 0 : skipSsrOnError.fallback,
121
- children
122
- });
123
- }
124
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tanstack_react_query.Hydrate, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, props), {}, {
125
- state: (0, __tanstack_react_query.dehydrate)(queryClient),
126
- children
127
- }));
128
- });
129
- return _QueriesHydration.apply(this, arguments);
130
- }
131
- const createTimeoutController = (ms, errorMessage) => {
132
- let timerId;
133
- return {
134
- promise: new Promise((_, reject) => {
135
- timerId = setTimeout(() => reject(new Error(errorMessage)), ms);
136
- }),
137
- clear: () => timerId != null && clearTimeout(timerId)
138
- };
139
- };
140
-
141
- //#endregion
142
- Object.defineProperty(exports, 'QueriesHydration', {
143
- enumerable: true,
144
- get: function () {
145
- return QueriesHydration;
146
- }
147
- });
148
- //# sourceMappingURL=QueriesHydration-dcSAzQNT.cjs.map