Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Releases: gaearon/react-transform-hmr

v1.0.4

06 Mar 18:04
Compare
Choose a tag to compare
  • Bump react-proxy

v1.0.3

06 Mar 03:13
Compare
Choose a tag to compare
  • Update react-proxy to fix a few correctness issues

v1.0.2

02 Feb 17:19
Compare
Choose a tag to compare
  • Remove unnecessary files from the npm package (d4a36b3)

v1.0.1

25 Sep 20:13
Compare
Choose a tag to compare

v1.0.0

19 Sep 16:41
Compare
Choose a tag to compare

Breaking Change

The transform no longer takes precautions to become a no-op in production environment or environment with undefined module.hot. It is now your responsibility to only enable it in development environment.

React

Make sure to wrap your React Transform configuration into env.development inside .babelrc:

{
  "stage": 0,
  "env": {

    // only enable it when process.env.NODE_ENV is not 'production'

    "development": {
      "plugins": ["react-transform"],
      "extra": {
        "react-transform": [{
          "target": "react-transform-hmr",
          "imports": ["react"],
          "locals": ["module"]
        }]
      }
    }
  }
}

Then make sure you're running Babel with NODE_ENV=production in the production.

React Native

For React Native users, .babelrc doesn't work well with React Transform, so just make sure to configure React Transform inside the Webpack config only when hot mode is enabled:

var config = {

  /* ... */

  module: {
    loaders: [{
      test: /\.js$/,
      exclude: /node_modules/,
      loader: 'babel',
      query: {
        stage: 0,
        plugins: []
      }
    }]
  },

  plugins: []
};

if (process.env.HOT) {
  config.devtool = 'eval';
  config.entry['index.ios'].unshift('react-native-webpack-server/hot/entry');
  config.entry['index.ios'].unshift('webpack/hot/only-dev-server');
  config.entry['index.ios'].unshift('webpack-dev-server/client?http://localhost:8082');
  config.output.publicPath = 'http://localhost:8082/';
  config.plugins.unshift(new webpack.HotModuleReplacementPlugin());

  // Note: enabling React Transform and React Transform HMR:

  config.module.loaders[0].query.plugins.push('react-transform');
  config.module.loaders[0].query.extra = {
    'react-transform': [{
      target: 'react-transform-hmr',
      imports: ['react-native'],
      locals: ['module']
    }]
  };
}

v0.1.6

19 Sep 15:06
Compare
Choose a tag to compare
  • react-transform-webpack-hmr has been renamed to react-transform-hmr in the light of Browserify HMR implementation. This release bumps the version so users can switch from react-transform-webpack-hmr@0.1.6 with the deprecation message to react-transform-hmr@0.1.6 without changing the version.

v0.1.5

16 Sep 23:42
Compare
Choose a tag to compare
  • Bump React Proxy to 1.1.0 for better force updating behavior

v0.1.4

04 Sep 21:18
Compare
Choose a tag to compare
  • Attempts to fix #1

v0.1.3

03 Sep 16:43
Compare
Choose a tag to compare
  • Use appropriate global in different environments

v0.1.2

03 Sep 12:07
Compare
Choose a tag to compare
  • Handle module-level errors