0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
Commit graph

5,264 commits

Author SHA1 Message Date
Tanner Linsley
538816015e Update comparison.md 2022-03-26 08:29:08 -06:00
Tanner Linsley
c4c90b323c Merge branch 'master' of https://github.com/tannerlinsley/react-query 2022-03-26 08:28:28 -06:00
Tanner Linsley
6f7d8aa8c3 Update comparison.md 2022-03-26 08:28:26 -06:00
Henrique Derosa
ba81870efb
fix(devtools): serialize bigint types (#3440) v3.34.18
* fix(devtools): serialize bigint types

* test(devtools): Add missing test for displayValue

* refactor: Improve code for displayValue function
2022-03-26 08:28:47 +01:00
Tanner Linsley
fc4671f073 docs: comparison 2022-03-24 14:21:28 -06:00
Tanner Linsley
e41f5c63af
docs: update comparison 2022-03-24 14:17:33 -06:00
Dominik Dorfmeister
31bcaf1b54
fix(useIsFetching): account for fetches happening in the same render cycle (#3438) v3.34.17
if a fetch happens in the same render cycle as useIsFetching is mounting, but it is mounted after the query, what happens is that:

- the initial state of `isFetching` is `0` because the effect to fetch the query hasn't started yet
- the query effect runs before the isFetching effect, which means we miss the event, thus the next event we get from the subscription gives us 0 again

so we need to check for isFetching in the effect that runs to set up the subscription as well. This catches fetches that basically started in the same effect cycle, but before "our" effect ran
2022-03-24 20:33:19 +01:00
Alex Anderson
ce61a2a594
docs: Add a backlink to bytes.dev (#3429)
* docs: updates for new react-query course

Change removes convert kit for email capture and migrates it to Bytes. Copy updates to promote the new React Query Course are included.

* Add the PPP discount banner for the ui.dev React Query course.

* Add a backlink to Bytes.

Co-authored-by: Benjamin Adam <benjamin.mark.adam@gmail.com>
2022-03-22 12:21:37 -06:00
Alex Anderson
0cbd1fdc02
docs: updates for new react-query course (#3414)
* docs: updates for new react-query course

Change removes convert kit for email capture and migrates it to Bytes. Copy updates to promote the new React Query Course are included.

* Add the PPP discount banner for the ui.dev React Query course.

Co-authored-by: Benjamin Adam <benjamin.mark.adam@gmail.com>
2022-03-22 10:25:49 -06:00
lironezra
16783feed1
docs: infinite scroll example uses react-intersection-observer (#3410) 2022-03-16 20:31:32 +01:00
Liam Tait
c6594df791
refactor(devtools): add types to Explorer (#2949)
* refactor(devtools): add types to Explorer

Add types to Explorer component with as minimal functional changes as
possible while still getting type safety

2742

* remove unused set param from explorer toggle

* Wrap Explorer toggle with useCallback

* Rename Explorer toggle to toggleExpanded

* Remove unused path

* Move subEntryPages definition next to usage

* Set type to be a string instead of string union

* Remove unused depth prop

* Move chunkArrays to own tested function

* set handleEntry as required

* Add LabelButton for accesibility

* fix test

* Remove shadowing

* Set subEntries as empty array by default

* Add type for property

* Convert handleEntry function to react component with entry props

* Use unknown for value

* Set RenderProps to required where possible

* Add required attributes to Explorer tests
2022-03-15 13:02:54 +01:00
Binaya Chaudhary
69cc49b7c5
docs: update gitpod link in contributing.md (#3376) 2022-03-13 09:15:48 +01:00
Ken Huh
feb8eb822a
docs: fix a typo in mutations.md (#3386) 2022-03-13 07:32:38 +01:00
ASchwad
7be6d89d68
docs: Extend simple example to handle failed request (#3322) 2022-03-03 20:28:40 +01:00
Eugene Dzhumak
3e8f499aba
docs: update rtk-query comparison.md (#3328)
rtk-query stars counter points to an archived repo.

Query now lives in the main repo as a package.

I understand that this isn't totally right, but at least it seems reasonable not to count start of an archived repo.
2022-02-25 19:59:11 +01:00
Dominik Dorfmeister
b44c213b39
fix(useQuery): pass query as second parameter to useErrorBoundary function(#2660) v3.34.16 2022-02-20 14:09:43 +01:00
Ikko Ashimine
eb4e863cf4
docs: Update CONTRIBUTING.md (#3299)
Github -> GitHub
github -> GitHub
2022-02-14 15:24:59 +01:00
allcontributors[bot]
e8338f92cd
docs: add zrwsk as a contributor for doc (#3297)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-02-14 10:55:00 +01:00
meskill
21fa86d21d
docs: add caveats about memory to ssr.md (#3290)
* docs: add caveats about memory to ssr.md

* revert style changes

* Update docs/src/pages/guides/ssr.md

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

* Update docs/src/pages/guides/ssr.md

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

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-02-13 20:41:34 +01:00
Jakub Żurawski
f2bfc69285
docs(mutations): describe difference between using callbacks in useMu… (#3274)
* docs(mutations): describe difference between using callbacks in useMutation and .mutate

* Text corrections

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

* add subheader

* update consecutive mutations case to better describe ordering of mutation calls and fulfillment

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-02-13 20:39:32 +01:00
Andrii Artemenko
9b5d18cd47
fix(devtools): add code element's background (#3287) v3.34.15
Prevent code element's backround from being overwritten
2022-02-12 20:15:33 +01:00
flash548
e3df8b1841
docs: Update useQuery.md (#3281)
was missing the placeholderData field on the `useQuery` options signature... but its listed in detail on the latter part of the page.
2022-02-12 18:49:02 +01:00
Tommy Tan
d8c46ce30a
docs: update testing.md (#3278)
fixes sentence by removing "our".
2022-02-08 22:43:35 +01:00
Ville Saukkonen
6d6d9d06cd
docs(setQueriesData): Make setQueriesData more searchable (#3244)
* docs(setQueriesData): Make setQueriesData more searchable

- Makes setQueriesData more searchable
- Change mention of fuzzily matching to partial matching since fuzzy matching is more arbitrary algorithm
- Mention setQueriesData in setQueryData to avoid confusion of behaviours

The purpose of this change is to make setQueriesData a bit more searchable from the docs to avoid confusion like this: https://github.com/tannerlinsley/react-query/discussions/3239

* Apply suggestions from code review

Co-authored-by: Ville Saukkonen <villesau@users.noreply.github.com>

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-02-06 15:09:21 +01:00
Dominik Dorfmeister
b38eed6326 chore: fix prettier v3.34.14 2022-02-06 09:47:24 +01:00
Arty
a470f4601b
fix(types): useQueries to also handle array-params with typed QueryKey (#3267)
* fix(types): handle useQueries wrappers with strongly-typed array parameters

* test(types): confirm typecheck passes without explicit type for mapped query

* test(types): add typecheck on queryFn in mapped query
2022-02-06 09:33:59 +01:00
Arnaud
efb77d7c40
docs(cancellation): add graphql request v4 example (#3264) 2022-02-05 13:09:21 +01:00
Jeff Sims
a536773b00
fix(types): export QueriesOptions and QueriesResults types for useQueries (#3251) v3.34.13
* refactor(useQueries) export QueriesOptions type

export the QueriesOptions type

closes #3250

* refactor(useQueries): add export to index

Add the export of the QueriesOptions type to the index file

* refactor(useQueries) export QueriesResults type

Export QueriesResults type

Co-authored-by: Jeffrey Sims <jeffreysims@Jeffrey-Sims-Mac.local>
2022-02-05 08:34:37 +01:00
fediev
4dcb490d4d
docs(tests): infinite scroll without click more button (#3247)
On the first rendering, `hasNextPage` is `undefined`, but converted to `true` by the default value.

For intersection observer to trigger correctly without clicking more button, `hasNextPage` needs type casting.
2022-01-30 14:58:28 +01:00
Amen SOUISSI
6710bc1715
fix(types): use MutationKey instead of QueryKey for useIsMutating (#3222) v3.34.12 2022-01-23 16:47:23 +01:00
Dominik Dorfmeister
c532d81313
fix(core): make sure batching finishes if exception is thrown (#3216) v3.34.11
incrementing and decrementing transactions need to happen in an atomic operation, no matter what happens in between; if we increment, but never decrement, we will get to a state where transactions can never become zero - we're basically "leaking" an open transaction. This leads to no observers being informed ever again because we think we still have an open transaction

this can be fixed by using try/finally to always decrement the transactions
2022-01-21 13:24:22 +01:00
Bennett Dams
f5a0ceceae
docs(ssr): Hydration caveat for Next.js' rewrites (#3209) v3.34.10
Adds a small section for a caveat about hydration when using some specific feature/configuration of Next.js
2022-01-21 13:19:42 +01:00
Arty
11f4ea99c0
fix(useQueries): allow types to work with strongly typed QueryFunction + QueryKey (#3214) 2022-01-21 13:18:28 +01:00
Damian Osipiuk
26b39546cc
fix(types): export QueryClientConfig interface (#3203) v3.34.9 2022-01-21 13:10:11 +01:00
Arnaud
e328ca0bc3
docs(examples): react-native: regenerate yarn.lock (#3197)
Regenerate a clean yarn.lock file without versions issues.
2022-01-16 09:16:17 +01:00
Arnaud
56e3ba7a9c
docs(examples): react-native: update .gitignore to exclude lib folder (#3196) 2022-01-14 14:06:50 +01:00
Arnaud
6722d06d22
docs(examples): react-native basic app in typescript (#3174)
* examples: react-native

Same example as in the Expo snack but in Typescript

* docs(examples): react-native: add link to the typescript version in the repo

* fix: use proper type for onAppStateChange
2022-01-14 09:16:34 +01:00
Dominik Dorfmeister
755702dd78
fix(queryObserver): fix data stability (#3183) v3.34.8
by making sure to memoize the structurally shared version of data rather than the raw one
2022-01-12 14:53:10 +01:00
maricabertarini
d4c6798edf
docs(examples/load-more-infinite-scroll): fix wrong condition (#3175) 2022-01-11 20:40:53 +01:00
Scott Davis
02f681d6ae
docs(useMutation): clarify retry default value (#3159)
This makes the default value more apparent and adds `retry` and `retryDelay` to the example code.
2022-01-05 18:42:55 +01:00
allcontributors[bot]
98fbec5896
docs: add arnaudbzn as a contributor for code, doc (#3157)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-01-04 22:25:40 +01:00
Arnaud
d779df14e9
docs(examples): add react native expo snack example (#3156) 2022-01-04 22:15:51 +01:00
Dominik Dorfmeister
d12d0cf5bc
chore: issue template (#3154) 2022-01-02 12:44:19 +01:00
Dmitriy Fishman
f4eb19421c
docs: Fix a typo in tkdodos-blog.md (#3152) 2021-12-31 11:29:15 +01:00
DidrikLind
93824ec731
refactor(examples): use triple equal instead of double equal (#3135) 2021-12-28 22:12:04 +01:00
Dominik Dorfmeister
d7faf86005
fix(queryObserver): memoized select functions should not return outdated values (#3140) v3.34.7
not all runs to createResult are saved on `this.currentResult` (optimistically created updates do not - we just create the result again later). With the fix from #3098, we made sure that memoized select does not run again in those cases by storing every run. However, that now means that we cannot rely on `prevResult.data` because it might still contain outdated data.

The solution is to store a pair of previous selectFn + data and return the exact data that was computed from the previous select fn if we get the exact same function passed
2021-12-28 18:34:17 +01:00
Damian Osipiuk
b977cf4ddd
refactor(types): use core types in useMutation instead of redefining them (#3122) 2021-12-23 10:13:10 +01:00
Marco Pasqualetti
ca2a57aa4e
fix(devtools): code color is not inherited from panel color (#3115) v3.34.6 2021-12-23 10:07:53 +01:00
Dominik Dorfmeister
3981f5219a
fix(query): set error to null when going to loading state (#3106) v3.34.5
to be aligned with the types, as `loading` cannot have an `error` set.
2021-12-17 12:54:54 +01:00
Dominik Dorfmeister
2054f5b227
fix(queryObserver): make sure that memoized select function only runs once per input (#3098) v3.34.4
we compute the result optimistically, and then one more time when calling setOptions. Both times run the select function because only setOptions will update the previous result and previous options. storing the "previous" selectFn separately on the observer whenever it was invoked (independent of the fact from where it was called) side-steps the issue
2021-12-15 19:52:32 +01:00