fix(deps): update dependency @reduxjs/toolkit to ^1.9.7 #460
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:
^1.9.1→^1.9.7Release Notes
reduxjs/redux-toolkit (@reduxjs/toolkit)
v1.9.7Compare Source
This bugfix release rewrites the RTKQ hook TS types to significantly improve TS perf.
Changelog
RTKQ TS Perf
A number of users had reported that Intellisense for RTKQ API objects was extremely slow (multiple seconds) - see discussion in #3214 . We did some perf investigation on user-provided examples, and concluded that the biggest factor to slow RTKQ TS perf was the calculation of hook names like
useGetPokemonQuery, which was generating a large TS union of types.We've rewritten that hook names type calculation to use mapped types and a couple of intersections. In a specific user-provided stress test repo, it dropped TS calculation time by 60% (2600ms to 1000ms).
There's more potential work we can do to improve things, but this seems like a major perf improvement worth shipping now.
What's Changed
Full Changelog: reduxjs/redux-toolkit@v1.9.6...v1.9.7
v1.9.6Compare Source
This bugfix release adds a new dev-mode middleware to catch accidentally dispatching an action creator, adds a new listener middleware option around waiting for forks, adds a new option to update provided tags when
updateQueryDatais used, reworks internal types to better handle uses with TS declaration output, and fixes a variety of small issues.Changelog
Action Creator Dev Check Middleware
RTK already includes dev-mode middleware that check for the common mistakes of accidentally mutating state and putting non-serializable values into state or actions.
Over the years we've also seen a semi-frequent error where users accidentally pass an action creator reference to
dispatch, instead of calling it and dispatching the action it returns.We've added another dev-mode middleware that specifically catches this error and warns about it.
Additional Options
The listener middleware's
listenerApi.fork()method now has an optionalautoJoinflag that can be used to keep the effect from finishing until all active forked tasks have completed.updateQueryDatanow has anupdateProvidedTagsoption that will force a recalculation of that endpoint's provided tags. It currently defaults tofalse, and we'll likely turn that totruein the next major.Other Fixes
The
builder.addCasemethod now throws an error if atypestring is empty.fetchBaseQuerynow uses an alternate method to clone the originalRequestin order to work around an obscure Chrome bug.The immutability middleware logic was tweaked to avoid a potential stack overflow.
Types Changes
The internal type imports have been reworked to try to fix "type portability" issues when used in combination with TS declaration outputs.
A couple additional types were exported to help with wrapping
createAsyncThunk.What's Changed
Full Changelog: reduxjs/redux-toolkit@v1.9.5...v1.9.6
v1.9.5Compare Source
This bugfix release includes notable improvements to TS type inference when using the
enhancersoption inconfigureStore, and updates the listener middleware to only check predicates if the dispatched value is truly an action object.What's Changed
Full Changelog: reduxjs/redux-toolkit@v1.9.4...v1.9.5
v1.9.4Compare Source
This bugfix release includes tweaks to RTKQ options handling, tweaks for perf updates, dependency updates, and updates to our CI tooling.
Also, please check out our ongoing RTK 2.0 alpha releases! They have significant improvements to bundle size, ESM/CJS compatibility, TS typings, and reducer update performance. We're looking for real-world feedback on behavior, performance, and any issues you might run into.
Changelog
RTK Query Options Updates
Passing
transformResponseas part ofenhanceEndpointscan now override the TS type of the original data.fetchBaseQuerynow properly checks for a globalresponseHandleroption.Performance and Internals
RTK Query now uses Immer's
original()to do comparisons inside ofcopyWithStructuralSharing, which should significantly speed up performance when applying changes from re-fetched data.RTKQ's internal
subscriptionUpdatedaction is now marked as batchable.We've updated dependencies to Immer 9.0.21, Reselect 4.1.8, and Redux 4.2.1.
CI Updates
We've added a suite of example apps built with different frameworks such as CRA 4, CRA 5, Next, and Vite, as well as examples that check for compatibility in Node with CJS and ESM modes and with various TS module resolution modes.
What's Changed
arethetypeswrongautomated CLI check by @markerikson in #3294attwCLI option to treat problems as non-errors by @markerikson in #3316responseHandlerbeing used infetchBaseQueryby @praxxis in #3137resetApiStateby @phryneas in #3333subscriptionUpdatedas autobatched by @markerikson in #3364Full Changelog: reduxjs/redux-toolkit@v1.9.3...v1.9.4
v1.9.3Compare Source
This release fixes a couple issues with the
skip/skipTokenoptions for query hooks, and makes a small perf tweak to serializing query args.Changelog
Skip Behavior
We made a change in v1.9.0 that tried to make some skip behavior more consistent, including clearing out the cached data. However, we had overlooked that our own docs actually said "skipping a query will keep the cached data", and several users pointed this out as they'd been relying on that behavior.
We've reverted that change. Now, setting
{skip: true}orskipTokenfor a query with existing results will keep thedatavalue (reflecting the last successful query), butcurrentDatawill be undefined (reflecting the current settings).We also identified and fixed an issue that could cause subscription entries to leak under a specific combination of timing and settings changes.
Query Arg Serialization Perf
RTKQ relies on serializing query arguments to serve as the cache keys, with the default using
JSON.stringify()+ some logic for sorting keys. There was a report that in some apps, large query arg objects could take a while to stringify and this was being done repeatedly. We've added aWeakMap-based cache for query args to avoid re-serializing existing arg values.What's Changed
Full Changelog: reduxjs/redux-toolkit@v1.9.2...v1.9.3
v1.9.2Compare Source
This bugfix release fixes a memory leak in
createListenerMiddleware, optimizes performance insideserializableMiddleware, adds new options forfetchBaseQuery, adds support for pathRegExpexclusions inserializableMiddlewareandimmutabilityMiddleware, and improves some TS types.Changelog
Bug Fixes
createListenerMiddlewarehad a memory leak that turned out to be due to use ofPromise.race(). We've restructured the logic to fix that.fetchBaseQuerynow correctly combines global options with endpoint / default options in all cases.New Options
fetchBaseQuerynow supports ajsonReplaceroption that will be used when processing JSON.Both dev check middleware now support regular expressions in the
ignoredPathsarray in addition to strings. This adds extra flexibility in skipping certain fields.TS Changes
The
CaseReducertype was sometimes incorrectly inferring its return type in rare cases. That's been fixed.The
isAnyOf/isAllOfmatcher function TS types have been tweaked to not require an individual first parameter. This allows spreading arrays of matchers as arguments, likeconst isLoading = isAnyOf(...interestingPendingThunksArray).Other Changes
The
serializableMiddlewarenow uses aWeakSetif available to cache values it's seen. This should significantly speed up checks against large state values in development builds.What's Changed
ThunkWithReturnValueinterface by @giomogna in #3108raceWithSignalmethod instead ofPromise.raceby @phryneas in #3021Full Changelog: reduxjs/redux-toolkit@v1.9.1...v1.9.2
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ 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.