This repository was archived by the owner on Jan 20, 2023. It is now read-only.
[Snyk] Upgrade reselect from 4.0.0 to 4.1.6 #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade reselect from 4.0.0 to 4.1.6.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
Release notes
Package name: reselect
-
4.1.6 - 2022-06-07
- Fix #563 - Make it an error when the typings become incorrect by @ lukeapage in #572
-
4.1.5 - 2021-11-24
- Fix intersection of parameters that are undefined by @ markerikson in #556
- Export CreateSelectorFunction to fix createStructuredSelector usage by @ markerikson in #557
-
4.1.4 - 2021-11-17
- Switch package management to Yarn v3 by @ markerikson in #551
- Fix parameter expansion and improve OutputSelector readability by @ markerikson in #552
-
4.1.3 - 2021-11-16
const input1 = (
- Rewrite function parameter type inference to fix assorted issues by @ markerikson in #549
-
4.1.2 - 2021-11-04
- Update defaultMemoize cache even if resultEqualityCheck is a hit by @ tetslee in #535
- Make OutputSelector backwards compatible w/ < 4.1.0 version by @ eXamadeus in #536
- Clarify description of createSelector by @ acrollet in #539
- Clean up OutputSelector typing and fix bug with memoize function types by @ eXamadeus in #537
- @ tetslee made their first contribution in #535
- @ acrollet made their first contribution in #539
-
4.1.1 - 2021-10-26
-
4.1.0 - 2021-10-26
-
4.1.0-beta.2 - 2021-10-24
4ebcc36
-
4.1.0-beta.1 - 2021-10-21
v4.1.0-beta.0...v4.1.0-beta.1
-
4.1.0-beta.0 - 2021-10-21
-
4.1.0-alpha.2 - 2021-10-20
-
4.1.0-alpha.1 - 2021-10-17
-
4.1.0-alpha.0 - 2021-10-16
-
4.0.0 - 2018-09-30
from reselect GitHub release notesThis release updates the TS types to better handle cases with default parameters, or
any/unknowntypes.What's Changed
Full Changelog: v4.1.5...v4.1.6
This release updates the TS types to correctly infer selector parameters when input selectors have
undefinedornullas a parameter type or have optional parameters, and exports theCreateSelectorFunctiontype to fix uses ofcreateStructuredSelector.(The types fixes feel like playing whack-a-mole, but they keep getting better!
What's Changed
Full Changelog: v4.1.4...v4.1.5
This release has (you guessed it) more fixes to the TS types: a change to parameter merging that fixes breakage with selectors and RTK Query's API state, a simplification of the
OutputSelectorFieldstype to improve selector variable readability, another update to parameter merging to flag nestedneverfields as compile errors, and a fix tocreateStructuredSelectorparameters to resolve a lib compilation problem.Changelog
More TS Fixes
The parameter merging fixes in 4.1.3 tried to "unwrap/expand" the parameter types to make them more readable, such as showing intersected objects as
{a, b, c}instead of{a} & {b} & {c}. This was done with a recursive expansion type. That turned out to break with the complex state types used by RTK Query. We've updated the type expansion to only be a single level instead, which fixes the compilation issue.The
OutputSelectorFieldstype previously took two generics: theCombinerfunction, and aResulttype. This led to extra values being shown in hover previews for selectors. By inferringResult = ReturnType<Combiner>, we were able to drop the second generic and cut down on the amount of types shown in previews.A user noted that intersected objects with top-level incompatible fields (like
{a: string} & {a: number}) resulted in empty objects, but no compile error. We've updated the parameter merging to flag those asneverand catch the problem at compile time. Deeper nested incompatible fields should already be caught by TS.The previous fix to
createStructuredSelectormissed a step in the spreading process, which has now been fixed.What's Changed
Full Changelog: v4.1.3...v4.1.4
This release rewrites the TS type inference of input selector parameters for correctness, fixes inference of
createStructuredSelectorinputs, and fixes an issue with theOutputSelectorFieldstype not being exported.Changelog
Input Selector Parameter Inference Improvements
Reselect's types have always been extremely tricky, because it involves passing multiple input selectors with potentially heterogeneous, and then nested function composition of multiple selectors. Additionally, the input selectors can be passed as individual arguments or a single array of input selectors.
The 4.0.0 typedefs dealt with this by hand-writing dozens of overloads, which was absolutely impossible to maintain.
In 4.1, we took advantage of TS's improved abilities to infer array/tuple types to consolidate the typedefs.
One of the issues that happened as a result was that arguments at the same input parameter index were being "unioned" together, rather than "intersectioned". For example, in this complex selector:
_: StateA,
{ testNumber }: { testNumber: number },
c: number,
d: string
) => testNumber
const input2 = (
_: StateA,
{ testString }: { testString: string },
c: number | string
) => testString
const input3 = (
_: StateA,
{ testBoolean }: { testBoolean: boolean },
c: number | string,
d: string
) => testBoolean
const input4 = (_: StateA, { testString2 }: { testString2: string }) =>
testString2
const testSelector = createSelector(
input1,
input2,
input3,
input4,
(testNumber, testString, testBoolean) => testNumber + testString
)
The second arg should end up as an object like
{testNumber: number, testString: string, testBoolean: boolean, testString2: string}. However, it was ending up as four separate one-field objects. Similarly, the combination ofnumberandnumber | stringshould be narrowed down to justnumberas an acceptable value.We've rewritten the types to successfully accomplish that (although it took a lot of collective effort and headbanging to actually pull this off!) This should now give much more correct results when determining the final parameters that can be passed to a selector.
createStructuredSelectorFixesSimilarly,
createStructuredSelectorwasn't always inferring its arguments properly. We were able to reuse the parameter inference work here as well.OutputSelectorFieldsExportedThe public
OutputSelectortype depended on an internalOutputSelectorFieldstype, but sinceOSFwasn't being exported, TS would throw errors when trying to generate declaration files that exported selectors. That is now public as well.What's Changed
Full Changelog: v4.1.2...v4.1.3
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
resultEqualityCheckoption indefaultMemoize.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
OutputSelectorgeneric 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.defaultMemoizeadds a.clearCache()field to its return value. While the real caching is done by thememoizedResultFuncfunction, 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.
resultEqualityCheckBehaviorThe
resultEqualityCheckoption wasn't saving the result if there was a cache hit, which is now fixed.What's Changed
New Contributors
Full Changelog: v4.1.1...v4.1.2
Read more
Read more
This release fixes an issue with the
typesVersionspackage field so that TS 4.1 and earlier correctly pick up the legacy type definitions - no other code changes.v4.1.0-beta.1...v4.1.0-beta.2
This release fixes a couple test-related packages that were accidentally listed as
dependenciesinstead ofdevDependencies, and adds thesideEffectsflag topackage.jsonin case it's useful.There are no code changes from
4.1.0-beta.0: https://github.com/reduxjs/reselect/releases/tag/v4.1.0-beta.0Read more
Commit messages
Package name: reselect
Compare
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:

🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs