Skip to content

Tags: uidotdev/react-query

Tags

v4.0.0-alpha.20

Toggle v4.0.0-alpha.20's commit message
Merge remote-tracking branch 'react-query/master' into alpha

v4.0.0-alpha.19

Toggle v4.0.0-alpha.19's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix(createAsyncStoragePersister): persistClient respects throttleTime (

…TanStack#3331) (TanStack#3336)

v4.0.0-alpha.18

Toggle v4.0.0-alpha.18's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix(react-native): bring back check for window.addEventListener (TanS…

…tack#3345)

because it does not exist in RN, but window is defined

v4.0.0-alpha.17

Toggle v4.0.0-alpha.17's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix(mutations): avoid infinite loading states if callbacks return an …

…error (TanStack#3343)

* fix(mutations): avoid infinite loading states if callbacks return an error

add failing test cases

* fix(mutations): avoid infinite loading states if callbacks return an error

by making sure we always dispatch the error to go to error state internally;
re-writing to async-await because it has better support than promise.finally, and the flow is also easier to reason about here

* fix(mutations): fix merge conflicts

v4.0.0-alpha.16

Toggle v4.0.0-alpha.16's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
feat(*): add optional logger prop to QueryClient config (TanStack#3246)

- remove setLogger
- add optional `logger` prop to QueryClientConfig
- add getLogger public method to QueryClient
- add optional `logger` prop to QueryConfig and MutationConfig
- add getDefaultLogger function which returns a default logger based on
environment, which is used by everything that takes an optional logger
in their config
- add createQueryClient test util function that uses a mock logger
- replace all `new QueryClient` calls with createQueryClient calls
- remove mockConsoleError and usages from tests, which are not necessary anymore

BREAKING CHANGE: remove setLogger

v4.0.0-alpha.15

Toggle v4.0.0-alpha.15's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
feat: remove idle state (TanStack#3302)

* feat: remove idle state

in favor of status: loading & fetchStatus: idle

* feat: remove idle state

remove isIdle boolean

* feat: remove idle state

documentation around the removed idle state and the new fetchingStatus

* feat: remove idle state

add missing ' to docs

v4.0.0-alpha.14

Toggle v4.0.0-alpha.14's commit message
Merge remote-tracking branch 'react-query/master' into alpha

# Conflicts:
#	src/react/utils.ts
#	src/reactjs/useBaseQuery.ts
#	src/reactjs/useMutation.ts

v3.34.16

Toggle v3.34.16's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix(useQuery): pass query as second parameter to useErrorBoundary fun…

…ction(TanStack#2660)

v4.0.0-alpha.13

Toggle v4.0.0-alpha.13's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
feat: Version 4 codemods (TanStack#3195)

* chore: add `jscodeshift` library to dev-dependencies

We're planning to deliver codemods for the next release, so we will
need this package to write codemods.

* chore: add `@types/jscodeshift` library to dev-dependencies

* chore: add an empty `jest` config file under the `codemods` directory

For some reason the `moduleNameMapper` causes an error when running the
codemod tests, it results in a `transformer is a not function` type
error. In order to avoid this now, I add an empty config file and will
investigate the root cause of the issue later.

* chore: add a very basic codemod implementation and tests

The current codemod is able to change the usages of `useQuery`
according to the new API, so it will put the existing parameters into
an object and pass it as the only parameter, but that's all. More
changes coming soon.

* chore: fix `prettier` errors in `use_query` codemod

* chore: add missing `export` keywords to test suites in case of `use_query` codemod

I just want to avoid `eslint` errors in the IDE.

* feat(codemod): add basic codemods for query client methods

* feat(codemod): add basic `useQueries` codemods

* refactor(codemod): rework `useQuery` related codemods

* feat(codemod): move files under `v4` directory

We decided to move the version 4 related codemods under a separate
directory.

* chore(codemod): move `jscodeshift` library from `dependencies` to `devDependencies`

Accidentally I added this package under `dependencies` but it should be
placed under `devDependencies`.

* chore(codemod): pick up codemods test by `npm test`

From now the `npm test` command will execute the codemod tests as well.

* refactor(codemod): remove `without-parameter` test case in case of `queryClient` related codemods

This test case is not useful at all, it just adds extra code.

* chore(codemod): remove duplications from `queryClient` codemod testfixtures

The number of duplications was just simply too much. It doesn't make
any sense to maintain repetitive boilerplate code.

* chore(codemod): rename `first-parameter-is-identifier` and `object-expression-parameter` test case

* chore(codemod): rework `first-parameter-is-identifier` and `object-expression-parameter` test suites

In these two test cases, we should try to collect as many test cases
as possible.

* chore(codemod): remove duplications from `useQuery` codemod testfixtures

The number of duplications was just simply too much. It doesn't make
any sense to maintain repetitive boilerplate code.

* chore(codemod): add missing methods to the object syntax aware query client codemods

The following methods were missing:
- fetchInfiniteQuery
- fetchQuery
- prefetchInfiniteQuery
- prefetchQuery

* chore(codemod): add some more test cases to the `parameter-is-object` test suite

* feat(codemod): add basic `useMutation` codemods

* refactor(codemod): rename `queryKey` replacer and error, because now the key name can be parameterized

* feat(codemod): add support for template literals

* refactor(codemod): rename `object-syntax-aware` test to `query-client-methods`

I want to combine two tests into a single one.

* refactor(codemod): move testfixtures to the root level of `__testfixtures__` directory

* refactor(codemod): combine the two `queryClient` codemods and test suites into a single one

* refactor(codemod): move `useMutation` related parts and testfixutes to `useQuery` codemod

The plan is to combine all existing codemods into a single one.

* refactor(codemod): remove the whole `use_mutation` library

Regarding the necessary parts that were moved to the `useQuery`
codemod, we don't need the leftover code anymore.

* feat(codemod): add support for the following hook calls:

- `useIsFetching`
- `useIsMutating`

* refactor(codemod): move `useQueries` related parts and testfixutes to `useQuery` codemod

The plan is to combine all existing codemods into a single one.

* refactor(codemod): remove the whole `use_queries` library

Regarding the necessary parts that were moved to the `useQuery`
codemod, we don't need the leftover code anymore.

* refactor(codemod): introduce `transformUseQueryLikeUsages` function

Maybe this change will make the code read easier a bit.

* refactor(codemod): do some refinements on the following tests:

- `parameter-is-identifier`
- `parameter-is-object-expression`

* fix(codemod): in the case of JS, the string literal might be interpreted as `Literal`

So without the additional `Literal` check, the codemod wouldn't be
applied.

* fix(codemod): remove `type` filter from import declarations

This filter seems to be too strict because the codemods were not
applied to the `examples` directory.

* refactor(codemod): move `QueryClient` related parts and testfixutes to `useQuery` codemod

The plan is to combine all existing codemods into a single one.

* refactor(codemod): remove the whole `query_client_methods` library

Regarding the necessary parts that were moved to the `useQuery`
codemod, we don't need the leftover code anymore.

* refactor(codemod): simplify entry point of the codemod

It makes the code a bit slower, but on the other hand, it makes the
code easier to read and understand.

* feat(codemod): add basic `QueryCache` codemods

* fix(codemod): do not transform array expression query keys

We want arrays as query keys, so when the current query key is an
array, we don't need to transform it.

* fix(examples/playground): fix invalid usage of `invalidateQueries`

* feat(codemod): show file path in console warnings

* refactor(codemod): remove `use_query` directory

We decided to group the codemods by major version numbers instead of
types. The reason is simple: we will bundle all necessary
transformations into a single file, so the consumers will have to
apply only one codemod. Hopefully, it will make the DX better.

* refactor(codemod): rename `use-query` to `key-transformation`

The original `use-query` name is not valid anymore, because the
codemod changes the signature of other function/method calls as well.

* refactor(codemod): replace the transformer name in `key-transformation` codemod

I renamed the transformer with the test, so the transformer name also
needs to be updated in the test file.

* chore(codemod): add codemod and utilities to the bundle

We want the code mod to be part of the bundle. If it's part of the
bundle, the consumers can directly access it through the `node_modules`
directory and run it. We just simply would like to increase the DX.

* refactor(codemod): rename function

I shouldn't have committed this. :')

* fix(codemod): keep `typeArguments` of the node

It will prevent the removal of type annotations on a function/method
call.

* refactor(codemod): move `query-cache` test cases to `default-import`

We want to cover the default, named, and namespaced imports in the
case of `QueryCache` as well.

* feat(codemod): add support for named imports in case of `QueryCache` and `useQueryCache`

The codemod must be able to transform usages in the case of named
imports as well.

* fix(codemod): always return `Identifier` instance in case of `findImportIdentifier` of function

Previously it returned a string as a default value and it could lead
to errors in the code.

* feat(codemod): add support for namespaced imports in case of `QueryCache` and `useQueryCache`

The codemod must be able to transform usages in the case of namespaced
imports as well.

* refactor(codemod): re-use the previously written utility functions in the hook call transformer

By this, we can achieve the same functionality with less code
repetition.

* refactor(codemod): re-use the previously written utility functions in the query-client transformer

By this, we can achieve the same functionality with less code
repetition.

* refactor(codemod): rename `hook-call-transformer` to `use-query-like` transformer

I think this name describes better the purpose of this transformer.

* chore(codemod): add todo about the `react-query` import check

We shouldn't transform files that don't contain `react-query` imports.

* refactor(codemod): make the `use-query-like-transformer` to look the same as other transformers

I just want to follow the structure of other transformers.

* fix(codemod): do not log warnings in the test environment

Warning the user about the unprocessable query keys is useful in
production, but in the test environment, it just makes it more
difficult to read the output.

* docs(codemod): add instructions how to apply codemods

* chore(examples): apply codemod on the `examples` directory

* docs(codemod): update `Codemod` section

The suggested text sounds better. :)

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>

v4.0.0-alpha.12

Toggle v4.0.0-alpha.12's commit message
Merge remote-tracking branch 'react-query/master' into alpha