React-hot-loader: Support React Native

Created on 23 Mar 2018  路  3Comments  路  Source: gaearon/react-hot-loader

The current version of React Native uses something from RHL v1.
v4 could handle Webpack, Parcel and Electron. Lets add React Native. 馃殌

discussion enhancement help wanted

Most helpful comment

  • [ ] We have to find a call to registerRootComponent and wrap passed Component AppContainer HOC (does not exists)
  • [ ] We have to find entry point('main' in package.json), and place hot/module.accept into. One module.accept on top level should be enough. I am still could not understand the approach of react-transform - placing accept to any files with any React stuff inside could be dangerous.
  • [ ] Implement points above as a separate babel plugin. Something like react-hot-loader-installer.
  • [ ] Update react-native/babel-preset/configs/hmr.js to use RHL plugin.
  • [ ] double check - if react-native compiles js to ES5 - may be it worth to stop using eval, and hack method .bind methods.

All 3 comments

Ping @gaearon what do you think?

React Native are using react-hot-loader v1, and facing all the issues we solved.

Actually everything should work out of box, as long React-native supports the same module.hot as rest of bundlers.

Actually all the work shall be done not here - just rewire React-native HMR setup and done.

  • [ ] We have to find a call to registerRootComponent and wrap passed Component AppContainer HOC (does not exists)
  • [ ] We have to find entry point('main' in package.json), and place hot/module.accept into. One module.accept on top level should be enough. I am still could not understand the approach of react-transform - placing accept to any files with any React stuff inside could be dangerous.
  • [ ] Implement points above as a separate babel plugin. Something like react-hot-loader-installer.
  • [ ] Update react-native/babel-preset/configs/hmr.js to use RHL plugin.
  • [ ] double check - if react-native compiles js to ES5 - may be it worth to stop using eval, and hack method .bind methods.
Was this page helpful?
0 / 5 - 0 ratings