v4.1.0-alpha.0 #508
markerikson
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This alpha preview release rewrites the TypeScript types to target TypeScript 4.2+, adds automatic type inference for
createStructuredSelector, fixes a longstanding bug with theequalityCheckargument todefaultMemoizeand its usage withcreateSelectorCreator, and updates build tooling.This is the first release in several years, due to the original maintainer @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
equalityCheckfunction todefaultMemoizewould 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
equalityCheckfunctions tookindex: numberas 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
createSelectorCreatorhas been added that will infer the type ofstatefor the overall selector if all input selectors have thestateargument 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:
memoizetype fixes ( @micahbales )createStructuredSelectorinference ( @oatkiller )Full Changelog: v4.0.0...v4.1.0-alpha.0
This discussion was created from the release v4.1.0-alpha.0.
Beta Was this translation helpful? Give feedback.
All reactions