Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snyk] Upgrade reselect from 4.0.0 to 4.1.1 #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snyk-bot
Copy link

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.


  • The recommended version is 8 versions ahead of your current version.
  • The recommended version was released 23 days ago, on 2021-10-26.
Release notes
Package name: reselect
  • 4.1.1 - 2021-10-26

    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

    • Split out optional last argument (memoizeOptions) into it's own overload by @ eXamadeus in #530
    • increase subselector number by @ phryneas in #528
    • build intersection type instead of union type in GetStateFromSelectors by @ phryneas in #529
    • Update cache to support storing a value of undefined by @ markerikson in #532

    New Contributors

    Full Changelog: v4.1.0...v4.1.1

  • 4.1.0 - 2021-10-26
    Read more
  • 4.1.0-beta.2 - 2021-10-24

    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.

  • 4.1.0-beta.1 - 2021-10-21

    This release fixes a couple test-related packages that were accidentally listed as dependencies instead of devDependencies, and adds the sideEffects flag to package.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.0

    v4.1.0-beta.0...v4.1.0-beta.1

  • 4.1.0-beta.0 - 2021-10-21

    This beta release updates defaultMemoize with the ability to clear cache for a memoized function, and updates the TS types of createSelector 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.

    @ markerikson in #519
  • chore(repo): update all deps by @ peter-mouland in #518

New Contributors

Full Changelog: v4.1.0-alpha.2...v4.1.0-beta.0

  • 4.1.0-alpha.2 - 2021-10-20
    Read more
  • 4.1.0-alpha.1 - 2021-10-17

    This alpha release migrates the Reselect source to TypeScript, and updates all associated build tooling. There are no further changes to runtime behavior.

    https://github.com/reduxjs/reselect/releases/tag/v4.1.0-alpha.0 , we've gone ahead and migrated the actual Reselect source to TS using those updated types. There were some additional tweaks needed to make this work (such as using interfaces rather than function overloads), but the types themselves should work exactly the same as alpha.0. All existing type tests pass, and we've confirmed that some existing TS+Redux apps still compile correctly if Reselect is upgraded to this build.

    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

  • 4.1.0-alpha.0 - 2021-10-16

    This alpha preview release rewrites the TypeScript types to target TypeScript 4.2+, adds automatic type inference for createStructuredSelector, fixes a longstanding bug with the equalityCheck argument to defaultMemoize and its usage with createSelectorCreator, and updates build tooling.

    @ ellbee dealing with other obligations. Thanks to him for all his hard work, and for giving additional maintainers access.

    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 to defaultMemoize would not infer the right types for the (a, b) arguments, either when used by itself or as an argument to createSelectorCreator. Those types should now be inferred correctly.

    As part of that work, the types had long declared that equalityCheck functions took index: 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 of state for the overall selector if all input selectors have the state 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:

    Full Changelog: v4.0.0...v4.1.0-alpha.0

  • 4.0.0 - 2018-09-30

    New Features

    Updated TypeScript typings (#274, #315)
    Exposed selector dependencies (#251)
    Use provided memoize function for selectors (#297)

  • from reselect GitHub release notes
    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

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant