TanStack / query

🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
https://tanstack.com/query
MIT License
42.77k stars 2.93k forks source link

fix(react-query): QueryErrorResetBoundaryValue as class #8029

Closed manudeli closed 2 months ago

nx-cloud[bot] commented 2 months ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit ce765b178f1bcd2ff06c8eb7e3779af921f87623. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets - [`nx affected --targets=test:sherif,test:knip,test:eslint,test:lib,test:types,test:build,build --parallel=3`](https://cloud.nx.app/runs/hbA3KH1lp2?utm_source=pull-request&utm_medium=comment) - [`nx run-many --target=build --exclude=examples/** --exclude=integrations/**`](https://cloud.nx.app/runs/dFqDLHFh7b?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.

pkg-pr-new[bot] commented 2 months ago

Open in Stackblitz

More templates

- [@tanstack/query-example-angular-basic](https://pkg.pr.new/template/d0504419-a88b-4769-b42d-70fb0380abfa) - [@tanstack/query-example-angular-infinite-query-with-max-pages](https://pkg.pr.new/template/7560af0e-8569-4a70-8def-a33e4ebc13a5) - [@tanstack/query-example-angular-router](https://pkg.pr.new/template/8abe6334-77dc-4f66-9501-327c6cbfd6e7) - [@tanstack/query-example-react-algolia](https://pkg.pr.new/template/57aa81e8-2a3f-406e-906e-67cdb744548e) - [@tanstack/query-example-angular-simple](https://pkg.pr.new/template/58deff74-0cb9-4345-a845-e11da0d381ea) - [@tanstack/query-example-react-auto-refetching](https://pkg.pr.new/template/89c497c7-bec1-488e-9549-d5682d0beb8e) - [@tanstack/query-example-react-basic](https://pkg.pr.new/template/ca200eeb-afd6-4c36-8c5d-96ec245d3ca6) - [@tanstack/query-example-react-default-query-function](https://pkg.pr.new/template/7559d157-adb2-4f5b-a856-1efbcace7b58) - [@tanstack/query-example-react-basic-graphql-request](https://pkg.pr.new/template/1f8c0557-1ae2-4f3b-beeb-55d43a8ee4fd) - [@tanstack/query-example-react-infinite-query-with-max-pages](https://pkg.pr.new/template/3438fa85-d80e-4e51-bd15-060e3c45adf8) - [@tanstack/query-example-react-devtools-panel](https://pkg.pr.new/template/1d53594d-321c-4405-a3f5-64c5667a0739) - [@tanstack/query-example-react-load-more-infinite-scroll](https://pkg.pr.new/template/52eabe23-f2bb-4709-aecf-a747996fa23f) - [@tanstack/query-example-react-nextjs](https://pkg.pr.new/template/5fcb04e6-c3ca-4788-b566-3f93995ba6c2) - [@tanstack/query-example-nextjs-suspense-streaming](https://pkg.pr.new/template/62725c00-d204-40d0-a80f-fe78a3b595c9) - [@tanstack/query-example-react-nextjs-app-prefetching](https://pkg.pr.new/template/4c6b2d1c-7a82-4599-9fe3-cb24dcf3bf45) - [@tanstack/query-example-react-optimistic-updates-cache](https://pkg.pr.new/template/cfbc2895-96c2-4425-990e-cd79f9e90955) - [@tanstack/query-example-react-offline](https://pkg.pr.new/template/5ec98a40-4d02-4537-a538-6cffa7b845a4) - [@tanstack/query-example-react-pagination](https://pkg.pr.new/template/4deb3d81-7453-4b4f-a5b1-92deccd1473a) - [@tanstack/query-example-react-optimistic-updates-ui](https://pkg.pr.new/template/e794372e-d711-47fc-a403-8e7a1d0ec49c) - [@tanstack/query-example-react-prefetching](https://pkg.pr.new/template/ead0b727-bda5-413d-a266-e6334df9d693) - [@tanstack/query-example-react-playground](https://pkg.pr.new/template/09e03015-57c9-4256-8499-6d058f6d0ad9) - [@tanstack/query-example-react-router](https://pkg.pr.new/template/bb99fdf4-82b1-4e0e-af13-cfe62109a731) - [@tanstack/query-example-react-react-native](https://pkg.pr.new/template/788a9435-dcfc-42e0-addb-e5e746f5ac28) - [@tanstack/query-example-react-rick-morty](https://pkg.pr.new/template/316e2f99-b88e-4c01-9776-bcf0d7f25251) - [@tanstack/query-example-react-shadow-dom](https://pkg.pr.new/template/b7b95f47-1148-4674-9ce0-9785b415b9dd) - [@tanstack/query-example-react-simple](https://pkg.pr.new/template/c06f6736-b48f-4942-bc40-504074d16123) - [@tanstack/query-example-react-star-wars](https://pkg.pr.new/template/ae15c33b-29c7-47f8-a37a-39918519d163) - [@tanstack/query-example-react-suspense](https://pkg.pr.new/template/016c74e8-81d8-42bf-aff3-0da41274be81) - [@tanstack/query-example-solid-astro](https://pkg.pr.new/template/4087c88f-75b5-48fe-b225-d448b6961642) - [@tanstack/query-example-solid-basic](https://pkg.pr.new/template/594dac76-6bb8-414c-9779-8a4eb932a6d7) - [@tanstack/query-example-solid-basic-graphql-request](https://pkg.pr.new/template/15af3c87-3c9c-474f-b188-3d43bfe95db8) - [@tanstack/query-example-solid-default-query-function](https://pkg.pr.new/template/e03831c0-7755-4e84-8548-74cbf6071edb) - [@tanstack/query-example-solid-simple](https://pkg.pr.new/template/399a1a73-0993-4c56-8900-fd2bae7faa15) - [@tanstack/query-example-solid-start-streaming](https://pkg.pr.new/template/3645d2c6-21df-4cf4-8f64-9d9d9741e27a) - [@tanstack/query-example-svelte-auto-refetching](https://pkg.pr.new/template/0fecba6d-107e-4697-8d17-155f751b467b) - [@tanstack/query-example-svelte-load-more-infinite-scroll](https://pkg.pr.new/template/cbd43ff9-c5ec-4994-84b2-5550c190edc6) - [@tanstack/query-example-svelte-basic](https://pkg.pr.new/template/1143cdad-9e44-44b3-8114-a9cd88def8a8) - [@tanstack/query-example-svelte-playground](https://pkg.pr.new/template/0a0fb27e-3d1f-4b72-a90e-db0a74598c12) - [@tanstack/query-example-svelte-optimistic-updates](https://pkg.pr.new/template/6fd09d8c-b2ab-46f4-a604-8d5cab0ab142) - [@tanstack/query-example-svelte-simple](https://pkg.pr.new/template/f9be6006-7727-4443-ab67-8376a402c367) - [@tanstack/query-example-svelte-ssr](https://pkg.pr.new/template/629424ae-b5b6-485d-a434-2a22c3765815) - [@tanstack/query-example-vue-2.6-basic](https://pkg.pr.new/template/ee026f08-9a70-4f6a-ab0a-86bfd1db1420) - [@tanstack/query-example-svelte-star-wars](https://pkg.pr.new/template/1e5b967b-5f7f-4d4b-bfc8-04e2c93be214) - [@tanstack/query-example-vue-2.7-basic](https://pkg.pr.new/template/2ab56370-21f6-4e93-8a2c-6a07b292171a) - [@tanstack/query-example-vue-basic](https://pkg.pr.new/template/c51240eb-4e9d-49f4-ac2c-a8ce687f25b9) - [@tanstack/query-example-vue-dependent-queries](https://pkg.pr.new/template/ebb62d2c-71f0-47ba-927b-2ce2d9b31167) - [@tanstack/query-example-vue-persister](https://pkg.pr.new/template/b7f3118b-fbd5-4d6a-b0e5-4a153995b285) - [@tanstack/query-example-vue-simple](https://pkg.pr.new/template/16a5a902-e4ff-4e2d-bb11-40f405554bff) - [@tanstack/query-example-vue-nuxt3](https://pkg.pr.new/template/144c7a0f-dde4-4cf0-b843-6c2a89cdf14d)

@tanstack/angular-query-devtools-experimental

``` pnpm add https://pkg.pr.new/@tanstack/angular-query-devtools-experimental@8029 ```

@tanstack/eslint-plugin-query

``` pnpm add https://pkg.pr.new/@tanstack/eslint-plugin-query@8029 ```

@tanstack/angular-query-experimental

``` pnpm add https://pkg.pr.new/@tanstack/angular-query-experimental@8029 ```

@tanstack/query-async-storage-persister

``` pnpm add https://pkg.pr.new/@tanstack/query-async-storage-persister@8029 ```

@tanstack/query-broadcast-client-experimental

``` pnpm add https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@8029 ```

@tanstack/query-core

``` pnpm add https://pkg.pr.new/@tanstack/query-core@8029 ```

@tanstack/query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/query-devtools@8029 ```

@tanstack/query-sync-storage-persister

``` pnpm add https://pkg.pr.new/@tanstack/query-sync-storage-persister@8029 ```

@tanstack/query-persist-client-core

``` pnpm add https://pkg.pr.new/@tanstack/query-persist-client-core@8029 ```

@tanstack/react-query

``` pnpm add https://pkg.pr.new/@tanstack/react-query@8029 ```

@tanstack/react-query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/react-query-devtools@8029 ```

@tanstack/react-query-next-experimental

``` pnpm add https://pkg.pr.new/@tanstack/react-query-next-experimental@8029 ```

@tanstack/react-query-persist-client

``` pnpm add https://pkg.pr.new/@tanstack/react-query-persist-client@8029 ```

@tanstack/solid-query

``` pnpm add https://pkg.pr.new/@tanstack/solid-query@8029 ```

@tanstack/solid-query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/solid-query-devtools@8029 ```

@tanstack/solid-query-persist-client

``` pnpm add https://pkg.pr.new/@tanstack/solid-query-persist-client@8029 ```

@tanstack/svelte-query

``` pnpm add https://pkg.pr.new/@tanstack/svelte-query@8029 ```

@tanstack/svelte-query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/svelte-query-devtools@8029 ```

@tanstack/vue-query

``` pnpm add https://pkg.pr.new/@tanstack/vue-query@8029 ```

@tanstack/svelte-query-persist-client

``` pnpm add https://pkg.pr.new/@tanstack/svelte-query-persist-client@8029 ```

@tanstack/vue-query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/vue-query-devtools@8029 ```

commit: ce765b1

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 80.92%. Comparing base (0f86b4d) to head (ce765b1). Report is 5 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/TanStack/query/pull/8029/graphs/tree.svg?width=650&height=150&src=pr&token=jqEbswkEDQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack)](https://app.codecov.io/gh/TanStack/query/pull/8029?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) ```diff @@ Coverage Diff @@ ## main #8029 +/- ## =========================================== + Coverage 44.51% 80.92% +36.41% =========================================== Files 195 25 -170 Lines 7279 346 -6933 Branches 1629 90 -1539 =========================================== - Hits 3240 280 -2960 + Misses 3662 56 -3606 + Partials 377 10 -367 ``` | [Components](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | Coverage Δ | | |---|---|---| | [@tanstack/angular-query-devtools-experimental](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/angular-query-experimental](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/eslint-plugin-query](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/query-async-storage-persister](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/query-broadcast-client-experimental](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/query-codemods](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/query-core](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/query-persist-client-core](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/query-sync-storage-persister](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/react-query](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `92.44% <100.00%> (-0.06%)` | :arrow_down: | | [@tanstack/react-query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `10.00% <ø> (ø)` | | | [@tanstack/react-query-next-experimental](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/react-query-persist-client](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `100.00% <ø> (ø)` | | | [@tanstack/solid-query](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/solid-query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/solid-query-persist-client](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/svelte-query](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/svelte-query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/svelte-query-persist-client](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/vue-query](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/vue-query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8029/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | |
TkDodo commented 2 months ago

not sure what the advantage of this PR would be, but the disadvantage is that you can't destruct classes, yet this is what the docs suggest and probably everyone is doing:

const { reset } = useQueryErrorResetBoundary()

⬆️ this will fail to work because of this bindings.