Skip to content

chore(deps): update dependency @reduxjs/toolkit to v2.9.1#397

Merged
ryanbas21 merged 4 commits into
mainfrom
renovate/reduxjs-toolkit-2.x-lockfile
Oct 22, 2025
Merged

chore(deps): update dependency @reduxjs/toolkit to v2.9.1#397
ryanbas21 merged 4 commits into
mainfrom
renovate/reduxjs-toolkit-2.x-lockfile

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Sep 3, 2025

This PR contains the following updates:

Package Change Age Confidence
@reduxjs/toolkit (source) 2.8.2 -> 2.9.1 age confidence

Release Notes

reduxjs/redux-toolkit (@​reduxjs/toolkit)

v2.9.1

Compare Source

This bugfix release fixes how sorted entity adapters handle duplicate IDs, tweaks the TS types for RTKQ query state cache entries to improve how the data field is handled, and adds better cleanup for long-running listener middleware effects.

What's Changed

  • fix(entityAdapter): ensure sorted addMany keeps first occurrence of duplicate ids by @​demyanm in #​5097
  • fix(entityAdapter): ensure sorted setMany keeps just unique IDs in state.ids by @​demyanm in #​5107
  • fix(types): ensure non-undefined data on isSuccess with exactOptionalPropertyTypes by @​CO0Ki3 in #​5088
  • Allow executing effects that have become unsubscribed to be canceled by listenerMiddleware.clearListeners by @​chris-chambers in #​5102

Full Changelog: reduxjs/redux-toolkit@v2.9.0...v2.9.1

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 automatic AbortSignal handling to requests still in progress when a cache entry is removed, fixes a bug with the transformResponse option for queries, adds a new builder.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 Records to hold subscription data was inefficient because we have to iterate keys to check size. We've rewritten the subscription handling internals to use Maps 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 calling serializeQueryArgs on its value, which can avoid potential perf issues when a query takes a very large object as its cache key.

[!NOTE]
The internal logic switched from serializing the query arg to doing reference checks on nested values. This means that if you are passing a non-POJO value in a query arg, such as useSomeQuery({a: new Set()}), and you have refetchOnMountOrArgChange enabled, this will now trigger refeteches each time as the Set references are now considered different based on equality instead of serialization.

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 the AbortSignal attached to the baseQuery. The handling at that point depends on your app - fetchBaseQuery should handle that, a custom baseQuery or queryFn would need to listen to the AbortSignal.

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 and createSlice.extraReducers now has builder.addAsyncThunk available, which allows handling specific actions from a thunk in the same way that you could define a thunk inside createSlice.reducers:

        const slice = createSlice({
          name: 'counter',
          initialState: {
            loading: false,
            errored: false,
            value: 0,
          },
          reducers: {},
          extraReducers: (builder) =>
            builder.addAsyncThunk(asyncThunk, {
              pending(state) {
                state.loading = true
              },
              fulfilled(state, action) {
                state.value = action.payload
              },
              rejected(state) {
                state.errored = true
              },
              settled(state) {
                state.loading = false
              },
            }),
        })

createApi and individual endpoint definitions now accept a skipSchemaValidation option with an array of schema types to skip, or true 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 using upsertQueryData(), 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 of extractRehydrationInfo - we've updated that to handle the changed structure.

The infinite query status fields like hasNextPage are now a looser type of boolean initially, rather than strictly false.

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

Full 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 becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the dependencies label Sep 3, 2025
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Sep 3, 2025

⚠️ No Changeset found

Latest commit: 7b750f7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Sep 3, 2025

View your CI Pipeline Execution ↗ for commit 7b750f7

Command Status Duration Result
nx run-many -t build ✅ Succeeded <1s View ↗
nx affected -t build typecheck lint test e2e-ci ✅ Succeeded 1m 55s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-22 14:04:53 UTC

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.75%. Comparing base (a5c497f) to head (7b750f7).
⚠️ Report is 4 commits behind head on main.

