Skip to content

Update dependency reselect to v4.1.2 - autoclosed

igswsihw-wmadepbot requested to merge renovate/reselect-4.x into main

This MR contains the following updates:

Package Change Age Adoption Passing Confidence
reselect 4.1.0 -> 4.1.2 age adoption passing confidence

Release Notes

reduxjs/reselect

v4.1.2

Compare Source

This release updates the TS types to avoid TypeScript recursion limitations and improve backwards compatibility, adds doc comments to most of the TS types and field declarations, and fixes a bug with the behavior of the resultEqualityCheck option in defaultMemoize.

Changelog

TypeScript Updates

We saw cases where composition of selectors past 8-9 levels of nesting would cause TS to fail with a "Type instantiation is excessively deep and possibly infinite" error.

We've updated the types to allow additional recursion up to about 15 levels of nested selectors. Hopefully this is enough for most usages :)

The OutputSelector generic arguments had been swapped during the rewrite for 4.1, which made it incompatible with other code that attempted to import and use that type. We've reverted the generic arguments to their previous order to fix compatibility.

defaultMemoize adds a .clearCache() field to its return value. While the real caching is done by the memoizedResultFunc function, the actual returned selector has also been run through the memoizer and thus also has a .clearCache() field attached, but that wasn't captured in the types. We've updated the types to reflect that.

We've also added doc comments to almost all of the internal types for clarity, as well as comments to the returned fields on selectors.

resultEqualityCheck Behavior

The resultEqualityCheck option wasn't saving the result if there was a cache hit, which is now fixed.

What's Changed

New Contributors

Full Changelog: https://github.com/reduxjs/reselect/compare/v4.1.1...v4.1.2

v4.1.1

Compare Source

This releases fixes several TS issues and one runtime issue that were reported with the release of 4.1.0.

Changelog

TypeScript Fixes

All these reported issues should now be fixed:

  • createSelector calls with 12 or more input selectors were causing TS to fail with a "Type instantiation is excessively deep" error. After this update, createSelector should now support up to 29 input selectors before TS has type issues. (and if you've got more than 29 input selectors.... what are you doing? :) )
  • Passing multiple input selectors with mismatched argument types should have been failing to compile, but was being silently accepted (ie (a: number) => 42, (b: string) => 123)
  • The OutputParametricSelector type, which is re-exported by Redux Toolkit, was inadvertently left out of the list of Reselect type exports during the rewrite and caused RTK builds to fail
  • Input selectors that were typed to return SomeType | undefined were causing the entire selector to be typed as possibly returning undefined
Caching Undefined Values

The previous internal cache logic had a couple of if (foundValue !== undefined) checks inside, but that broke cases where a selector intentionally wanted to return undefined as the actual result.

The cache logic has been updated to use an internal sentinel value as the NOT_FOUND result instead, allowing undefined to be correctly cached and returned.

What's Changed

New Contributors

Full Changelog: https://github.com/reduxjs/reselect/compare/v4.1.0...v4.1.1


Configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this MR and you won't be reminded about this update again.


  • If you want to rebase/retry this MR, click this checkbox.

This MR has been generated by Renovate Bot.

Edited by igswsihw-wmadepbot

Merge request reports

Loading