facebook / metro

🚇 The JavaScript bundler for React Native
https://metrobundler.dev
MIT License
5.23k stars 625 forks source link

Remove HMR feature #336

Open DimitryDushkin opened 5 years ago

DimitryDushkin commented 5 years ago

1) HMR is quite broken for new React releases. Check out number of issues in it https://github.com/gaearon/react-hot-loader/issues and this https://github.com/gaearon/react-hot-loader/issues/1024 2) This library is not evolving. It's not supporting forwardRef, hooks, lazy. 3) It's wrapping every component in react-proxy, which complicates debugging and also not compatable with class-based components without transpilation to functions. 4) Takes lots of time to make it work with redux-based applications

So I suggest to remove it from metro.

theKashey commented 5 years ago

The problem is - "metro" is using React-Hot-Loader v2. Right now it's version 4, and version 5 is planned to fix 1024, and probably any other issue.

It's better to upgrade it, than to remove.

miracle2k commented 5 years ago

Related: The HMR feature causes code which uses static class members to be compiled incorrectly at times, see this thread: https://github.com/kmagiera/react-native-gesture-handler/pull/406#issuecomment-453750387

theKashey commented 5 years ago

True. Current HMR solution is a bit aggresive. Even offensive.