Skip to content

feat: expose mutation variables - #4814

Merged
TkDodo merged 83 commits into
v5from
mutation-refactoring
Feb 18, 2023
Merged

TkDodo merged 83 commits into
v5from
mutation-refactoring

Conversation

@TkDodo

@TkDodo TkDodo commented Jan 13, 2023

Copy link
Copy Markdown
Collaborator

No description provided.

TkDodo added 30 commits January 5, 2023 20:33
to get smaller bundlesize
because with our new browserslist, we'll always have an AbortController
returning the object and inlining the call yields "cannot redefine signal" ...
fix focusManager tests by not accessing private methods
remove a test that tests an impossible case
as the test said, there is no way to trigger #notify without listeners, so we can remove the whole test + code that relates to it
as the tests says, it's unused, so we can remove it completely
we can add the same observer twice and check that the observerAdded event has only been fired once
fix onlineManager tests by not accessing private methods
they have not been accessed outside of query
it was always set to true - there is no way to _not_ notify the cache
a simple truthy check suffices, as we can only pass an Array or undefined in here
because we also use it for mutationKeys
signal is now always defined
re-wrote some tests and removed some others that weren't easily testable without relying on internals
- remove undocumented variables option in MutationOptions and pass variables via `execute` method instead
- reset mutation variables to allow for ui-based optimistic updates
- get rid of notifyOptions by just forwarding the whole action - the options were a wrapper that turned action with a discriminated union into two booleans, which doesn't make much sense as you can only ever be in one of the states
# Conflicts:
#	docs/react/guides/migrating-to-v5.md
#	packages/query-core/src/query.ts
#	packages/query-core/src/queryCache.ts
#	packages/query-core/src/tests/mutations.test.tsx
#	packages/query-core/src/tests/queriesObserver.test.tsx
#	packages/query-core/src/tests/queryCache.test.tsx
# Conflicts:
#	packages/react-query/src/__tests__/useInfiniteQuery.test.tsx
#	packages/vue-query/src/mutationCache.ts
# Conflicts:
#	packages/query-core/src/mutationObserver.ts
#	packages/react-query/src/__tests__/suspense.test.tsx
# Conflicts:
#	packages/query-core/src/mutation.ts
@vercel

vercel Bot commented Jan 30, 2023 •

Copy link
Copy Markdown

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

1 Ignored Deployment
Name Status Preview Comments Updated
query ⬜️ Ignored (Inspect) Feb 18, 2023 at 1:59PM (UTC)

# Conflicts:
#	packages/query-core/src/mutation.ts
instead of useMutationVariables, which can be implemented with useMutationState
@TkDodo
TkDodo requested a review from DamianOsipiuk February 12, 2023 16:42
@TkDodo
TkDodo merged commit 765f619 into v5 Feb 18, 2023
@TkDodo
TkDodo deleted the mutation-refactoring branch February 18, 2023 14:02
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.

3 participants