[Snyk] Upgrade @reduxjs/toolkit from 1.8.2 to 1.9.0 #89
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 was automatically created by Snyk using the credentials of a real user.
Snyk has created this PR to upgrade @reduxjs/toolkit from 1.8.2 to 1.9.0.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
Release notes
Package name: @reduxjs/toolkit
Read more
This release candidate updates the auto-batching enhancer to accept additional options for queuing subscriber notifications, and improves RTKQ perf by removing some unnecessary internal memoized selectors.
Please try this out and give us feedback (even if it's just "tried updating and everything's fine")! If no further issues come up we intend to publish 1.9 in the next few days.
Changelog
Autobatch Enhancer Options
The initial implementation of the
autoBatchEnhancer()
always queued delayed subscriber notifications usingqueueMicrotask
. We've updated it to accept alternate options that queue withsetTimeout
,requestAnimationFrame
, or bring-your-own-callback (more similar toredux-batched-subscribe
).The variation in JS event loop timing behavior (microtasks, macrotasks, and frames) means having these options may be useful in different situations.
What's Changed
Full Changelog: v1.9.0-rc.0...v1.9.0-rc.1
This release candidate includes a new "auto-batching" store enhancer, support for passing some global options to
fetchBaseQuery
, a fix forforceRefetch
behavior, and internal tweaks to checks for missing RTKQ middleware setup.Please try this out and give us feedback (even if it's just "tried updating and everything's fine")! If no further issues come up we intend to publish 1.9 in the next few days.
Changelog
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 the end of the event loop tick. 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 is dispatched in the same tick, the enhancer will notify subscribers immediately.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.
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 it to your store setup:
Additionally, there's a
prepareAutoBatched
util that can be used to help add theSHOULD_AUTOBATCH
flag to actions, designed for use withcreateSlice
:fetchBaseQuery
Global OptionsfetchBaseQuery
now supports passing theresponseHandler
,validateStatus
, andtimeout
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.Other Changes
Providing
serializeQueryArgs
andforceRefetch
options for an endpoint now works correctly when you pass an object as the cache key argument to a query hook.The
defaultSerializeQueryArgs
util is now exported.The endpoint-specific
serializeQueryArgs
option now allows returning an object or a number instead of just a string. If a string is returned, it will be used as-is for the serialized cache key. If an object or number is returned, that value will be passed todefaultSerializeQueryArgs
. This simplifies the common case of wanting to remove a couple fields from the cache key, without needing to calldefaultSerializeQueryArgs
yourself.Internal tweaks to the RTKQ middleware behavior for detecting cases where the middleware has not been added to the store.
The API docs for the 1.9 preview are fully updated.
What's Changed
responseHandler
andvalidateStatus
configuration by @ phryneas in #2823Full Changelog: v1.9.0-beta.0...v1.9.0-rc.0
Read more
Read more
Read more
Read more
This bugfix release fixes a couple of issues with RTKQ endpoint tags not invalidating correctly, and tweaks the
dispatch
type inference to handle more variations of arrays.What's Changed
dispatch
type inference to correctly handle read-only middleware arrays by @ dokmic in #2629Full Changelog: v1.8.5...v1.8.6
Commit messages
Package name: @reduxjs/toolkit
Compare
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs