Skip to content

v3.0.1

Compare
Choose a tag to compare
@gaearon gaearon released this 25 Sep 22:26
· 2888 commits to master since this release

This release brings a few changes that, while aimed at making the developer experience better, should have no noticeable impact on your apps.

  • In development, combineReducers() now checks the state shape on every invocation instead of just once. This makes it easy to discover issues like #715 where you post-process the state from combineReducers() and then wonder why something you added to it has disappeared after the next action. This change has no effect in production, and you’re unlikely to hit it in development either, as post-processing state from combineReducers() isn't a very common pattern. (#715, #720)
  • The reducer probing performed by combineReducers() as a sanity check has been moved from the combineReducers() call to the first reducer invocation. Technically the check is still performed during the combineReducers() call, but the error is only thrown after during the initial dispatch. (Usually that would correspond to the createStore()call.) This reason for this is that otherwise an error thrown inside a reducer used to blow up combineReducers() and thus the whole module definition, and hot reloading used to fail in this case instead of showing the error in Redux DevTools. With this change and a corresponding fix in Redux DevTools, an error thrown inside a reducer that was later wrapped in combineReducers() will be displayed correctly, and once you fix the error, it will hot reload. (#717, #761, reduxjs/redux-devtools#106, reduxjs/redux-devtools#120)
  • The reducer probing performed by combineReducers() as a sanity check now uses @@redux/PROBE_UNKNOWN_ACTION_ prefix in the action type. Previously, action type was a random string. The reason for this change is to make it easier for type-checking libraries like redux-tcomb ignore such actions. This change does not affect application developers: just like before, you should never attempt to handle @@redux/* actions directly in your code. (#792, #796)

Happy reducing!