❌ Your project status has failed because the head coverage (18.75%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff            @@
##           main     #397       +/-   ##
=========================================
+ Coverage      0   18.75%   +18.75%     
=========================================
  Files         0      138      +138     
  Lines         0    27368    +27368     
  Branches      0      951      +951     
=========================================
+ Hits          0     5132     +5132     
- Misses        0    22236    +22236     

see 138 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 3, 2025

Deployed 243c03d to https://ForgeRock.github.io/ping-javascript-sdk/pr-397/243c03dbf6503eae65b742a937735acf7a2a4887 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 3, 2025

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔻 @forgerock/journey-client - 0.0 KB (-82.0 KB, -100.0%)

📊 Minor Changes

📈 @forgerock/journey-client - 82.0 KB (+0.0 KB)

➖ No Changes

@forgerock/device-client - 9.2 KB
@forgerock/oidc-client - 23.0 KB
@forgerock/protect - 150.1 KB
@forgerock/sdk-utilities - 7.5 KB
@forgerock/sdk-types - 8.0 KB
@forgerock/storage - 1.4 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/iframe-manager - 2.4 KB
@forgerock/sdk-request-middleware - 4.4 KB
@forgerock/sdk-oidc - 2.5 KB
@forgerock/davinci-client - 34.5 KB


13 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

@renovate renovate Bot force-pushed the renovate/reduxjs-toolkit-2.x-lockfile branch 2 times, most recently from 3adf9c8 to db6c5b8 Compare September 4, 2025 15:44
@renovate renovate Bot force-pushed the renovate/reduxjs-toolkit-2.x-lockfile branch from db6c5b8 to 4178501 Compare September 10, 2025 19:08
nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot force-pushed the renovate/reduxjs-toolkit-2.x-lockfile branch from 4178501 to c00f15b Compare September 11, 2025 23:54
@renovate renovate Bot force-pushed the renovate/reduxjs-toolkit-2.x-lockfile branch from c00f15b to ce3103a Compare September 25, 2025 15:04
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Sep 25, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@renovate renovate Bot force-pushed the renovate/reduxjs-toolkit-2.x-lockfile branch 2 times, most recently from 31a31a7 to c0f0948 Compare September 29, 2025 23:29
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot force-pushed the renovate/reduxjs-toolkit-2.x-lockfile branch from c0f0948 to 3998ef2 Compare September 30, 2025 15:17
nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot force-pushed the renovate/reduxjs-toolkit-2.x-lockfile branch from 3998ef2 to b92894b Compare September 30, 2025 20:18
nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot force-pushed the renovate/reduxjs-toolkit-2.x-lockfile branch from b92894b to df78746 Compare October 2, 2025 19:06
nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot changed the title chore(deps): update dependency @reduxjs/toolkit to v2.9.0 chore(deps): update dependency @reduxjs/toolkit to v2.9.1 Oct 17, 2025
@renovate renovate Bot force-pushed the renovate/reduxjs-toolkit-2.x-lockfile branch from df78746 to 3e08718 Compare October 17, 2025 06:34
nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot force-pushed the renovate/reduxjs-toolkit-2.x-lockfile branch from 3e08718 to 6d8a539 Compare October 20, 2025 15:32
nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot force-pushed the renovate/reduxjs-toolkit-2.x-lockfile branch from 6d8a539 to ad7f3bb Compare October 20, 2025 15:49
nx-cloud[bot]

This comment was marked as outdated.

@renovate renovate Bot force-pushed the renovate/reduxjs-toolkit-2.x-lockfile branch from ad7f3bb to fb01521 Compare October 21, 2025 22:30
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Oct 21, 2025

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/davinci-client@397

@forgerock/oidc-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/oidc-client@397

@forgerock/protect

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/protect@397

@forgerock/sdk-types

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-types@397

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-utilities@397

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/iframe-manager@397

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-logger@397

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-oidc@397

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-request-middleware@397

@forgerock/storage

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/storage@397

commit: 7b750f7

@renovate renovate Bot force-pushed the renovate/reduxjs-toolkit-2.x-lockfile branch from fb01521 to b06b110 Compare October 22, 2025 13:28
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nx Cloud has identified a possible root cause for your failed CI:

The PR changes involve upgrading @reduxjs/toolkit from version 2.8.2 to 2.9.1 across the workspace and adding immer to the catalog. The failing lint task for @forgerock/oidc-client reports that "@reduxjs/toolkit" is not used by the project according to the @nx/dependency-checks rule.

However, investigation reveals this is a false positive:

  • The package is declared as a dependency in packages/oidc-client/package.json:37
  • Grep search confirms @reduxjs/toolkit is actually imported in 5 source files within the oidc-client package

The failure classification is 'code_change' because the issue was introduced by the dependency version update in the PR. The @nx/dependency-checks rule may have issues detecting usage after the version bump, or the package might actually be available transitively.

Two potential fixes exist:

  1. Remove the direct dependency declaration since @reduxjs/toolkit appears to be available through workspace dependencies that already depend on it
  2. Update the eslint configuration for oidc-client to downgrade this check from 'error' to 'warn' (similar to what was done for sdk-request-middleware in this PR)

The first approach is preferred as it reduces dependency duplication, but the second approach would maintain the explicit dependency declaration if that's architecturally required.

A code change would likely not resolve this issue, so no action was taken.

Nx CloudView in Nx Cloud ↗


🎓 To learn more about Self Healing CI, please visit nx.dev

@renovate
Copy link
Copy Markdown
Contributor Author

renovate Bot commented Oct 22, 2025

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@ryanbas21 ryanbas21 merged commit 073a686 into main Oct 22, 2025
6 checks passed
@ryanbas21 ryanbas21 deleted the renovate/reduxjs-toolkit-2.x-lockfile branch October 22, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants