[Snyk] Upgrade reselect from 4.0.0 to 4.1.1 #69
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.1.
ℹ️ 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
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? :) )(a: number) => 42, (b: string) => 123
)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 failSomeType | undefined
were causing the entire selector to be typed as possibly returningundefined
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 returnundefined
as the actual result.The cache logic has been updated to use an internal sentinel value as the
NOT_FOUND
result instead, allowingundefined
to be correctly cached and returned.What's Changed
GetStateFromSelectors
by @ phryneas in #529undefined
by @ markerikson in #532New Contributors
Full Changelog: v4.1.0...v4.1.1
Read more
This release fixes an issue with the
typesVersions
package 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
dependencies
instead ofdevDependencies
, and adds thesideEffects
flag topackage.json
in 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.0This beta release updates
defaultMemoize
with the ability to clear cache for a memoized function, and updates the TS types ofcreateSelector
to correctly infer the type of the function returned from the memoizer.We would appreciate any feedback on the behavior of the new features and compatibility of the TS types, in preparation for a final 4.1.0 release.
New Contributors
Full Changelog: v4.1.0-alpha.2...v4.1.0-beta.0
Read more
This alpha release migrates the Reselect source to TypeScript, and updates all associated build tooling. There are no further changes to runtime behavior.
Along with that, the build tooling has been updated to properly compile TypeScript (based on the current build setup for React-Redux), and we've switched the test setup to use Jest instead of Mocha for consistency.
Changelog
v4.1.0-alpha.0...v4.1.0-alpha.1
This alpha preview release rewrites the TypeScript types to target TypeScript 4.2+, adds automatic type inference for
createStructuredSelector
, fixes a longstanding bug with theequalityCheck
argument todefaultMemoize
and its usage withcreateSelectorCreator
, and updates build tooling.We have an open roadmap discussion asking for feedback on a potential Reselect v5 API design, and would appreciate additional input and ideas there.
Changelog
TypeScript Target Version Updated to 4.2+
The Reselect types were written several years ago and originally targeted TS 2.x versions. As a result, the typedefs requires dozens of overloads to handle varying numbers of arguments (see the legacy typedefs file for examples).
We've completely rewritten the TS typedefs to use modern TS syntax like mapped types. This drastically shrinks the size of the typedefs (from 1000 lines to about 115), and also improves the actual type inference overall.
The updated types do require use of TS 4.2+. We've attempted to keep the final public type names and usage the same, but there may also be some types breakage. We'd appreciate feedback on any meaningful breakage issues so we can make further tweaks if needed.
Given the intent of the improvements, that they're all type-only changes, the attempts to retain backwards compatibility, and TS's own versioning scheme, we're considering this to be a minor version change rather than a major.
The legacy types are still included, and should automatically be used if you are using TS 4.1 and earlier.
Additional Type Fixes
In some cases passing an
equalityCheck
function todefaultMemoize
would not infer the right types for the(a, b)
arguments, either when used by itself or as an argument tocreateSelectorCreator
. Those types should now be inferred correctly.As part of that work, the types had long declared that
equalityCheck
functions tookindex: number
as a third parameter. That has not been true in the actual JS code since late 2016, but the types weren't updated to match the runtime behavior. That is now fixed.A new overload of
createSelectorCreator
has been added that will infer the type ofstate
for the overall selector if all input selectors have thestate
argument typed.Build Tooling Updates
Reselect now (finally) uses Babel 7. We're using Github Actions for CI and running type tests against TS4.2+.
Changes
This alpha release is from a still-draft PR, #486, and contains code from:
memoize
type fixes ( @ micahbales )createStructuredSelector
inference ( @ oatkiller )Full Changelog: v4.0.0...v4.1.0-alpha.0
New Features
Updated TypeScript typings (#274, #315)
Exposed selector dependencies (#251)
Use provided memoize function for selectors (#297)
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