npm redux 5.0.0-alpha.2
v5.0.0-alpha.2

latest releases: 5.0.1, 5.0.0, 5.0.0-rc.1...
16 months ago

This is an alpha release for Redux 5.0. This release has types changes, an internal implementation tweak, and many changes to our build and test setup.

Changelog

Store Enhancer TS Types Changes

The TS conversion in 2019 had made some changes to the definition of the StoreEnhancer TS type around replacing reducers. Some time later, we concluded that the enhancer types changes needed to be reverted, but that fell by the wayside. We've finally merged that reversion. This earlier type was never actually released publicly.

We also made an additional change to improve the typing of the next arg in enhancers.

Internal Listener Implementation

The Redux store has always used an array to track listener callbacks, and used listeners.findIndex to remove listeners on unsubscribe. As we found in React-Redux, that can have perf issues when many listeners are unsubscribing at once.

In React-Redux, we fixed that with a more sophisticated linked list approach. Here, we've updated the listeners to be stored in a Map instead, which has better delete performance than an array.

In practice this shouldn't have any real effect, because React-Redux sets up a subscription in <Provider>, and all nested components subscribe to that. But, nice to fix it here as well.

Build Tooling Updates

We made numerous updates to our build tooling, including switching package management to Yarn 3, running tests directly from src locally instead of building first, actually running the TS typetests we'd added years ago, testing our types against a matrix of TS versions, and running tests in CI against a built copy of the library.

What's Changed

Full Changelog: v5.0.0-alpha.1...v5.0.0-alpha.2

Don't miss a new redux release

NewReleases is sending notifications on new releases.