Releases: reduxjs/react-redux
v4.4.10
v6.0.1
This is a minor release with support for react-hot-loader and a few small bug fixes for edge cases.
While you're here, please stop by #1177 to see our roadmap for the next versions of React Redux. We are aware that performance is not so hot in 6.0. Short version: We put too much traffic on React's context API, which isn't really designed for high levels of reads and writes. We're looking to reduce that load and get performance back on track in a minor release, so there won't be backwards compatibility concerns. We have a new extensive benchmark suite to keep us on track and ensure we're not regressing on speed in the future.
And yes, we know about Hooks. Check out #1179.
Changes
- Fix for circular component object structures, such as Emotion styled components. (#1122 by @Andarist)
- Minor optimization: remove conditional (#1131 by @ericanderson)
- Ensure that component
context
prop really contains a React context (#1134 by @casdevs) - react-hot-loader compatibility (#1168/#1137 by @theKashey)
- Upgrade to react-is v16.7.0 (#1174 by @nobezawa)
v6.0.0
🎉 This is our first big release supporting the new Context API added in React 16.4!
As such, we now require React 16.4 or higher. Make sure to update your version when updating to this release.
This work has been mostly lead by @cellog and @markerikson, with special guest appearances by yours truly and a whole cast of helpful reviewers.
Note: If you'd like to know more about the changes in v6, and how the implementation has changed over time, see Mark's post Idiomatic Redux: The History and Implementation of React-Redux.
Breaking Changes
-
The
withRef
option toconnect
has been replaced withforwardRef
. If{forwardRef : true}
has been passed toconnect
, adding a ref to the connected wrapper component will actually return the instance of the wrapped component. -
Passing
store
as a prop to a connected component is no longer supported. Instead, you may pass a customcontext={MyContext}
prop to both<Provider>
and<ConnectedComponent>
. You may also pass{context : MyContext}
as an option toconnect
.
Behavior Changes
Any library that attempts to access the store instance out of legacy context will break, because we now put the store state into a <Context.Provider>
instead. Examples of this include connected-react-router
and react-redux-subspace
. (The current implementation does also put the store itself into that same context. While accessing the store in context is not part of our public API, we will still try to make it possible for other libraries to access it, with the understanding that this could break at any time.)
Also, there is a behavior change around dispatching actions in constructors / componentWillMount
. Previously, dispatching in a parent component's constructor would cause its children to immediately use the updated state as they mounted, because each component read from the store individually. In version 6, all components read the same current store state value from context, which means the tree will be consistent and not have "tearing". This is an improvement overall, but there may be applications that relied on the existing behavior.
Changes
- Use React.createContext() (#1000 by @cellog)
- Use Prettier (#1071 by @NMinhNguyen)
- Only run isValidElementType in development builds (#1069 by @alexreardon)
- Treat
null
as a valid plain object prototype inisPlainObject()
(#1075 by @rgrove) - Ensure connectAdvanced only re-renders if derived props change (#1079 by @epeli and @markerikson)
v6.0.0-beta.3
v6.0.0-beta.2
Just a small fix to relax the React peer dependency back to 16.4+.
v5.1.1
v6.0.0-beta.1
🎉 This is our first big release supporting the new React Context API! No more blocked updates!
As such, we now require React 16.4 or higher. Make sure to update your version when updating to this release.
This work has been mostly lead by @cellog and @markerikson, with special guest appearances by yours truly and a whole cast of helpful reviewers. While we've had a lot of eyes on this refactor, we need more! Please test this out in your applications and let us know if there are big performance or feature regressions.
npm install react-redux@next
Note: 6.0.0-beta.2 is now on npm. This fixes an incorrect peer dependency for React 16.6 in beta.1.
Breaking Changes
Known major breaking changes:
- The
withRef
option toconnect
has been replaced withforwardRef
. If{forwardRef : true}
has been passed toconnect
, adding a ref to the connected wrapper component will actually return the instance of the wrapped component. (Known issue: Redux Form currently relies onwithRef
.) - Passing
store
as a prop to a connected component is no longer supported. Instead, you may pass a customcontext={MyContext}
prop to both<Provider>
and<ConnectedComponent>
. You may also pass{context : MyContext}
as an option toconnect
.
Other Behavior Changes
Any library that attempts to access the store instance out of legacy context will break, because we now put the store state into a <Context.Provider>
instead. Examples of this include connected-react-router
and react-redux-subspace
. (The current implementation does also put the store itself into that same context. While accessing the store in context is not part of our public API, we will still try to make it possible for other libraries to access it, with the understanding that this could break at any time.)
Also, there is a behavior change around dispatching actions in constructors / componentWillMount
. Previously, dispatching in a parent component's constructor would cause its children to immediately use the updated state as they mounted, because each component read from the store individually. In version 6, all components read the same current store state value from context, which means the tree will be consistent and not have "tearing". This is an improvement overall, but there may be applications that relied on the existing behavior.
Other than those issues, this should be API-compatible with the existing version 5.x line.
Changes
- Use React.createContext() (#1000 by @cellog)
- Use Prettier (#1071 by @NMinhNguyen)
- Only run isValidElementType in development builds (#1069 by @alexreardon)
v5.1.0
The biggest fix is for connect()
being used with React's newer forwardRef
, memo
, and lazy
APIs.
We also have begun a complete rewrite of our docs for React Redux. Check them out! Many thanks to those who contributed: @markerikson, @sveinpg, @wgao19, @BTMPL, @pyliaorachel, @dagstuan, @Kerumen, and @carloluis (sorry if I forgot someone!). Docs are a great way to get started contributing to open source, so open a PR today! Check #1001 to see what else needs to be done.
We're also looking at overhauling Redux's documentation. Check out reduxjs/redux#2590 for the latest there.
Changes
- Simplify object check and eliminate lodash dependency (#936 by @matthargett)
- Remove subkey arg (#945 by @theJian)
- Switch our test suite to Jest (@timdorr)
- Implement testing in React 0.14, 15, and 16.x (#984 by @cellog)
- Convert tests to use react-testing-library instead of Enzyme (#998 by @cellog and @markerikson)
- Add unpkg field to package.json (#1003 by @nickmccurdy)
- Set up basic docusaurus structure (#1032 by @sveinpg)
- Add nodejs version 10 for ci (#1058 by @noelyoo)
- Upgrade to babel@7 (#1043 @Andarist)
v5.1.0-test.1
This release is broken - DO NOT USE IT!
This is a test release to try out some changes in relation with React 16.3's new StrictMode. Please try it out in your projects and see if it breaks anything!
Narrator: It did.
It turned out to be very broken, and should not be used.
We are currently working on React-Redux version 6.0, which will switch to using createContext
internally. See #950 for our development roadmap, and #995 and #1000 for the two "competing" work-in-progress PRs (available on NPM as tags next-995
and next-1000
). Please try those out instead, and give us feedback in the PR threads.
Changelog for historical reference
- Remove subkey arg (#945 by @theJian)
- Simplify object check and eliminate lodash dependency (#936 by @matthargett)
- Remove usages of async-unsafe lifecycle methods (#919 by @Hypnosphi)