Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4 release #3842

Merged
merged 134 commits into from
Jul 18, 2022
Merged

v4 release #3842

merged 134 commits into from
Jul 18, 2022

Conversation

TkDodo
Copy link
Collaborator

@TkDodo TkDodo commented Jul 18, 2022

No description provided.

TkDodo and others added 30 commits December 7, 2021 08:56
* feat(hydration): remove hydration package (#2936)

* V4: streamline cancel refetch (#2937)

* feat: streamline cancelRefetch

the following functions now default to true for cancelRefetch:

- refetchQueries (+invalidateQueries, + resetQueries)
- query.refetch
- fetchNextPage (unchanged)
- fetchPreviousPage (unchanged)

* feat: streamline cancelRefetch

make sure that refetchOnReconnect and refetchOnWindowFocus do not cancel already running requests

* feat: streamline cancelRefetch

update tests

refetch and invalidate now both cancel previous queries, which is intended, so we get more calls to the queryFn in these cases

* feat: streamline cancelRefetch

add more tests for cancelRefetch behavior

* feat: streamline cancelRefetch

update docs and migration guide

* feat: streamline cancelRefetch

simplify conditions by moving the ?? true default down to fetch on observer level; all 3 callers (fetchNextPage, fetchPreviousPage and refetch) just pass their options down and adhere to this default; refetch also only has 3 callers:
- refetch from useQuery, where we want the default
- onOnline and onFocus, where we now explicitly pass false to keep the previous behavior

and add more tests

* feat: streamline cancelRefetch

we always call this.fetch() with options, so we can just as well make the mandatory

also, streamline signatures by destructing values that can't be forwarded (and use empty object as default value) in options and just spread the rest

* feat: streamline cancelRefetch

fix types for refetch

it was accidentally made too wide and allowed all refetchFilters, like `predicate`; but with `refetch` on an obserserver, there is nothing to filter for, except the page, so that is what we need to accept via `RefetchPageFilters`

* feat: streamline cancelRefetch

refetch never took a queryKey as param - it is always bound to the observer

* feat: better query filters (#2938)

* fix: rename react directory to reactjs (#2884)

* fix: rename react directory to reactjs

the directory being named "react" causes an error with the moduleDirectories option from jest

* fix: update package.json files to match the updated reactjs directory name

* fix: change react test utils imports to match new directory name

* docs(v4): add renamed reactjs details to migration guide

Co-authored-by: Eddy Vinck <eddy.vinck@isaac.nl>

* feat: mutation cache duration (#2963)

* feat: mutation cachetime

stramline queryCache / mutationCache events by combining them into notifiable.ts

* feat: mutation cachetime

removable

* feat: mutation cachetime

add gc to mutations

* feat: mutation cachetime

streamline event types between queries and mutations

* feat: mutation cachetime

tests, and I forgot to implement optionalRemove, so make it abstract

* feat: mutation cachetime

replicate gc behavior from #2950 and add more tests

* feat: mutation cachetime

get test coverage back to 100%

* feat: mutation cachetime

docs

* feat: mutation cachetime

try to make tests more resilient

* feat: mutation cachetime

fix imports after merge conflict

* refactor(persistQueryClient): Make persistQueryClient stable (#2961)

* 🚚 Remove experimental from persist-query-client

* 🚚 Rename persistor -> persister

* ✏️  Fix Persistor -> Persister in imports

* 🚚 Update name in rollup config

* 🚚 Move createAsyncStoragePersister and createWebStoragePersister to stable version and rename persistor -> persister

* 📝  Update documentation

* 📝   Add migrating to v4 docs

* Apply suggestions from code review

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

* 2964 changes to on success callback (#2969)

* feat(useQuery): onSuccess callback

do not call onSuccess if update was done manually from setQueryData

* feat(useQuery): onSuccess callback

test that onSuccess is not called when setQueryData is used

* feat(useQuery): onSuccess callback

docs changes

* feat(useQuery): onSuccess callback

options spread is wrong - `updatedAt` is actually `dataUpdatedAt`. Oddly we didn't have a test, so I added one

* 2919 query key array (#2988)

* feat: query key array

remove code that internally ensures that we get an Array, because it is now the expected interface, ensured by TypeScript

* feat: query key array

update tests to the new syntax

* feat: query key array

fix assertions, because there is no array wrapping happening internally anymore. The key you receive from the context is exactly the key you passed in

* feat: query key array

this test doesn't make much sense anymore

* feat: query key array

 wrapping in an extra array doesn't yield the same results anymore since v4 because keys need to be an array

* feat: query key array

make docs adhere to new array key syntax

* feat: query key array

migration docs

* feat(QueryObserver): track queries as default (#2987)

* feat(Query Options): remove notifyOnChangePropsExclusion

- remove related code from queryObserver
- remove type def
- remove related tests

* docs(Query Options): update notifyOnChangePropsExclusion sections

- remove from api references
- add to v4 migration guide

* feat(QueryObserver): "tracked" as default behavior

- remove "tracked" completely if notifyOnChangeProps is not defined, behave as v3 "tracked"
- add `notifyOnChangeProps: 'all' to opt out of the smart tracking

TODO: Now that default behavior has changed, work out the failed tests. Which parts to change for current ones and possibly write new ones.

* test(useQuery): adjust tests to pass for notifyOnChangeProps udpate

* test(useInfiniteQuery): adjust tests to pass for notifyOnChangeProps udpate

* test(QueryResetErrorBoundary): adjust tests to pass for notifyOnChangeProps udpate

* refactor(QueryObserver): use nullish coalescing operator

much cleaner than the negated if I started with

* test(QueryResetErrorBoundary): remove "tracked" from test

* revert: test(QueryResetErrorBoundary): adjust tests to pass for notifyOnChaneProps udpate

This reverts commit a34b472.

The changes are not necessary after PR #2993 fix.

* refactor(QueryObserver): combine prop checks

* docs(notifyOnChangeProps): update docs to reflect new api

* refactor: Remove deprecated promise cancel (#2996)

* 🔥 Remove the cancel method on promise for cancelling promise

* ✅  Fix query client tests

* ✅   Update query and useQuery tests

* ✅   Update use infinite query tests

* 📝   Update migartion guide

* 🐛 Fix linking in documentation

* 📝 Fix grammatical errors in docs

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

* :refactor: Use abortSignal for query cancellation in InfiniteQueryBehavior

* 🚨  Fix lint errors

* ♻️ Move define signal property to a separate function

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

* remove test that doesn't make sense anymore - we don't allow different falsy query keys now

* 2927 offline queries (#3006)

* feat(useQuery): offline queries

remove defaultQueryObserverOptions because it is the same as defaultQueryOptions and we can just use that

* feat(useQuery): offline queries

setup dependent default values, to make it easier to work with them

* feat(useQuery): offline queries

basic changes to retryer:
- pause the query before fetching depending upon networkMode
- pause retries depending upon networkRetry

* feat(useQuery): offline queries

move networkRetry and networkMode defaults to the retryer creation, because we need the same for mutations

* feat(useQuery): offline queries

decouple focus and online manager: we're now informing caches of a focus when we're focussed, and about an online event if we come online; if the retryer continues, it can then decide to not fetch depending on our networkMode

* feat(useQuery): offline queries

expose isPaused on the queryResult and make sure isFetching is false when we are paused

* feat(useQuery): offline queries

knowing if we can fetch depends on if we are paused or not, as other conditions should apply

also, rename options (not sure if that will stick though)

* feat(useQuery): offline queries

adjust existing tests for isPaused being exposed

* feat(useQuery): offline queries

fix existing test by setting options to emulate the previous behaviour, otherwise, with `mockNavigatorOnline` being set to false right from the start, the mutation would never fire off

* feat(useQuery): offline queries

adapt onOnline, onFocus tests to new behavior: they are now decoupled, and onOnline is always called even when not focused and vice versa. The retryer should make sure to not continue fetching if necessary

* feat(useQuery): offline queries

first test for networkMode

* feat(useQuery): offline queries

isFetching and isPaused are now derived and stored together in a fetchingState enum (idle, fetching, paused)

* feat(useQuery): offline queries

better networkMode api: online, always, offlineFirst (basically always but with paused retries)

* feat(useQuery): offline queries

more tests for networkMode: online

* feat(useQuery): offline queries

more tests for networkMode: online

* feat(useQuery): offline queries

tests for networkMode: always

* feat(useQuery): offline queries

fix tests that were influencing each other by using proper jest mocks for online and visibility state

* add paused queries to the devtools.tsx

* feat(useQuery): offline queries

never stop pausing when continueFn is called. Initially, I only had this guard for when it's called from the outside, e.g. for onWindowFocus while still being offline, but we need this always because otherwise query cancellation can potentially continue a paused query

* feat(useQuery): offline queries

okay, pausing multiple times was a bad idea, continueFn() will be called eventually anyways

* feat(useQuery): offline queries

attempt at offline toggle button

* feat(useQuery): offline queries

different icons, padding, color

* feat(useQuery): offline queries

i messed up the icon order

* feat(useQuery): offline queries

guard against illegal state transitions: paused queries can unmount or get cancelled, in which case we shouldn't continue them, even if we dispatch the continue event

* feat(useQuery): offline queries

fix devtools tests, account for paused queries

* Revert "feat(useQuery): offline queries"

This reverts commit a647f64.

* feat(useQuery): offline queries

keep the do-not-start logic out of the run function, and thus out of promiseOrValue. if the promise has already been resolved in the meantime, e.g. because of a `cancel`, the run method will just do nothing, while the previous logic would've started to fetch

* feat(useQuery): offline queries

show inactive as higher priority than paused

* feat(useQuery): offline queries

make sure that optimistic results don't show an intermediate fetching state, but go opmistically to paused instead

* feat(useQuery): offline queries

real result needs to match optimistic result

* feat(useQuery): offline queries

stupid mistake

* feat(useQuery): offline queries

keep status color and status label in sync

* feat(useQuery): offline queries

make networkMode param mandatory for canFetch (and default to online internally) so that we can't screw that up again

* feat(useQuery): offline queries

make sure test "finishes" to avoid prints to the console if another test goes online again

* feat(useQuery): offline queries

move cancel function to the top, as it's no longer dependent on the promise since the `.cancel` function is gone; all we need is to abort the signal and reject the promise of the retryer

* feat(useQuery): offline queries

inline canContinue, because it's now only called if the query is in paused state anyways

* feat(useQuery): offline queries

avoid the impossible state by not calling config.onContinue for already resolved queries, as that would put them right into fetching state again, without actually fetching

* feat(useQuery): offline queries

let resolved querie continue, but don't put them in fetching state

* feat(useQuery): offline queries

fix merge conflict and invert condition because no-negated-condition

* feat(useQuery): offline queries

add test for abort signal consumed - different results expected for node < 15 where we don't have AbortController, thus can't consume the signal

* feat(useQuery): offline queries

online queries should not fetch if paused and we go online when cancelled and no refetchOnReconnect

* feat(useQuery): offline queries

gc test

* feat(useQuery): offline queries

offlineFirst test

* feat(useQuery): offline queries

mock useMediaQuery to get rid of unnecessary check in devtools - if window is defined, `matchMedia` is also defined

* feat(useQuery): offline queries

use a higher retryDelay to make test more stable, otherwise, it might start retrying before we "go offline"

* feat(useQuery): offline queries

improve devtools test: check if onClick props are being called

* feat(useQuery): offline queries

add devtools test for offline mock

* feat(useQuery): offline queries

offline mutations test

* feat(useQuery): offline queries

network mode docs (unfinished)

* feat(useQuery): offline queries

network mode docs

* feat(useQuery): offline queries

fix merge conflicts

* refactor(queryClient): remove undocumented methods

* fix: offline mutations fixes (#3051)

* feat: offline mutations

move reducer into Mutation class to avoid passing state (and options) around

* feat: offline mutations

optimistically set paused state depending on if we can fetch or not to avoid an intermediate state where we are loading but not paused

* examples: fix query keys in basic examples

because we need those for preview builds

* fix(useMutation): make sure cacheCallbacks are always called

even if the useMutation component unmounts and we have a cacheTime of 0; the fix was cherry-picked from the react-18 branch, where we also introduced this behavior

* Feature/cachetime zero (#3054)

* refactor: cacheTime-zero

remove special handling for cacheTime: 0 and schedule a normal garbage collection for those queries. They will be eligible for gc after a setTimeout(0), but then they will only be optionally removed. This makes sure that paused queries are NOT gc'ed

* refactor: cacheTime-zero

remove special test "about online queries with cacheTime:0 should not fetch if paused and then unmounted". paused queries will now be kept until they continue, just like with every other query, unless query cancellation or abort signal was involved

* refactor: cacheTime-zero

adapt "remounting" test: if the same query with cacheTime 0 unmounts and remounts in the same cycle, the query will now be picked up and will not go to loading state again. I think this is okay

* refactor: cacheTime-zero

re-add instant query removal after fetching, because fetching via `queryClient.fetchQuery` will not remove the query otherwise, because the normal gc-mechanism now checks for `hadObservers` due to a suspense issue :/

* refactor: cacheTime-zero

weird edge case: the previous logic was instantly removing the query _while_ it was still fetching, which is something we likely don't want. The data will stay in the currentQuery of the observer if the observer unsubscribes but still exists, and a new subscription will pick it up, unless the query was explicitly cancelled or the abort signal was consumed.

* refactor: cacheTime-zero

we need to wait a tick because even cacheTime 0 now waits at least a setTimeout(0) to be eligible for gc

* refactor: cacheTime-zero

schedule a new garbage collection after each new fetch; this won't do anything  when you still have observers, but it fixes an edge case where prefetching took longer than the cacheTime, in which case the query was again never removed

test needed adaption because we don't instantly remove, but deferred by a tick

* refactor: cacheTime-zero

stabilize test

* refactor: cacheTime-zero

apply a different suspense "workaround": do not garbage collect when fetching optimistically (done only by suspense) - gc will kick in once an observer subscribes; this will make sure we can still gc other fetches that don't have an observer consistently, like prefetching when the fetch takes longer than the gc time (which was leaking with the old workaround)

* refactor: cacheTime-zero

remove leftover

* refactor: cacheTime-zero

since every fetch triggers a new gc cycle, we don't need to do this in a loop anymore
also, reset isFetchingOptimistic after every fetch

* add publishing capabilities for alpha branch

* fix(queryFilters): fetchStatus to queryFilters (#3061)

Co-authored-by: Eddy <eddyvinck95@gmail.com>
Co-authored-by: Eddy Vinck <eddy.vinck@isaac.nl>
Co-authored-by: Prateek Surana <prateeksurana3255@gmail.com>
Co-authored-by: Rene Dellefont <renedellefont@gmail.com>

BREAKING CHANGE: new query filters, query key must be an array
* refactor(core): refactor retryer from a class to a function

* refactor(core): refactor notifyManager from a class to a function

* refactor(core): refactor notifyManager from a class to a function

remove outdated comment
* feat(useQueries): update API to use object syntax

New v4 API - instead of taking an array of queries, `useQueries` now accepts an object with a `queries` key. The value of this key is an array of queries (this array is unchanged from v3).

* test(useQueries): update tests for new API

* docs(useQueries): update docs for v4 API
copied over from the react-18 branch, because that impl is less flaky
another one copied over from the react-18 branch, because that impl is less flaky
* refactor: make listeners required

because the only place where we pass no listener in is in tests

* refactor: make notifyOnChangeProps a Set
* chore: update caniuselite

* chore: remove const-enum babel plugin

because we don't use const-enums anymore

* chore: require ts 4.1

* chore: update rollup and plugins

* chore: update typescript and ts-eslint

* refactor: remove notifiable base class

this abstraction costs more than the simple duplication, and we also have other notify functions which were not unified
…y is on (#3087)

adding "error" to the list of tracked properties will result in us _only_ tracking error if we want to track all properties implicitly by _not_ observing any properties (because we check for trackedProps.size). Moving the adding of "error" to _after_ the size check fixes this
# Conflicts:
#	src/core/tests/focusManager.test.tsx
#	src/core/tests/onlineManager.test.tsx
# Conflicts:
#	src/core/queryObserver.ts
to not log to the console per default; to access process.ENV, we need to enable node typings, which screws with setTimeout / setInterval, as typings are different for node and the browser; I tried to keep the changes to type-level only
# Conflicts:
#	src/core/query.ts
#	src/core/queryObserver.ts
#	src/reactjs/tests/useQuery.test.tsx
#	src/reactjs/types.ts
* refactor: remove cancel method as it no longer exists

it wasn't doing anything in that test

* refactor: remove cancel method as it no longer exists

use signal in playground example instead of cancel fn
* feat(persistQueryClient): improve persist controls

add restore/save/subscribe

* docs: update persistQueryClient and hydration

* docs: describe new persist features

* docs(persistQueryClient): correct option defaults

* feat(persistQueryClient): enable unsubscribe

* docs(persistQueryClient): clarify restoration

* docs(persistQueryClient): enable unsubscribe note

* fix(persistQueryClient): subscribe awaits restore
# Conflicts:
#	src/core/notifyManager.ts
#	src/core/types.ts
The example contains at least one inacurate statement,

> It will then cache the data using `'todos'` and `fetchTodos` as the unique identifiers for that cache.

and could benefit from more precise language.
* fix(core): do not refetch disabled queries

with refetchQueries or invalidateQueries + refetchType "inactive"

disabled queries (=queries that have observers which are all enabled:false) are matched as "inactive"; this is okay when searching for them via findAll or for removeQueries, but the docs clearly state that refetchQueries / invalidateQueries do not refetch disabled queries, and that the only way to refetch them is via refetch returned from useQuery; this is important when using enabled to signal that some dependencies are not yet ready

some tests needed to be adapted because we used disabled observer + refetchQueries a lot. The easiest way to emulate the observers we wanted here was mostly with initialData + staleTime, and to get a real inactive query, we just need to subscribe + unsubscribe immediately

* fix(core): do not refetch disabled queries

add tests for refetchQueries + disabled

* fix(core): do not refetch disabled queries

update test to make more sense - title said disabled queries, but we had no disabled query; test now does the opposite of what it did before, but that's what this PR does :)
as it wasn't really aborting the request - there is no AbortSignal for Mutations atm.
* refactor(QueryClient): add dev warning

Warn when several query defaults match a given key.
Could be error prone if the returned defaults are not the expected ones.
The order of registration does matter.

* test(QueryClient): warning with defaults options

Highlight how query defaults registration order matters.

* doc(QueryClient): add notes about query defaults

In `getQueryDefaults`, the **first** matching default is returned.
In `setQueryDefaults`, highlight how the registration order is important.

* doc(QueryClient): fix link to documentation

* test(QueryClient): better test

* refactor(QueryClient): use internal logger

* doc(QueryClient): fix markup

* doc(QueryClient): remove extra entry

* refacto(QueryClient): warn about several query defaults

Warning must be displayed any time a conflict is detected, not just for dev build.
The warning is aimed at helping developers *using* react-query, not those *developping* react-query.

* Update src/core/queryClient.ts

Remove useless optional chaining.

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

* feat(utils): add assert helper

* refactor(QueryClient): add dev warning for mutation defaults

* Revert "feat(utils): add assert helper"

This reverts commit 05c3fe1.

* refactor(QueryClient): error when several defaults

Review how the check for multiple defaults  on a key is raised.
Ensure it remains fast in release build.

* refactor(QueryClient): inline code

Co-authored-by: Guillaume Labat <guillaume.labat+git@imagino.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* Bail out if query data undefined

* Fix failing test

* docs: migration guide for undefined data

* docs: update setQueryData reference

* Update docs/src/pages/guides/migrating-to-react-query-4.md

Co-authored-by: Louis Law <louiscklaw@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
…3285)

Add an example on how to `compress`/`decompress` data from local storage in case you need to cache large payloads.

Context: #2864 (comment)
* refactor: size

inline reducers in query and mutation because they are only used from dispatch

* refactor: remove default case in reducers

actions are only produced by our own code, which is in TypeScript, so we'll get a type error if there is an action not handled. Unknown actions can't exist, as the tests show: we'd need a ts-expects-error to go this way

* refactor: inline executeMutation

because it's only used once

* refactor: inline getObserver and updateObservers in useQueries

because it's only used once

* refactor: extract getDefaultState

getDefaultState is a pure function, with no access to `this`, so we can extract it. This is in-line with what `mutation` is doing

* refactor: remove getNextResult

it was only used in tests, and it's also not documented

* refactor: inline clearTimers

because it's only used once

* refactor: inline shouldNotifyListeners

because it's only used once

* refactor: inline resumePausedMutations

* refactor: tests

every stubbed queryFn needs a mock implementation to avoid console errors:

Error: Query data cannot be undefined
tannerlinsley and others added 26 commits June 16, 2022 16:37
* Update network-mode.md

Fix the url for query cancellation

* Fix the remaining broken urls in network-mode.md
Update subtitle `PeristQueryClientProvider` to `PersistQueryClientProvider`.
* rebrand

* move to src

* chore: fix build by re-exporting types explicitly

* chore: run everything through prettier

* chore: bring back linting and compilation tasks

* chore: setup eslint-import-resolver-typescript

it still errors with import/no-unresolved, but I think that's because TS errors as well!

* chore: fix a ton of imports

* chore: down to zero ts errors

* chore: export types separately to make the build work

* chore: down to zero eslint issues 🎉

* chore: try to get tests to work

* chore: make tests work

* fix: use better match sorter primitives

* chore: update workflows

* Update ci.yml

* chore: remove match-sorter dependency

* chore: enable bundle size collection

* chore: update to latest react

* fix(devtools): fix typings of rankItems

not sure if that is correct now...

* chore: fix compilation

* tests: fix tests by removing weird comment that is no longer necessary after upgrading react

* tests: remove incrompehensible tests

I don't know what these tests are doing, but overwriting useEffect is not something that makes sense now that we useSyncExternalStore for data fetching anyways ...

* fix(devtools): fix sorting of queries

rankItem doesn't take keys, so we have to pass the queryHash in directly to rank it

* chore: setup ci pipeline and bundlewatch

* chore: build during pr pipelines

* chore: remove private:true

as requested by CI:
Error: Package undefined in /tmp/98d7e7a6 is set to private, remove package.json#private to publish it

* Revert "chore: remove private:true"

This reverts commit e1b237b.

* chore: turn off import/no-unresolved in tests

somehow, that fails in CI, and we have typescript protection against unresolved imports anyhow

* fix: turn of import/no-unresolved for all tanstack imports

* fix: regex

* chore: do not run legacy pipelines on PRs

* chore: fix ci check names

* chore: add react-17 dependencies

* chore: split up ci tasks

* fix: building is done via bundlesize reporting

so we don't need to build during testing

* chore: try to make codesandbox ci work

it requires package to be public, but for installing and yarn workspaces, we need it to be private

* fix: apply private: false to all workspaces

* fix: paths to sandboxes

* chore: fix code coverage collection

* chore: change imports from react-query to tanstack/react-query

* docs: update migration docs with the rebrand

* chore: revert codemod changes

prettier destroyed the assertions

* fix(useIsMutating): we need to subscribe to the right cache

this is likely a copy-paste error, and the tests only worked because we render top-down; now, the tests make sure that components are re-rendered because of the subscription itself

* Update README.md

* docs: devtools documentation for tanstack rebrand

* fix builds

* chore: cleanup

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* chore: fix the test:format and csb install scripts

* chore: not sure why there is a lint error in this test...

* chore: update lock files

* chore: get basic example working again

* Revert "chore: get basic example working again"

This reverts commit a58472e.

* Revert "chore: update lock files"

This reverts commit 8794f65.

* refactor: webStoragPersister -> syncStoragePersister
…fiers (#3801)

* feat(codemod): add codemod that replaces the react-query import specifiers

* feat(codemod): add codemod that replaces the react-query import specifiers

update migration docs

* feat(codemod): add codemod that replaces the react-query import specifiers

re-add yarn installation instructions
Update links to simple and basic examples
Co-authored-by: simple <simple@woowahan.com>
whereever -> wherever
I have used as an example "staleTime: Infinity", but it can be whatever makes sense here. 
I've had a hard time figuring out where to put my options just by reading the explanation below the code example.
we use npm now
1) main field was wrong
2) useSyncExternalStore wasn't picked up correctly
* refactor: apply import codemod to examples

* refactor: update import in typescript example

* refactor: more import updates

* chore: run prettier over examples

* chore: try to setup codesandbox-ci for the monorepo structure

* chore: force the use of npm ci in the pipeline

* chore: install with leagacy peer deps

* chore: try --force instead

* chore: re-generate lock file in the hopes that it fixes the install problems

* chore: force testing-library to v12.1.4

because 12.1.5 only supports react < 18, and we install both 17 and 18

* chore: try again with legacy peer deps now that only eslint-config is failing

* chore: try if removing examples from workspaces changes a damn thing

* Revert "chore: try if removing examples from workspaces changes a damn thing"

This reverts commit c4be184.

* chore: try a specific node version

* chore: add dependencies to correct packages

* chore: add missing dev dependencies (maybe)

* chore: add more top level devDependencies

* chore: move jscodeshift to the top, too

* chore: try with npm install

* chore: run node16 only!

* chore: run node16 only

* chore: remove devDependencies from top level package.json again

root cause seems to be sub-packages not being installed with `npm ci`, so we switched to `npm install` instead
# Conflicts:
#	.github/workflows/ci-v3.yml
#	README.md
#	docs/src/pages/examples/auto-refetching.mdx
#	docs/src/pages/examples/basic-graphql-request.mdx
#	docs/src/pages/examples/basic.mdx
#	docs/src/pages/examples/custom-hooks.mdx
#	docs/src/pages/examples/default-query-function.mdx
#	docs/src/pages/examples/focus-refetching.mdx
#	docs/src/pages/examples/load-more-infinite-scroll.mdx
#	docs/src/pages/examples/nextjs.mdx
#	docs/src/pages/examples/optimistic-updates-typescript.mdx
#	docs/src/pages/examples/optimistic-updates.mdx
#	docs/src/pages/examples/pagination.mdx
#	docs/src/pages/examples/playground.mdx
#	docs/src/pages/examples/prefetching.mdx
#	docs/src/pages/examples/react-native.mdx
#	docs/src/pages/examples/rick-morty.mdx
#	docs/src/pages/examples/simple.mdx
#	docs/src/pages/examples/star-wars.mdx
#	docs/src/pages/examples/suspense.mdx
#	docs/src/pages/index.js
#	packages/query-core/src/types.ts
#	src/core/mutation.ts
update bash install package from *@tanstack/react-query* to *react-query@beta*
# Conflicts:
#	packages/query-core/src/query.ts
#	packages/query-core/src/queryObserver.ts
# Conflicts:
#	.github/workflows/ci-v3.yml
…upplied (#3834)

* Added a proof of concept for initialData

* Fleshed out test

* Completed overload change

* More progress

* Testing if a local tsconfig.json quiets down the errors

* Fixed TS errors

* fix(types): extract DefinedQueryResult and use that in tests

* Apply suggestions from code review

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
…alStorage (#3703)

* fix(devtools): make sure that sort function is properly read from localStorage

* test(devtools): wrap getByRole queries with explicit expect statements when the returned element is not used for assertions

* chore(devtools): apply prettier formatting
* chore: remove leftover yarn.lock files

we use npm now

* chore: pin node version to 16.14.2

* chore: run tests before releasing

* chore: make test-and-publish script only run on TanStack/query
@vercel
Copy link

vercel bot commented Jul 18, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
query ✅ Ready (Inspect) Visit Preview Jul 18, 2022 at 3:18PM (UTC)

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@tannerlinsley tannerlinsley merged commit 357ec04 into main Jul 18, 2022
@TkDodo TkDodo deleted the beta branch July 28, 2022 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.