fix(deps): update dependency @reduxjs/toolkit to v2.2.4 #338

Merged
kjuulh merged 1 commits from renovate/all into main 2024-05-09 05:07:00 +02:00
Owner

This PR contains the following updates:

Package Type Update Change
@reduxjs/toolkit (source) dependencies patch 2.2.3 -> 2.2.4

Release Notes

reduxjs/redux-toolkit

v2.2.4

Compare Source

This bugfix release improves sorting performance in createEntityAdapter, shrinks the code size in matcher utilities, fixes assorted issues with query hooks, and makes several TS tweaks.

Changelog

Entity Adapter Sorting Performance

Users reported in #​4252 that the sorting performance of createEntityAdapter seemed abnormally bad - the provided comparison functions were being called far more times than expected.

Upon investigation, we had a couple of problems. We were always starting from an array that was in insertion order, not the existing sorted order, and that would always require significant effort to re-sort even if there weren't any actual changes to the sorted results. Also, the sorting checks required frequent access to Immer's Proxy-wrapped values, even in cases where all we needed was the plain state values for comparison purposes.

We've reworked the internal sorting logic to always start from the existing sorted array, do reads against a plain value to avoid the Proxy getter overhead where possible, and optimized inserts into existing sorted arrays. This should significantly speed up sorted entity adapter behavior.

Matcher Code Size Optimization

We've reworked the internals of the thunk-related matchers to deduplicate some of the logic, shaving a few bytes off the final bundle size.

RTK Query Hook Updates

defaultSerializeQueryArgs can now handle BigInt values safely.

The isLoading flag logic was improved to handle errors when a query hook tries to subscribe.

TS Updates

create.asyncThunk's types were improved to avoid cases where it might infer any.

We've made several internal types changes to work correctly with React 19's upcoming types.

The retryCondition method now receives unknown as an argument, instead of always assuming the user is using fetchBaseQuery.

Other Changes

The Reselect dep has been bumped to 5.1.0 to match the expected internal usage of createSelector.withTypes().

What's Changed

Full Changelog: https://github.com/reduxjs/redux-toolkit/compare/v2.2.3...v2.2.4


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

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 has been generated by Renovate Bot.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@reduxjs/toolkit](https://redux-toolkit.js.org) ([source](https://github.com/reduxjs/redux-toolkit)) | dependencies | patch | [`2.2.3` -> `2.2.4`](https://renovatebot.com/diffs/npm/@reduxjs%2ftoolkit/2.2.3/2.2.4) | --- ### Release Notes <details> <summary>reduxjs/redux-toolkit</summary> ### [`v2.2.4`](https://github.com/reduxjs/redux-toolkit/releases/tag/v2.2.4) [Compare Source](https://github.com/reduxjs/redux-toolkit/compare/v2.2.3...v2.2.4) This **bugfix release** improves sorting performance in `createEntityAdapter`, shrinks the code size in matcher utilities, fixes assorted issues with query hooks, and makes several TS tweaks. #### Changelog ##### Entity Adapter Sorting Performance Users reported in [#&#8203;4252](https://github.com/reduxjs/redux-toolkit/issues/4252) that the sorting performance of `createEntityAdapter` seemed abnormally bad - the provided comparison functions were being called far more times than expected. Upon investigation, we had a couple of problems. We were always starting from an array that was in insertion order, not the existing sorted order, and that would always require significant effort to re-sort even if there weren't any *actual* changes to the sorted results. Also, the sorting checks required frequent access to Immer's Proxy-wrapped values, even in cases where all we needed was the plain state values for comparison purposes. We've reworked the internal sorting logic to always start from the existing sorted array, do reads against a plain value to avoid the Proxy getter overhead where possible, and optimized inserts into existing sorted arrays. This should significantly speed up sorted entity adapter behavior. ##### Matcher Code Size Optimization We've reworked the internals of the thunk-related matchers to deduplicate some of the logic, shaving a few bytes off the final bundle size. ##### RTK Query Hook Updates `defaultSerializeQueryArgs` can now handle `BigInt` values safely. The `isLoading` flag logic was improved to handle errors when a query hook tries to subscribe. ##### TS Updates `create.asyncThunk`'s types were improved to avoid cases where it might infer `any`. We've made several internal types changes to work correctly with React 19's upcoming types. The `retryCondition` method now receives `unknown` as an argument, instead of always assuming the user is using `fetchBaseQuery`. ##### Other Changes The Reselect dep has been bumped to 5.1.0 to match the expected internal usage of `createSelector.withTypes()`. #### What's Changed - Update remaining `Context` references to match the new nullable `Context` by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4336 - types: export `GetThunkAPI` type by [@&#8203;shrouxm](https://github.com/shrouxm) in https://github.com/reduxjs/redux-toolkit/pull/4289 - Inline the deprecated `React.ReactChild` type by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4382 - Replace usage of deprecated `JSX` global namespace with `React.JSX` by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4381 - Fix `useRef` usages to be called with an explicit argument of `undefined`. by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4380 - Bump `reselect` dependency to 5.1.0 to resolve [#&#8203;4200](https://github.com/reduxjs/redux-toolkit/issues/4200) by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4400 - Improve sorted entity adapter sorting performance by [@&#8203;markerikson](https://github.com/markerikson) in https://github.com/reduxjs/redux-toolkit/pull/4361 - Prevent inference of any in create.asyncThunk by [@&#8203;EskiMojo14](https://github.com/EskiMojo14) in https://github.com/reduxjs/redux-toolkit/pull/4389 - try out simplifying matcher code by [@&#8203;EskiMojo14](https://github.com/EskiMojo14) in https://github.com/reduxjs/redux-toolkit/pull/4386 - Handle bigint in useQuerySubscription by [@&#8203;rkofman](https://github.com/rkofman) in https://github.com/reduxjs/redux-toolkit/pull/4315 - fix: ensure hook subscription failures do not reset isLoading state by [@&#8203;smacpherson64](https://github.com/smacpherson64) in https://github.com/reduxjs/redux-toolkit/pull/4364 - Improve usability of the `initiate()` action for mutations. by [@&#8203;jared-ca](https://github.com/jared-ca) in https://github.com/reduxjs/redux-toolkit/pull/4337 - Make retryCondition receive unknown error, as the user may not be using fetchBaseQuery by [@&#8203;EskiMojo14](https://github.com/EskiMojo14) in https://github.com/reduxjs/redux-toolkit/pull/3957 **Full Changelog**: https://github.com/reduxjs/redux-toolkit/compare/v2.2.3...v2.2.4 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNjAuMCIsInVwZGF0ZWRJblZlciI6IjM0LjE2MC4wIn0=-->
kjuulh added 1 commit 2024-05-09 04:34:15 +02:00
fix(deps): update dependency @reduxjs/toolkit to v2.2.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
9602fa7e3f
kjuulh merged commit 9602fa7e3f into main 2024-05-09 05:07:00 +02:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: kjuulh/todo#338
No description provided.