github reduxjs/redux-toolkit v1.7.0-rc.0

pre-release2 years ago

This release candidate fixes several assorted small issues and updates dependencies.

Assuming no other problems pop up, we plan on releasing 1.7 in the next couple days.

npm i @reduxjs/toolkit@next

yarn add @reduxjs/toolkit@next

Changelog

RTK Query Fixes

Fixed an issue serializing a query arg of undefined. Related, an empty JSON body now is stored as null instead of undefined.

There are now dev warnings for potential mistakes in endpoint setup, like a query function that does not return a data field.

Lazy query trigger promises can now be unwrapped similar to mutations.

api.util.resetApiState will now clear out cached values in useQuery hooks.

The RetryOptions interface is now exported, which resolves a TS build error when using the hooks with TS declarations.

Dependency Updates

Updated to Immer ^9.0.7, Reselect ^4.1.5, and Thunk ^2.4.1 to pick up the latest types and bug fixes.

Also, the peer dependencies now list React 18 beta and React-Redux 8 beta as acceptable versions.

Other Fixes

The isPlainObject util has been updated to match the implementation in other Redux libs.

The UMD builds of RTK Query now attach as window.RTKQ instead of overwriting window.RTK.

Fixed an issue with sourcemap loading due to an incorrect filename replacement.

What's Changed

  • fetchBaseQuery: return nullon empty body for JSON. Add DevWarnings by @phryneas in #1699
  • Add unwrap to QueryActionCreatorResult and update LazyQueryTrigger by @msutkowski in #1701
  • Only set originalArgs if they're not undefined by @phryneas in #1711
  • Treat null as a valid plain object prototype in isPlainObject() in order to sync the util across reduxjs/* repositories by @Ilyklem in #1734
  • export RetryOptions interface from retry.ts by @colemars in #1751
  • fix: api.util.resetApiState should reset useQuery hooks by @phryneas in #1735
  • fix issue where the global RTK object got overwritten in the UMD files by @Antignote in #1763
  • Update dependencies and selector types by @markerikson in #1772
  • Fix broken sourcemap output due to bad filename replacement by @markerikson in #1773

Full Changelog: v1.7.0-beta.1...v1.7.0-rc.0

Don't miss a new redux-toolkit release

NewReleases is sending notifications on new releases.