npm @reduxjs/toolkit 2.12.0
v2.12.0

6 hours ago

This feature release adds RTK usage skills files (via TanStack Intent) exports the RTK Query hook options types for reusability, fixes issues with infinite query status flags and batching handling, and makes some small TS improvements.

Changelog

Skills Files

We've generated agent skill files that are now included in the RTK package itself in a skills folder. They cover using and migrating to modern RTK, client and server state management, and handling side effects. You can point your agent at these skills yourself, or use TanStack Intent to pick them up.

TypeScript Improvements

The types for our RTK Query hook options are now exported, which lets you stop using Parameters to extract those types for use in your own code.

The types for listener middleware matchers were tweaked to allow interface-based type guards, not just type-based definitions.

The internal IgnorePaths type was renamed to IgnoredPaths for consistency.

We now use the built-in NoInfer util that comes with TS 5.4+.

Fixes

We fixed handling of the isSuccess status flag when switching infinite query cache entries. This should prevent accidental UI flashes that were occurring due to this flag accidentally flipping.

We've added a 100ms timeout fallback to the autoBatch enhancer's requestAnimationFrame timer. We had several reports that rAF didn't work correctly when used in background tabs / opened windows, and that RTK never updated the UI. This should ensure that the updates flush correctly.

What's Changed

  • Export hook options types for RTK Query hooks by @veeceey in #5218
  • Add TanStack Intent skills for Redux Toolkit by @phryneas in #5249
  • Keep isSuccess: true when switching infinite query cache entries by @riqts in #5268
  • fix: allow interface-based type guards as listener matcher by @riqts in #5269
  • fix: add setTimeout fallback to raf autoBatch strategy for background tabs by @riqts in #5273
  • chore(toolkit): rename IgnorePaths type to IgnoredPaths by @Ri5ha6h in #5284
  • feat(toolkit)!: switch to native NoInfer utility type by @aryaemami59 in #5289

Full Changelog: v2.11.2...v2.12.0

Don't miss a new toolkit release

NewReleases is sending notifications on new releases.