generated from kobakazu0429/react-webpack-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix(deps): update all minor dependencies #20
Open
renovate
wants to merge
1
commit into
feature/dev
Choose a base branch
from
renovate/all-minor-dependencies
base: feature/dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
March 26, 2022 12:09
7b131bd
to
634ebf9
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
2 times, most recently
from
April 14, 2022 11:23
598f2b6
to
a032d42
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
3 times, most recently
from
April 26, 2022 22:49
b07290a
to
a86e1dc
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
3 times, most recently
from
May 12, 2022 23:38
fd295e2
to
aba9a4a
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
2 times, most recently
from
June 7, 2022 19:47
f1bab83
to
2014285
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
2 times, most recently
from
June 16, 2022 22:45
87c1090
to
ea690cb
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
September 25, 2022 22:16
ea690cb
to
5fbac9b
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
November 20, 2022 09:24
5fbac9b
to
37604a7
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
March 16, 2023 06:34
37604a7
to
55ee782
Compare
renovate
bot
changed the title
chore(deps): update all minor dependencies
fix(deps): update all minor dependencies
Mar 16, 2023
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
April 3, 2023 10:40
55ee782
to
35836dd
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
2 times, most recently
from
April 18, 2023 05:24
8b15234
to
2480a73
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
May 28, 2023 09:14
2480a73
to
16b4ba6
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
June 4, 2023 10:21
16b4ba6
to
99641a8
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
3 times, most recently
from
June 19, 2023 13:07
a34e4e0
to
d99ea2b
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
June 29, 2023 10:19
d99ea2b
to
0f01d48
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
2 times, most recently
from
July 9, 2023 09:50
5829bcf
to
e5a7fbe
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
July 16, 2023 13:37
e5a7fbe
to
407c302
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
3 times, most recently
from
September 26, 2023 12:53
0845042
to
7cbfa6c
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
2 times, most recently
from
October 5, 2023 01:08
14faa72
to
b6c7ab3
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
2 times, most recently
from
October 15, 2023 16:01
1dc855d
to
98bd2cf
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
October 23, 2023 13:28
98bd2cf
to
ea444a5
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
November 6, 2023 08:02
ea444a5
to
cec2b49
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
November 16, 2023 11:49
cec2b49
to
f3111af
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
December 3, 2023 13:00
f3111af
to
25d3e9f
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
2 times, most recently
from
February 4, 2024 10:18
f489ad4
to
634134c
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
February 25, 2024 09:58
634134c
to
5292ef6
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
March 12, 2024 10:12
5292ef6
to
bca7f48
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
2 times, most recently
from
March 24, 2024 15:52
3116899
to
b0f8ed3
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
April 14, 2024 09:59
b0f8ed3
to
770e589
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
2 times, most recently
from
April 25, 2024 10:22
2e45832
to
25df97a
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
June 4, 2024 11:01
25df97a
to
decda0c
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
June 30, 2024 12:19
decda0c
to
ea3184e
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
July 21, 2024 12:32
ea3184e
to
bcc8ece
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
August 6, 2024 10:36
bcc8ece
to
8c5d6e2
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
August 15, 2024 10:11
8c5d6e2
to
50c1dfc
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
3 times, most recently
from
September 3, 2024 16:41
e9fad9d
to
bcde657
Compare
renovate
bot
force-pushed
the
renovate/all-minor-dependencies
branch
from
October 9, 2024 11:52
bcde657
to
da78b3b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.2.3
->1.9.7
12.12.25
->12.20.55
5.1.3
->5.3.3
3.4.2
->3.6.0
5.0.2
->5.1.0
4.0.1
->4.1.6
7.1.3
->7.2.9
1.1.3
->1.3.0
5.0.0
->5.3.11
2.1.0
->2.3.0
3.7.5
->3.9.10
4.41.5
->4.47.0
3.10.1
->3.11.3
Release Notes
reduxjs/redux-toolkit (@reduxjs/toolkit)
v1.9.7
Compare 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.6
Compare 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
updateQueryData
is 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 optionalautoJoin
flag that can be used to keep the effect from finishing until all active forked tasks have completed.updateQueryData
now has anupdateProvidedTags
option that will force a recalculation of that endpoint's provided tags. It currently defaults tofalse
, and we'll likely turn that totrue
in the next major.Other Fixes
The
builder.addCase
method now throws an error if atype
string is empty.fetchBaseQuery
now uses an alternate method to clone the originalRequest
in 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.5
Compare Source
This bugfix release includes notable improvements to TS type inference when using the
enhancers
option 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.4
Compare 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
transformResponse
as part ofenhanceEndpoints
can now override the TS type of the original data.fetchBaseQuery
now properly checks for a globalresponseHandler
option.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
subscriptionUpdated
action 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
arethetypeswrong
automated CLI check by @markerikson in https://github.com/reduxjs/redux-toolkit/pull/3294attw
CLI option to treat problems as non-errors by @markerikson in https://github.com/reduxjs/redux-toolkit/pull/3316responseHandler
being used infetchBaseQuery
by @praxxis in https://github.com/reduxjs/redux-toolkit/pull/3137resetApiState
by @phryneas in https://github.com/reduxjs/redux-toolkit/pull/3333subscriptionUpdated
as autobatched by @markerikson in https://github.com/reduxjs/redux-toolkit/pull/3364Full Changelog: reduxjs/redux-toolkit@v1.9.3...v1.9.4
v1.9.3
Compare Source
This release fixes a couple issues with the
skip/skipToken
options 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}
orskipToken
for a query with existing results will keep thedata
value (reflecting the last successful query), butcurrentData
will 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.2
Compare Source
This bugfix release fixes a memory leak in
createListenerMiddleware
, optimizes performance insideserializableMiddleware
, adds new options forfetchBaseQuery
, adds support for pathRegExp
exclusions inserializableMiddleware
andimmutabilityMiddleware
, and improves some TS types.Changelog
Bug Fixes
createListenerMiddleware
had a memory leak that turned out to be due to use ofPromise.race()
. We've restructured the logic to fix that.fetchBaseQuery
now correctly combines global options with endpoint / default options in all cases.New Options
fetchBaseQuery
now supports ajsonReplacer
option that will be used when processing JSON.Both dev check middleware now support regular expressions in the
ignoredPaths
array in addition to strings. This adds extra flexibility in skipping certain fields.TS Changes
The
CaseReducer
type was sometimes incorrectly inferring its return type in rare cases. That's been fixed.The
isAnyOf/isAllOf
matcher 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
serializableMiddleware
now uses aWeakSet
if available to cache values it's seen. This should significantly speed up checks against large state values in development builds.What's Changed
ThunkWithReturnValue
interface by @giomogna in https://github.com/reduxjs/redux-toolkit/pull/3108raceWithSignal
method instead ofPromise.race
by @phryneas in https://github.com/reduxjs/redux-toolkit/pull/3021Full Changelog: reduxjs/redux-toolkit@v1.9.1...v1.9.2
v1.9.1
Compare Source
This bugfix release fixes assorted issues that were reported with RTK 1.9.0, and adds a few additional requested tweaks and improvements.
Changelog
Fixes
The
createAsyncThunk.withTypes
function was fully broken (it type-checked correctly, but pointed to the wrong function due to a name shadowing issue). That now works correctly.The
maxRetries
option for RTKQ was inadvertently filtering out0
values, and those are now accepted.fulfillWithValue
had incorrect types that made it appear as if the data was nested an additional level deeper. The types are now correct.The
ActionCreatorWithoutPayload
type was tweaked to force an error when an action creator is accidentally called with an argument, which happens in cases likeonClick={todoAdded}
. This avoids accidentally passing values like React event objects as the payload.Timer handling for
batchActions
andautoBatchEnhancer
now works in more JS runtime environments.Other Changes
The
TagDescription
type is now exported from RTKQ.API endpoints now have a
.name
field containing the endpoint name, such as"getPokemon"
.Calling
promise.abort()
on acreateAsyncThunk
promise before an asynccondition
resolves will now be treated as if thecondition
itself returnedfalse
, bailing out and not dispatching anything.The
merge
option now receives a third argument containing{arg, baseQueryMeta, fulfilledTimeStamp, requestId}
, in case that info is useful in deciding how to merge.The
@reduxjs/rtk-codemods
package has been updated to fix cases where thecreateSliceBuilder
codemod didn't preserve fields with function variable arguments, like[todoAdded]: adapter.addOne
. That package has been updated to v0.0.3.What's Changed
Full Changelog: reduxjs/redux-toolkit@v1.9.0...v1.9.1
v1.9.0
Compare Source
This feature release adds several new options for RTK Query's
createApi
andfetchBaseQuery
APIs, adds a newupsertQueryData
util, rewrites RTKQ's internals for improved performance, adds a newautoBatchEnhancer
, deprecates the "object" syntax forcreateReducer
andcreateSlice.extraReducers
, deprecates and removes broken utils for getting running query promises, improves TS inference, exports additional types, and fixes a number of reported issues.We plan to start work on RTK 2.0 in the next few weeks. RTK 2.0 will focus on dropping legacy build compatibility and deprecated APIs, with some potential new features. See the linked discussion thread and give us feedback on ideas!
Deprecations and Removals
Object Argument for
createReducer
andcreateSlice.extraReducers
RTK's
createReducer
API was originally designed to accept a lookup table of action type strings to case reducers, like{ "ADD_TODO" : (state, action) => {} }
. We later added the "builder callback" form to allow more flexibility in adding "matchers" and a default handler, and did the same forcreateSlice.extraReducers
.We intend to remove the "object" form for both
createReducer
andcreateSlice.extraReducers
in RTK 2.0. The builder callback form is effectively the same number of lines of code, and works much better with TypeScript.Starting with this release, RTK will print a one-time runtime warning for both
createReducer
andcreateSlice.extraReducers
if you pass in an object argument.As an example, this:
should be migrated to:
Codemods for Deprecated Object Reducer Syntax
To simplify upgrading codebases, we've published a set of codemods that will automatically transform the deprecated "object" syntax into the equivalent "builder" syntax.
The codemods package is available on NPM as
@reduxjs/rtk-codemods
. It currently contains two codemods:createReducerBuilder
andcreateSliceBuilder
.To run the codemods against your codebase, run
npx @​reduxjs/rtk-codemods <TRANSFORM NAME> path/of/files/ or/some**/*glob.js
.Examples:
We also recommend re-running Prettier on the codebase before committing the changes.
These codemods should work, but we would greatly appreciate testing and feedback on more real-world codebases!
Object reducer codemod before/after examples
Before:After:
getRunningOperationPromises
Deprecation and ReplacementIn
v1.7.0
, we added anapi.util.getRunningOperationPromises()
method for use with SSR scenarios, as well as a singulargetRunningOperationPromise()
method intended for possible use with React Suspense.Unfortunately, in #2477 we realized that both those methods have a fatal flaw - they do not work with multiple stores in SSR.
As of this release, we are immediately marking
getRunningOperationPromises()
as deprecated and discouraging its use before we remove it completely in RTK 2.0! It will now throw both runtime and compile errors in development to enforce moving away from using it. However, we are leaving its existing behavior in production builds to avoid actual breakage.The
getRunningOperationPromise()
util was experimental, and as far as we can tell not actually being used by anyone, so we are removinggetRunningOperationPromise
completely in this release.As replacements, RTKQ now includes four new thunks attached to
api.util
:getRunningQueryThunk(endpointName, queryArgs)
getRunningMutationThunk(endpointName, fixedCacheKeyOrRequestId)
getRunningQueriesThunk()
getRunningMutationsThunk()
Usages would typically change like this:
Changelog
New RTK Query
createApi
OptionscreateApi
endpoints now have several additional options that can be passed in, some of which are intended to work together.merge
OptionRTKQ was built around the assumption that the server is the source of truth, and every refetch replaces the cached data on the client. There are use cases when it would be useful to merge an incoming response into the existing cached data instead, such as pagination or APIs that return varying results over time.
Query endpoints can now accept a
merge(cachedData, responseData)
callback that lets you do Immer-powered "mutations" to update the existing cached data instead of replacing it entirely.Since RTKQ assumes that each response per key should replace the existing cache entry by default, the
merge
option is expected to be used with theserializeQueryArgs
andforceRefetch
options, as described below.serializeQueryArgs
OptionRTK Query always serializes the cache key value, and uses the string as the actual key for storing the cache entry. The default serialization is the name of the endpoint, plus either the primitive value or a stable-serialized object. An example might be
state.api.queries['getPokemon("pikachu")']
.RTKQ already supported customization of this serialization behavior at the
createApi
level. Now, each endpoint can specify its ownserializeQueryArgs
method.The per-endpoint
serializeQueryArgs
may return either a string, an object, a number, or a boolean. If it's a string, that value will be used as-is. Otherwise, the return value will be run through the default serialization logic. This simplifies the common case of stripping out a couple unwanted object fields from the cache key.This option serves two main purposes: leaving out values that are passed in to an endpoint but not really part of the "key" conceptually (like a socket or client instance), and altering cache key behavior to use a single entry for the endpoint (such as in an infinite loading / pagination scenario).
Also, the
defaultSerializeQueryArgs
util is now exported.forceRefresh
optionSometimes you may want to force a refetch, even though RTKQ thinks that the serialized query args haven't changed and there's already a fulfilled cache entry.
This can be used to force RTKQ to actually refetch. One expected use case is an "infinite pagination" scenario where there is one cache entry for the endpoint, different page numbers are given as query args, and the incoming responses are merged into the existing cache entry:
transformErrorResponse
OptionSimilar to
transformResponse
, endpoints can now specify atransformErrorResponse
option as well.upsertQueryData
UtilRTKQ already has an
updateQueryData
util to synchronously modify the contents of an existing cache entry, but there was no way to create a new cache entry and its metadata programmatically.This release adds a new
api.util.upsertQueryData
API that allows creating a cache entry + its data programmatically. As with the other util methods, this is a thunk that should be dispatched, and you should pass in the exact cache key arg and complete data value you want to insert:The dispatch acts like all other RTKQ requests, so the process is async, and the thunk returns a promise that resolves when the upsert is complete.
RTK Query Performance Improvements
We've significantly rewritten RTK Query's internal implementation to improve performance, especially in cases where many components with query hooks mount at the same time. The middleware has been "flattened" and runs fewer internal checks against each action, subscription updates are grouped together, and some unnecessary memoized selectors have been removed. One consequence is that forgetting to add the RTKQ middleware now throws an error instead of logging a warning.
Overall, RTK Query processing time should be noticeably faster than it was in 1.8.
RTK Query also can take advantage of the new "auto-batch enhancer" (described below) for some additional perf optimization, and we recommend adding that to your Redux store configuration.
fetchBaseQuery
OptionsfetchBaseQuery
has several new options for processing requests:You can now specify a
timeout
option for both individual endpoints andfetchBaseQuery
. If provided, requests that take longer than this value will automatically abort.fetchBaseQuery
now supports passing theresponseHandler
andvalidateStatus
options directly tofetchBaseQuery
itself, in addition to accepting it as part of specific endpoints. If provided, these options will be applied as defaults to all requests for that API, which simplifies using them on many endpoints. Providing them for endpoints overrides the global option.You can now specify a
jsonContentType
string that will be used to set thecontent-type
header for a request with a jsonifiable body that does not have an explicitcontent-type
header. Defaults to"application/json"
.You can now specify a
isJsonContentType
callback that checks to see if the request body or response body should be stringified. The default looks for values like"application/json"
and"application/vnd.api+json"
. You can also now specifyresponseHandler: 'content-type'
to have RTKQ automatically check to see whether a response should be treated as text or JSON.The
prepareHeaders
method can now return void and does not have toreturn headers
.Other RTK Query Changes
The
refetch()
methods now return a promise that can be awaited.Query endpoints can now accept a
retryCondition
callback as an alternative tomaxRetries
. If you provideretryCondition
, it will be called to determine if RTKQ should retry a failed request again.New Auto-Batching Store Enhancer
There are several different ways to "batch actions" with Redux stores, ranging from reducers to debounced subscriber notifications.
RTK now includes a new
autoBatchEnhancer()
store enhancer that uses a variation on the "debounced notification" approach, inspired by React's technique of batching renders and determining if an update is low-priority or high-priority.The enhancer looks for any actions tagged with an
action.meta[SHOULD_AUTOBATCH] = true
flag, and delays notifying subscribers until a queued callback runs. This means that if multiple "auto-batched" actions are dispatched in a row, there will be only one subscriber notification. However, if any "normal-priority" action without that flag are dispatched before the queued callback runs, the enhancer will notify subscribers immediately instead and ignore the callback.This allows Redux users to selectively tag certain actions for effective batching behavior, making this purely opt-in on a per-action basis, while retaining normal notification behavior for all other actions.
The enhancer defaults to using
requestAnimationFrame
, but can also be configured to usequeueMicrotask
to run at the end of an event loop tick,setTimeout
, or a user-provided callback.RTK Query's internals have been updated to mark several key actions as batchable. While the enhancer is purely opt-in, benchmarks indicate that it can help speed up UI performance with RTK Query, especially when rendering many components with query hooks. We recommend adding this enhancer to your store setup if you're using RTK Query:
Additionally, there's a
prepareAutoBatched
util that can be used to help add theSHOULD_AUTOBATCH
flag to actions, designed for use withcreateSlice
:TypeScript Improvements
RTK 1.9 now requires TS 4.2 or greater, and supports through TS 4.9.
The action type strings generated by
createAction
are now full TS template literals when possible.There's now a
createAsyncThunk.withTypes()
method that creates a "pre-typed" version ofcreateAsyncThunk
with types like{state, dispatch, extra}
baked in. This can be used to simplify customizingcreateAsyncThunk
with the right types once during app setup.RTK Query now exports TS types for "pre-typed hook results", for cases when you want to wrap the query/mutation hooks in your own code. Additionally, RTKQ also exports
BaseQueryApi
and exposes TS-only types for endpoint definitions.configureStore
now correctly infers changes to the store shape from any store enhancers, such as adding actual extra fields tostore
.RTK now exports additional types from
redux-thunk
.Bug Fixes
Manually initiated RTKQ promises should resolve correctly.
Previous API tags are removed before adding new ones, instead of accidentally merging them together.
invalidateTags
works correctly when dealing with persisted query state.What's Changed
isJsonContentType
predicate tofetchBaseQuery
by @msutkowski in https://github.com/reduxjs/redux-toolkit/pull/2331jsonContentType
tofetchBaseQuery
options by @msutkowski in https://github.com/reduxjs/redux-toolkit/pull/2403StoreEnhancers
by @fostyfost in https://github.com/reduxjs/redux-toolkit/pull/2550refetch
by @phryneas in https://github.com/reduxjs/redux-toolkit/pull/2212upsertQueryData
race situations by @phryneas in https://github.com/reduxjs/redux-toolkit/pull/2646error
. by @phryneas in https://github.com/reduxjs/redux-toolkit/pull/2743dispatchQueued
variable after flushing by @phryneas in https://github.com/reduxjs/redux-toolkit/pull/2757forceRefetch
toQueryExtraOptions
by @schadenn in https://github.com/reduxjs/redux-toolkit/pull/2663prepareHeaders
does not need to returnheaders
any more by @phryneas in https://github.com/reduxjs/redux-toolkit/pull/2775codemods-cli
and rewrite "object reducer" codemods by @markerikson in https://github.com/reduxjs/redux-toolkit/pull/2768skipToken
behaviour inuseQueryState
by @phryneas in https://github.com/reduxjs/redux-toolkit/pull/2779fetchBaseQuery
: allowheaders
option by @phryneas in https://github.com/reduxjs/redux-toolkit/pull/2778getRunningOperationPromise(s)
withgetRunning(Query|Queries|Mutation|Mutations)Thunk
by @phryneas in https://github.com/reduxjs/redux-toolkit/pull/2481responseHandler
andvalidateStatus
configuration by @phryneas in https://github.com/reduxjs/redux-toolkit/pull/2823Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.