@timdorr timdorr released this Dec 5, 2018 · 18 commits to master since this release

Assets 2

🎉 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 to connect has been replaced with forwardRef. If {forwardRef : true} has been passed to connect, 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 custom context={MyContext} prop to both <Provider> and <ConnectedComponent>. You may also pass {context : MyContext} as an option to connect.

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

Pre-release

@timdorr timdorr released this Nov 23, 2018 · 23 commits to master since this release

Assets 2

Changes

  • Treat null as a valid plain object prototype in isPlainObject() (#1075 by @rgrove)
  • Ensure connectAdvanced only re-renders if derived props change (#1079 by @epeli and @markerikson)
Pre-release

@timdorr timdorr released this Nov 23, 2018 · 28 commits to master since this release

Assets 2

Just a small fix to relax the React peer dependency back to 16.4+.

@timdorr timdorr released this Nov 10, 2018 · 35 commits to master since this release

Assets 2

Changes

  • Upgrade hoist-non-react-statics to deal with contextType (by @timdorr)
  • Treat null as a valid plain object prototype in isPlainObject() (#1075 by @rgrove)
Pre-release

@timdorr timdorr released this Nov 6, 2018 · 29 commits to master since this release

Assets 2

🎉 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 to connect has been replaced with forwardRef. If {forwardRef : true} has been passed to connect, adding a ref to the connected wrapper component will actually return the instance of the wrapped component. (Known issue: Redux Form currently relies on withRef.)
  • Passing store as a prop to a connected component is no longer supported. Instead, you may pass a custom context={MyContext} prop to both <Provider> and <ConnectedComponent>. You may also pass {context : MyContext} as an option to connect.

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

@timdorr timdorr released this Oct 25, 2018 · 35 commits to master since this release

Assets 2

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

Pre-release

@timdorr timdorr released this Jun 21, 2018 · 70 commits to master since this release

Assets 2

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

Changes

@timdorr timdorr released this Mar 21, 2018 · 293 commits to master since this release

Assets 2
  • Update hoist-non-react-statics to 2.x

@timdorr timdorr released this Feb 16, 2018 · 91 commits to master since this release

Assets 2

Changes

  • Allow Redux 4.0
  • Update hoist-non-react-statics to support getDerivedStateFromProps
  • Fix test code coverage reporting (#850 by @jacobdfriedmann)
  • Use methodName in error message (#852 by @pwnn)

@timdorr timdorr released this Aug 8, 2017 · 108 commits to master since this release

Assets 2

Changes

  • Persist child listeners through hot reload (#715 by @dsgkirkby)
  • Update hoist-non-react-statics to 2.x (#759 by @danez)
  • Move ref context binding to fix object freezing middleware (#733 by @gpoitch)
  • Remove explicit Provider.displayName in favor of the inferred name (#728 by @Andarist)
  • Move create-react-class back to devDependencies
  • Switch build process back to npm@5