-
Notifications
You must be signed in to change notification settings - Fork 3
chore(deps): update dependency @reduxjs/toolkit to v2.9.0 #397
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
base: main
Are you sure you want to change the base?
Conversation
|
View your CI Pipeline Execution ↗ for commit df78746
☁️ Nx Cloud last updated this comment at |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #397 +/- ##
=======================================
Coverage 56.19% 56.19%
=======================================
Files 32 32
Lines 2091 2091
Branches 353 353
=======================================
Hits 1175 1175
Misses 916 916 🚀 New features to boost your workflow:
|
Deployed d63e5bb to https://ForgeRock.github.io/ping-javascript-sdk/pr-397/d63e5bb46fa74657fe74f0f3eddec67c4564c748 branch gh-pages in ForgeRock/ping-javascript-sdk |
📦 Bundle Size Analysis📦 Bundle Size Analysis🆕 New Packages🆕 @forgerock/device-client - 9.2 KB (new) 11 packages analyzed • Baseline from latest Legend🆕 New package ℹ️ How bundle sizes are calculated
🔄 Updated automatically on each push to this PR |
3adf9c8
to
db6c5b8
Compare
db6c5b8
to
4178501
Compare
4178501
to
c00f15b
Compare
c00f15b
to
ce3103a
Compare
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
31a31a7
to
c0f0948
Compare
c0f0948
to
3998ef2
Compare
3998ef2
to
b92894b
Compare
b92894b
to
df78746
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nx Cloud is proposing a fix for your failed CI:
We've updated the @reduxjs/toolkit
version in the pnpm workspace catalog from ^2.8.2
to ^2.9.0
to match the lockfile update. This resolves the Nx dependency-checks linting errors that were failing because of the version mismatch between the catalog definition and the installed package version.
We verified this fix by re-running @forgerock/device-client:lint
.
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index b26a216..3fa168b 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -8,7 +8,7 @@ packages:
- 'scratchpad'
catalog:
- '@reduxjs/toolkit': ^2.8.2
+ '@reduxjs/toolkit': ^2.9.0
immer: ^10.1.1
msw: ^2.5.1
⚙️ An Nx Cloud workspace admin can disable these reviews in workspace settings.
This PR contains the following updates:
2.8.2
->2.9.0
Release Notes
reduxjs/redux-toolkit (@reduxjs/toolkit)
v2.9.0
Compare Source
This feature release rewrites RTK Query's internal subscription and polling systems and the
useStableQueryArgs
hook for better perf, adds automaticAbortSignal
handling to requests still in progress when a cache entry is removed, fixes a bug with thetransformResponse
option for queries, adds a newbuilder.addAsyncThunk
method, and fixes assorted other issues.Changelog
RTK Query Performance Improvements
We had reports that RTK Query could get very slow when there were thousands of subscriptions to the same cache entry. After investigation, we found that the internal polling logic was attempting to recalculate the minimum polling time after every new subscription was added. This was highly inefficient, as most subscriptions don't change polling settings, and it required repeated O(n) iteration over the growing list of subscriptions. We've rewritten that logic to debounce the update check and ensure a max of one polling value update per tick for the entire API instance.
Related, while working on the request abort changes, testing showed that use of plain
Record
s to hold subscription data was inefficient because we have to iterate keys to check size. We've rewritten the subscription handling internals to useMap
s instead, as well as restructuring some additional checks around in-flight requests.These two improvements drastically improved runtime perf for the thousands-of-subscriptions-one-cache-entry repro, eliminating RTK methods as visible hotspots in the perf profiles. It likely also improves perf for general usage as well.
We've also changed the implementation of our internal
useStableQueryArgs
hook to avoid callingserializeQueryArgs
on its value, which can avoid potential perf issues when a query takes a very large object as its cache key.Abort Signal Handling on Cleanup
We've had numerous requests over time for various forms of "abort in-progress requests when the data is no longer needed / params change / component unmounts / some expensive request is taking too long". This is a complex topic with multiple potential use cases, and our standard answer has been that we don't want to abort those requests - after all, cache entries default to staying in memory for 1 minute after the last subscription is removed, so RTKQ's cache can still be updated when the request completes. That also means that it doesn't make sense to abort a request "on unmount".
However, it does then make sense to abort an in-progress request if the cache entry itself is removed. Given that, we've updated our cache handling to automatically call the existing
resPromise.abort()
method in that case, triggering theAbortSignal
attached to thebaseQuery
. The handling at that point depends on your app -fetchBaseQuery
should handle that, a custombaseQuery
orqueryFn
would need to listen to theAbortSignal
.We do have an open issue asking for further discussions of potential abort / cancelation use cases and would appreciate further feedback.
New Options
The builder callback used in
createReducer
andcreateSlice.extraReducers
now hasbuilder.addAsyncThunk
available, which allows handling specific actions from a thunk in the same way that you could define a thunk insidecreateSlice.reducers
:createApi
and individual endpoint definitions now accept askipSchemaValidation
option with an array of schema types to skip, ortrue
to skip validation entirely (in case you want to use a schema for its types, but the actual validation is expensive).Bug Fixes
The infinite query implementation accidentally changed the query internals to always run
transformResponse
if provided, including if you were usingupsertQueryData()
, which then broke. It's been fixed to only run on an actual query request.The internal changes to the structure of the
state.api.provided
structure broke our handling ofextractRehydrationInfo
- we've updated that to handle the changed structure.The infinite query status fields like
hasNextPage
are now a looser type ofboolean
initially, rather than strictlyfalse
.TS Types
We now export Immer's
WritableDraft
type to fix another non-portable types issue.We've added an
api.endpoints.myEndpoint.types.RawResultType
types-only field to match the other available fields.What's Changed
transformResponse
when aquery
is used by @markerikson in #5049Full Changelog: reduxjs/redux-toolkit@v2.8.2...v2.9.0
Configuration
📅 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 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.