This repository was archived by the owner on Apr 9, 2020. It is now read-only.
Releases: gaearon/react-transform-hmr
Releases · gaearon/react-transform-hmr
v1.0.4
v1.0.3
v1.0.2
v1.0.1
- Bump the minimal
react-proxyversion to incorporate a few important fixes: https://github.com/gaearon/react-proxy/releases/tag/v1.1.1
v1.0.0
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
react-transform-webpack-hmrhas been renamed toreact-transform-hmrin the light of Browserify HMR implementation. This release bumps the version so users can switch fromreact-transform-webpack-hmr@0.1.6with the deprecation message toreact-transform-hmr@0.1.6without changing the version.