Update dependency @reduxjs/toolkit to ^2.4.0 #1128
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^2.3.0
->^2.4.0
Release Notes
reduxjs/redux-toolkit (@reduxjs/toolkit)
v2.4.0
Compare Source
This feature release includes multiple tweaks and fixes to RTK Query functionality, additional exported TS types, and drops support for TS versions earlier than 5.0.
Changelog
RTK Query Improvements
Lazy query hooks can now be reset.
retry.fail
now acceptsmeta
as a second argument.Tag invalidation arrays now ignore nullish values.
We did some small internal refactoring around Maps and default values that shrank bundle size slightly.
Bugfixes
Passing
skipToken
to a query hook now bails out before running any other logic, which fixes cases whereserializeQueryArgs
previously threw an error because there were no args to process.The
autoBatchEnhancer
now readswindow.requestAnimationFrame
later, which it to work properly with Jest fake timers.We fixed cases where the hook result
isSuccess
flag would briefly flicker tofalse
when switched to a different cache entry that was uninitialized, and would briefly flicker totrue
when refetching a query that previously errored.The listener middleware previously had inconsistent logic checks for comparing against existing listener entries (effect + type, vs effect only). It now always checks both effect + type.
Additional TS Types
We now export
Typed[Query|Mutation]OnQueryStarted
helpers to let you defineonQueryStarted
callbacks outside ofcreateApi
if desired.We also now export a
CreateAsyncThunkFunction
type that can be used to type userland wrappers aroundcreateAsyncThunk
.TS Support Matrix Updates
We've historically tried to maintain TS backwards compatibility as long as possible, and made occasional updates to our TS support matrix in minor versions over time. As of RTK 2.3.0, we officially supported back through TS 4.7.
As of this release, we're tweaking that support policy to match the policy used by DefinitelyTyped:
Given that, we've dropped official support for TS versions earlier than 5.0. (RTK may work with those versions, but we no longer test against them and won't try to fix issues with those versions.)
We'll continue to update our TS support matrix over time based on that 2-year rolling window.
What's Changed
window.rAF
later to allow fake timers to work correctly by @ensconced in https://github.com/reduxjs/redux-toolkit/pull/4701OnQueryStarted
callbacks by @aryaemami59 in https://github.com/reduxjs/redux-toolkit/pull/4713createAsyncThunk
without thewithTypes
method by @EskiMojo14 in https://github.com/reduxjs/redux-toolkit/pull/4667isSuccess: true
when switching to an uninitialized cache entry by @markerikson in https://github.com/reduxjs/redux-toolkit/pull/4731isSuccess
consistent when refetching after an error by @markerikson in https://github.com/reduxjs/redux-toolkit/pull/4732Full Changelog: reduxjs/redux-toolkit@v2.3.0...v2.4.0
Configuration
📅 Schedule: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.