Releases: reduxjs/react-redux
v5.0.0-rc.2
npm install --save react-redux@next
# or
yarn add react-redux@next
Sorry about the flip-flopping, but we've removed the previous compatibility option. Another way of working around the issue was discovered that doesn't need configuration and has been implemented for this final release candidate. We should be ready to release a 5.0.0 final version tomorrow.
v5.0.0-rc.1
npm install --save react-redux@next
# or
yarn add react-redux@next
See the 5.0.0-beta.2 release notes if you're new to the 5.0 versions.
The big change for this version is a workaround for a cursor position bug in controlled input fields in React 15 or lower. See #525 for the gory details. There is a workaround in place that defaults to enabled, but will slightly reduce some of the performance gains of 5.0 (it is still faster, just not as fast). The underlying bug will be fixed in React 16 and we will default to disabling our workaround in the next release (scheduled for 5.1.0).
If you have no connected/controlled form inputs in your application, you can turn it off for all connected components like so:
// Before you ReactDOM.render()
import { connect } from 'react-redux'
connect.setDefaultReact15CompatibilityMode(false)
You can also pass a option to connect()
:
connect(mapStateToProps, mapDispatchToProps, mergeProps, { react15CompatibilityMode: false })
That's it! We should be pushing out a final release this weekend.
Changes
v4.4.6
v5.0.0-beta.3
v5.0.0-beta.2
This is a massive rewrite of React Redux, done mainly by @jimbolla (see #416). There actually will likely be no changes needed to your applications and we encourage you to try this version out in your applications without modification.
TL;DR
- Backwards compatible API
- Major internal changes
- Significant performance improvements in common usage patterns
- Bugs fixed
- Additional features added to
connect()
- New
connectAdvanced()
API - What's next?
API Compatibility
Version 5.0 maintains API compatibility with v4.x but due to major internal changes and potential behavior differences across nearly all API surfaces, semver dictates a major version bump. Also, it looks cooler! Store state change notifications sent to components are now guaranteed to occur top-down, so if your code may behave differently if it relied on notifications happening out of order.
Internal Changes
Internally, the code for connect
has been rewritten from the ground-up to be more modular, with the intention of greater maintainability and extensibility. This has also led to some new features and performance improvements.
Performance improvements
Significant performance gains were achieved by avoiding extra calls to setState()
and render()
by ensuring the order of change notifications to occur top-down, matching React's natural flow. Performance tests and benchmarks are discussed in #416.
Bugfixes
Some bugs/issues are resolved, related to performance loss and also impure components not re-rendering.
New features added to connect()
The behavior of connect()
is now more customizable, by passing additional properties in the options
arg. These will be described in the API docs.
New top level API: connectAdvanced()
The new implementation of connect()
splits its behavior such that it is now a wrapper around a more-generalized connectAdvanced()
. This connectAdvanced()
method can be called directly if you have extreme performance needs or want to craft an API different than that of connect()
. This will be described in the API docs.
What's next?
We're looking at removing the shouldComponentUpdate
optimization. Since this version is much more performant on its own, that isn't needed. This will fix long-standing problems with other libraries that use React's context
API. There are workarounds, but things should work without either library authors having to bend over backwards or React having to make API changes.
We will accept bugfixes on the 4.x branch (which will be created after this version goes final), but new features should be built against the next
branch. We love PRs, so keep them coming!