autobrr/web
KaiserBh db7ab7c99a
feat(web): migrate Tanstack Query to v5 (#1277)
* feat: migrate to v5

* refactor: Revise error handling in QueryClient for compatibility with React Query v5

The `useErrorBoundary` option has been renamed to `throwOnError` and suspense have been removed: more on suspense more on suspense.
https://tanstack.com/query/v5/docs/react/guides/migrating-to-v5#new-hooks-for-suspense

* refactor: Callbacks on useQuery (and QueryObserver) have been removed

onSuccess, onError and onSettled have been removed from Queries. They haven't been touched for Mutations. Please see this https://github.com/TanStack/query/discussions/5279 for motivations behind this change and what to do instead.

* refactor: change to isPending, isLoading have been renamed for mutations.

Also, they are using object now:
- useQuery(key, fn, options)
+ useQuery({ queryKey, queryFn, ...options })

* refactor: change to placeHolderData.

Removed keepPreviousData in favor of placeholderData identity function
https://tanstack.com/query/v5/docs/react/guides/migrating-to-v5#removed-keeppreviousdata-in-favor-of-placeholderdata-identity-function

* fix: useSuspenseQuery instead of useQuery.

* fix(web): more useSuspenseQuery substitutions

* whoops - nobody saw that okay?

* fix pnpm lockfile

* fix pnpm lockfile again

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
Co-authored-by: soup <soup@r4tio.dev>
2023-12-25 15:37:29 +01:00
..
dist refactor(web): migrate create-react-app to vite (#823) 2023-04-10 14:28:24 +02:00
public fix(web): Inter font (#1133) 2023-09-22 18:37:56 +02:00
src feat(web): migrate Tanstack Query to v5 (#1277) 2023-12-25 15:37:29 +01:00
.eslintrc.cjs build(web): bump vite and cjs node api refactor (#1276) 2023-12-15 23:36:16 +01:00
.gitignore refactor(web): migrate create-react-app to vite (#823) 2023-04-10 14:28:24 +02:00
build.go fix(web): PWA asset and route handling (#898) 2023-05-02 19:06:53 +02:00
index.html fix(web): Inter font (#1133) 2023-09-22 18:37:56 +02:00
package.json feat(web): migrate Tanstack Query to v5 (#1277) 2023-12-25 15:37:29 +01:00
pnpm-lock.yaml feat(web): migrate Tanstack Query to v5 (#1277) 2023-12-25 15:37:29 +01:00
postcss.config.cjs build(web): bump vite and cjs node api refactor (#1276) 2023-12-15 23:36:16 +01:00
README.md build(web): bump vite and cjs node api refactor (#1276) 2023-12-15 23:36:16 +01:00
tailwind.config.ts build(web): bump vite and cjs node api refactor (#1276) 2023-12-15 23:36:16 +01:00
tsconfig.json build(web): bump vite and cjs node api refactor (#1276) 2023-12-15 23:36:16 +01:00
tsconfig.node.json build(web): bump vite and cjs node api refactor (#1276) 2023-12-15 23:36:16 +01:00
vite.config.ts build(web): bump vite and cjs node api refactor (#1276) 2023-12-15 23:36:16 +01:00

web

This project uses React built with Vite.

Available Scripts

In the project directory, you can run:

pnpm dev

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

pnpm run build

Builds the app for production to the dist folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

Learn More

To learn React, check out the React documentation.