reduxjs/redux-toolkit v2.11.1 → v2.11.2

This release is a small bugfix update for RTK Query and the surrounding types. It also pulls in a few user-visible improvements around infinite queries, codegen, and state checks.

What's new

  • TypedUseInfiniteQueryHookResult now includes fetchNextPage and fetchPreviousPage, so the helper type matches the infinite query hook result more completely. (#5165)
  • refetchCachedPages adds a way to keep infinite query caches from refetching every cached page on refetch. It defaults to the existing behavior, and you can set it to false in infiniteQueryOptions when you want to opt out. (#5016)
  • RTK Query codegen now supports explicit providesTags and invalidatesTags overrides without changing the inferred defaults, and it avoids emitting empty tag arrays when tag generation is disabled. (#5135)
  • Codegen can also output regex patterns for generated schemas, which extends support for OpenAPI setups that rely on pattern-based schema matching. (#5146)
  • immutableCheck now compares paths against RegExp instances in ignoredPaths, which makes dynamic ignore rules work as expected. (#5124)

Breaking changes

  • Immer support in the typecheck matrix now drops TypeScript versions below 5.4. If you are still on an older TS release, you will need to upgrade to a supported version. (#5155)

Fixes

  • AbortSignal handling now falls back to a plain Error when DOMException is not available, which avoids crashes in environments like React Native. (#5161)
  • combineSlices now infers PreloadedState correctly for provided slices whose reducers can receive a different state shape than they return, such as reducers wrapped with persistReducer. (#5125)
  • The SSR window access regression from the earlier setupListeners byte-shaving work has been reverted. (#5132)

Other notable changes

  • Immer was updated, and RTK now opts out of strictIteration for reducer updates. That change is intended to improve iteration behavior in normal Redux usage. (#5127, #5141)
  • The release and publishing workflows were hardened for trusted publishing, including pinned GitHub Actions and NPM tag support. (#5152)
  • TypeScript support is now officially documented, and the typecheck matrix was updated to include a native TS preview job. (#5158, #5155)
  • Several internal bundle-size and perf-oriented cleanups landed, including import deduplication, setupListeners deduping, and faster tag invalidation/update paths. (#5128, #5129, #5126)

Contributors

@EskiMojo14
@markerikson
@johnste
@CO0Ki3_
@w3di
@rossmartin
@RhysOnlyBetter