-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Fast Refresh #583
Comments
We develop the next version of haul on next branch and disabled hot loader because it was just too hacky. We're happy to give Fast Refresh a try. Cc @zamotany who's developing Haul at the moment |
@gaearon Yeah, I'm happy to chat (with pretty much whatever means of communication you prefer). Alternatively you can write me a quick overview and point me to the source code in Metro if needed. |
any updates on this? |
I wrote an overview of how Fast Refresh works here: facebook/react#16604 (comment) There's a few implementations linked from that thread. |
Since Haul uses webpack, it might make sense to join efforts with https://github.com/pmmmwh/react-refresh-webpack-plugin. |
To anyone interested in the issue. There's a common misconception that just because something is built for Webpack, it will work out of the box for React Native with Haul. 90% of the time it doesn't. Anything that's. being built for Webpack targets web and uses browser API. From the investigation done some time ago here are the takeaways what would have to be done in order to support React Refresh in Haul. The fast refresh is terribly complex issue and it would require major changes and additions to support. As a base for investigation I did some time ago, I used https://github.com/pmmmwh/react-refresh-webpack-plugin:
To summarise: there are a lot of moving parts to get this working and it requires extensive/deep knowledge about how Webpack works - more specifically what parts are put into the final bundle, how the module system and Webpack logic working in the bundle and how |
@zamotany Does this mean it will not be supplied in near future (if at all)? |
Describe the feature
We've landed Fast Refresh on React Native master. You can try it if you build all Metro packages from master and replace them in
node_modules
of RNTester.Motivation
It would be nice if Haul could replace
react-hot-loader
or other techniques with Fast Refresh because:react-hot-loader
and similar tools)It likely also fixes hot reloading problems with navigation libraries because it's fully integrated with React. (Although I don't have a test case to verify that.)
It would also unify the behavior with mainline React Native.
But How?
I'd be happy to chat with someone to give an overview of how the new system works. For a 100% match in behavior we might need some new hooks from webpack, but you should be able to get reasonably close today too.
The text was updated successfully, but these errors were encountered: