@gaearon gaearon released this Sep 1, 2015 · 452 commits to master since this release

Assets 2

Breaking Changes

Hot reloading reducers is now explicit (#80)

React Redux used to magically allow reducer hot reloading. This magic used to cause problems (https://github.com/rackt/redux/issues/301, https://github.com/rackt/redux/issues/340), so we made the usage of replaceReducer() for hot reloading explicit (https://github.com/rackt/redux/pull/667).

If you used hot reloading of reducers, you'll need to add module.hot API calls to the place where you create the store. (Of course, assuming that you use Webpack.)

Before

import { createStore } from 'redux';
import rootReducer from '../reducers/index';

export default function configureStore(initialState) {
  return createStore(rootReducer, initialState);
}

After

import { createStore } from 'redux';
import rootReducer from '../reducers/index';

export default function configureStore(initialState) {
  const store = createStore(rootReducer, initialState);

  if (module.hot) {
    // Enable Webpack hot module replacement for reducers
    module.hot.accept('../reducers', () => {
      const nextRootReducer = require('../reducers/index');
      store.replaceReducer(nextRootReducer);
    });
  }

  return store;
}

This is more code, but what's happening is now explicit, and this also lets you do this right in index.js instead of creating a separate <Root> component. See https://github.com/rackt/redux/pull/667 for a migration example.

process.env.NODE_ENV is required for CommonJS build (#81)

In 0.7.0, we temporarily removed the dependency on it to support React Native, but now that RN 0.10 is out with process.env.NODE_ENV polyfill, we again demand it to be defined. If you're not ready to use RN 0.10, or are in a different environment, either use a browser build, or shim it yourself.