Update dependency @reduxjs/toolkit to v2.2.5 #190

Closed
mr.renovate wants to merge 1 commit from renovate/reduxjs-toolkit-2.x into develop
Member

This PR contains the following updates:

Package Type Update Change
@reduxjs/toolkit (source) peerDependencies minor 2.1.0 -> 2.2.5
@reduxjs/toolkit (source) dependencies minor 2.1.0 -> 2.2.5

Release Notes

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

v2.2.5

Compare Source

This bugfix release fixes an issue in the recent createEntityAdapter sorting perf improvements that could (in specific cases) cause Immer to throw an error when trying to read a plain JS value instead of a proxy-wrapped value.

What's Changed

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

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

v2.2.3

Compare Source

This bugfix release fixes the types for functions that accept a React Context instance to match the changes in React Redux v9.

What's Changed

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

v2.2.2

Compare Source

This patch release fixes an incorrect build setting for the legacy-esm artifacts, and fixes an issue with RTKQ query hooks didn't always remove the cache entries if arguments were changed rapidly.

Changes
legacy-esm Artifact Transpilation

The legacy-esm build artifacts are intended for use by Webpack 4. Those were supposed to be transpiled to target "es2017", but were in fact still set to target "esnext" - an oversight during the 2.0 development cycle. This release fixes that setting, so those artifacts are now correctly transpiled.

Other Fixes

RTKQ query hooks now handle additional actions around argument changes that should result in cache entries being removed.

Additionally, 2.2.1 contained a fix to an incorrectly named type: TypedUseMutationTrigger is now TypedMutationTrigger.

What's Changed

Full Changelog: https://github.com/reduxjs/redux-toolkit/compare/v2.2.0...v2.2.2

v2.2.1

Compare Source

v2.2.0

Compare Source

This minor release:

  • Adds a second parameter to entityAdapter.getInitialState(additionalProps, entities) to allow prefilling state
    • Equivalent to entityAdapter.setAll(entityAdapter.getInitialState(additionalProps), entities)
    • First parameter can be undefined if no additional properties are desired
  • Allows initialising combineSlices with no static reducers
    • Previously const combinedReducer = combineSlices().withLazyLoadedSlices<LazyLoadedSlices>() would have thrown an error
    • Now returns a "no-op" reducer that just returns an empty object until first reducer injected
  • Allows a new 'throw' value for overrideExisting in injectEndpoints, which throws an error if a definition is injected with a name which is already used
  • Exports more type helpers for RTKQ hook and trigger types
  • Exports types related to overriding result types in enhanceEndpoints
  • Fixes state inference for injected slices when undeclared (i.e. not in LazyLoadedSlices)
  • Adds a action.meta.arg.isPrefetch value to query thunk actions when prefetched
What's Changed
New Contributors

Full Changelog: https://github.com/reduxjs/redux-toolkit/compare/v2.1.0...v2.2.0


  • 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)) | peerDependencies | minor | [`2.1.0` -> `2.2.5`](https://renovatebot.com/diffs/npm/@reduxjs%2ftoolkit/2.1.0/2.2.5) | | [@reduxjs/toolkit](https://redux-toolkit.js.org) ([source](https://github.com/reduxjs/redux-toolkit)) | dependencies | minor | [`2.1.0` -> `2.2.5`](https://renovatebot.com/diffs/npm/@reduxjs%2ftoolkit/2.1.0/2.2.5) | --- ### Release Notes <details> <summary>reduxjs/redux-toolkit (@&#8203;reduxjs/toolkit)</summary> ### [`v2.2.5`](https://github.com/reduxjs/redux-toolkit/releases/tag/v2.2.5) [Compare Source](https://github.com/reduxjs/redux-toolkit/compare/v2.2.4...v2.2.5) This **bugfix release** fixes an issue in the recent `createEntityAdapter` sorting perf improvements that could (in specific cases) cause Immer to throw an error when trying to read a plain JS value instead of a proxy-wrapped value. ##### What's Changed - Fix missed spot where use of `current` may fail if the value is not a draft by [@&#8203;markerikson](https://github.com/markerikson) in https://github.com/reduxjs/redux-toolkit/pull/4412 **Full Changelog**: https://github.com/reduxjs/redux-toolkit/compare/v2.2.4...v2.2.5 ### [`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 ### [`v2.2.3`](https://github.com/reduxjs/redux-toolkit/releases/tag/v2.2.3) [Compare Source](https://github.com/reduxjs/redux-toolkit/compare/v2.2.2...v2.2.3) This **bugfix** release fixes the types for functions that accept a React Context instance to match the [changes in React Redux v9](https://redux-toolkit.js.org/usage/migrating-rtk-2#custom-context-typing). #### What's Changed - Update React Redux dependency to v9, and update docs to use `.withTypes` by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4308 **Full Changelog**: https://github.com/reduxjs/redux-toolkit/compare/v2.2.2...v2.2.3 ### [`v2.2.2`](https://github.com/reduxjs/redux-toolkit/releases/tag/v2.2.2) [Compare Source](https://github.com/reduxjs/redux-toolkit/compare/v2.2.1...v2.2.2) This patch release fixes an incorrect build setting for the `legacy-esm` artifacts, and fixes an issue with RTKQ query hooks didn't always remove the cache entries if arguments were changed rapidly. ##### Changes ##### `legacy-esm` Artifact Transpilation The `legacy-esm` build artifacts are intended for use by Webpack 4. Those were *supposed* to be transpiled to target `"es2017"`, but were in fact still set to target `"esnext"` - an oversight during the 2.0 development cycle. This release fixes that setting, so those artifacts are now correctly transpiled. ##### Other Fixes RTKQ query hooks now handle additional actions around argument changes that should result in cache entries being removed. Additionally, 2.2.1 contained a fix to an incorrectly named type: `TypedUseMutationTrigger` is now `TypedMutationTrigger`. ##### What's Changed - rename TypedUseMutationTrigger to TypedMutationTrigger, and add deprecated alias by [@&#8203;EskiMojo14](https://github.com/EskiMojo14) in https://github.com/reduxjs/redux-toolkit/pull/4204 - Fixed memory leak in rapid hook arg changing by [@&#8203;riqts](https://github.com/riqts) in https://github.com/reduxjs/redux-toolkit/pull/4268 - Fix incorrect legacy-esm target by [@&#8203;markerikson](https://github.com/markerikson) in https://github.com/reduxjs/redux-toolkit/pull/4284 **Full Changelog**: https://github.com/reduxjs/redux-toolkit/compare/v2.2.0...v2.2.2 ### [`v2.2.1`](https://github.com/reduxjs/redux-toolkit/compare/v2.2.0...v2.2.1) [Compare Source](https://github.com/reduxjs/redux-toolkit/compare/v2.2.0...v2.2.1) ### [`v2.2.0`](https://github.com/reduxjs/redux-toolkit/releases/tag/v2.2.0) [Compare Source](https://github.com/reduxjs/redux-toolkit/compare/v2.1.0...v2.2.0) This *minor release*: - Adds a second parameter to `entityAdapter.getInitialState(additionalProps, entities)` to allow prefilling state - Equivalent to `entityAdapter.setAll(entityAdapter.getInitialState(additionalProps), entities)` - First parameter can be `undefined` if no additional properties are desired - Allows initialising `combineSlices` with no static reducers - Previously `const combinedReducer = combineSlices().withLazyLoadedSlices<LazyLoadedSlices>()` would have thrown an error - Now returns a "no-op" reducer that just returns an empty object until first reducer injected - Allows a new `'throw'` value for `overrideExisting` in `injectEndpoints`, which throws an error if a definition is injected with a name which is already used - Exports more type helpers for RTKQ hook and trigger types - Exports types related to overriding result types in `enhanceEndpoints` - Fixes state inference for injected slices when undeclared (i.e. not in `LazyLoadedSlices`) - Adds a `action.meta.arg.isPrefetch` value to query thunk actions when prefetched ##### What's Changed - Revamp type tests setup by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4095 - Bump Prettier and Prettier related packages by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4126 - Fix codemods to work with TypeScript 4.7+ by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4081 - Export types related to overriding the result types by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4134 - Migrate type tests to Vitest by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4127 - Fix RetryOptions type test by flipping order by [@&#8203;EskiMojo14](https://github.com/EskiMojo14) in https://github.com/reduxjs/redux-toolkit/pull/4136 - Format all files by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4135 - \[Docs/Website] skipPollingIfUnfocused added to polling overview and query options by [@&#8203;riqts](https://github.com/riqts) in https://github.com/reduxjs/redux-toolkit/pull/4131 - \[Docs] Changed create.asyncThunk setup admonition to caution by [@&#8203;riqts](https://github.com/riqts) in https://github.com/reduxjs/redux-toolkit/pull/4150 - Temporarily revert node-fetch bump until ESM issues are sorted by [@&#8203;EskiMojo14](https://github.com/EskiMojo14) in https://github.com/reduxjs/redux-toolkit/pull/4151 - Contributing Markdown Refresh by [@&#8203;itz-Me-Pj](https://github.com/itz-Me-Pj) in https://github.com/reduxjs/redux-toolkit/pull/4139 - investigate re-adding size limit action by [@&#8203;EskiMojo14](https://github.com/EskiMojo14) in https://github.com/reduxjs/redux-toolkit/pull/4083 - Add size limit imports for more commonly used RTK exports by [@&#8203;EskiMojo14](https://github.com/EskiMojo14) in https://github.com/reduxjs/redux-toolkit/pull/4155 - pure some things by [@&#8203;EskiMojo14](https://github.com/EskiMojo14) in https://github.com/reduxjs/redux-toolkit/pull/4157 - cut back on suffixes tested for size by [@&#8203;EskiMojo14](https://github.com/EskiMojo14) in https://github.com/reduxjs/redux-toolkit/pull/4160 - Incorrect builder method referenced by [@&#8203;kantbtrue](https://github.com/kantbtrue) in https://github.com/reduxjs/redux-toolkit/pull/4161 - Rename `cli.js` to `cli.mjs` by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4169 - Migrate Codegen OpenAPI's unit tests to Vitest by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4137 - Fix wrong state for injected slices when not declared via `withLazyLoadedSlices` by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4172 - \[Docs, createEntityAdapter API]: add missing setOne and setMany signature by [@&#8203;kyselberg](https://github.com/kyselberg) in https://github.com/reduxjs/redux-toolkit/pull/4173 - Corrected the "Observing cache behaviour" example point no.4 by [@&#8203;721-atikshaikh](https://github.com/721-atikshaikh) in https://github.com/reduxjs/redux-toolkit/pull/4174 - feat: add isPrefetch property in query action by [@&#8203;juliengbt](https://github.com/juliengbt) in https://github.com/reduxjs/redux-toolkit/pull/4177 - allow initialising combined slice reducer with no static slices by [@&#8203;EskiMojo14](https://github.com/EskiMojo14) in https://github.com/reduxjs/redux-toolkit/pull/4184 - Create more Typed wrappers for RTKQ hook types by [@&#8203;EskiMojo14](https://github.com/EskiMojo14) in https://github.com/reduxjs/redux-toolkit/pull/4147 - proposal fix for axios base query types by [@&#8203;smff](https://github.com/smff) in https://github.com/reduxjs/redux-toolkit/pull/4186 - Provide 'throw' option for `overrideExisting` by [@&#8203;ffluk3](https://github.com/ffluk3) in https://github.com/reduxjs/redux-toolkit/pull/4189 - Use vite-tsconfig-paths to make path aliasing easier by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4175 - Remove trailing commas in `tsconfig.json` files of all CodesandBox examples by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/redux-toolkit/pull/4190 - \[Docs] Added withTypes documentation in createDraftSafeSelector by [@&#8203;riqts](https://github.com/riqts) in https://github.com/reduxjs/redux-toolkit/pull/4143 - Add second parameter to getInitialState to prefill entities by [@&#8203;EskiMojo14](https://github.com/EskiMojo14) in https://github.com/reduxjs/redux-toolkit/pull/4183 ##### New Contributors - [@&#8203;itz-Me-Pj](https://github.com/itz-Me-Pj) made their first contribution in https://github.com/reduxjs/redux-toolkit/pull/4139 - [@&#8203;kantbtrue](https://github.com/kantbtrue) made their first contribution in https://github.com/reduxjs/redux-toolkit/pull/4161 - [@&#8203;kyselberg](https://github.com/kyselberg) made their first contribution in https://github.com/reduxjs/redux-toolkit/pull/4173 - [@&#8203;721-atikshaikh](https://github.com/721-atikshaikh) made their first contribution in https://github.com/reduxjs/redux-toolkit/pull/4174 - [@&#8203;smff](https://github.com/smff) made their first contribution in https://github.com/reduxjs/redux-toolkit/pull/4186 - [@&#8203;ffluk3](https://github.com/ffluk3) made their first contribution in https://github.com/reduxjs/redux-toolkit/pull/4189 **Full Changelog**: https://github.com/reduxjs/redux-toolkit/compare/v2.1.0...v2.2.0 </details> --- - [ ] <!-- 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:eyJjcmVhdGVkSW5WZXIiOiIzNy42MC4yIiwidXBkYXRlZEluVmVyIjoiMzcuNjAuMiIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AifQ==-->
requested review from romanjaros 2024-05-09 06:33:01 +02:00
mr.renovate force-pushed renovate/reduxjs-toolkit-2.x from afb0ea0dc4 to c9f4c66c1b 2024-05-10 06:33:03 +02:00 Compare
mr.renovate force-pushed renovate/reduxjs-toolkit-2.x from c9f4c66c1b to 95b23de5c4 2024-05-17 06:32:59 +02:00 Compare
mr.renovate changed title from Update dependency @reduxjs/toolkit to v2.2.4 to Update dependency @reduxjs/toolkit to v2.2.5 2024-05-17 06:33:00 +02:00
romanjaros closed this pull request 2024-05-24 10:17:40 +02:00
Author
Member

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update (2.2.5). You will get a PR once a newer version is released. To ignore this dependency forever, add it to the ignoreDeps array of your Renovate config.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

### Renovate Ignore Notification Because you closed this PR without merging, Renovate will ignore this update (`2.2.5`). You will get a PR once a newer version is released. To ignore this dependency forever, add it to the `ignoreDeps` array of your Renovate config. If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.
Some checks are pending
forgejo/Procyon/procyon/pipeline/pr-develop This commit looks good
forgejo/Procyon/procyon/pipeline/head This commit looks good
forgejo/forgejo.dev/procyon/pipeline/pr-develop
Required

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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: procyon/procyon#190
No description provided.