-
Notifications
You must be signed in to change notification settings - Fork 24k
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
[HMR] Ensure Hot Loading is working on Android #5338
Comments
Hey martinbigio, thanks for reporting this issue! React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
|
Using the latest v0.21.0-rc I can't seem to figure out how to enable HMR, should there be a dev menu option? |
@JohnyDays For now you need to install from master - http://facebook.github.io/react-native/docs/android-setup.html#content |
Thanks, I'll give it a look and give some feedback 👍 |
For anyone stuck in making it work, there is no need to install from master, here are the steps for a new project:
|
Oh! I thought @martinbigio removed it before the RC. Finally we have HMR for Android in a public release 🎉 |
Figured out the problem.
It should probably be requested from the remote url/ip (e.g 192.168.1.183).
UPDATE: |
Hmm though @mkonicek removed it. It wasn't intended to have the option visible on the menu yet |
Ohh, this is 0.21RC. We'll remove the option from the menu there. If everything goes well we should be able to open the feature on 0.22 :) |
@JohnyDays Thanks so much for working on adding support for having multiple clients!. Please let us know if you find any bug or if there're other feature requests you think we should implement. We'll need help on testing this, so the more people use it before it's open the better :) |
I'm having some trouble getting the android version to compile my java code changes. I have react-native cloned into the node_modules folder, and when I run As an aside, symlinking react-native from another folder makes it so the packager doesn't correctly serve the files |
@JohnyDays follow the instructions here - http://facebook.github.io/react-native/docs/android-setup.html#content |
Symlinking won't work, coz watchman, which RN uses to watch files, doesn't support symlinks. |
Yeah I have my machine (arch-linux) setup with the sdk, and gradle daemon, all the build tools and genymotion. |
@martinbigio Just a heads up, i reimplemented the changes to attachHMRServer.js from b2b41da and 20588a6, so there wouldn't be any problems with conflicts. I should be able to open the PR today, cheers 🍺 |
Wow, this indeed will be helpful for a lot of people!. I recently added support for redux stores and modules that export pure functions and modified this file (436db67). Most likely you'll have to rebase. |
Just updated to rn-0.22 and the warnings(as shown by @JohnyDays) are still there |
Yep, I am also getting this on genymotion with react-native 0.22. I also tried setting debug server host & port to point to my development machine, no luck. EDIT: When I edit and save a file on the editor I see 'Hot Loading...' toast on genymotion. I guess application is aware of the change but fails to load. |
@martinbigio I did some digging on this when i was working on multiple clients, and it appears to be related to source maps. e.g even if you are requesting from a remote ip, the source maps still point to localhost. |
Genymotion sets a special ip to access localhost from the simulator, however to fetch the sourcemaps we're using localhost... |
The problem is that JS lacks of this logic: react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java Lines 158 to 160 in 1f94a00
cc @mkonicek |
Shouldn't it be the java sending this information to the packager? Such as genymotion=true or localhost=10.0.3.2 in the url |
Yup, we're going to expose this on the |
Summary:Source maps are broken on Genymotion right now as they aren't being loaded from the correct URL. refer - #5338 (comment) **Test plan** Build and install UIExplorer from master branch in genymotion and enable hot reload. When you change a file and save it, you'll see a Yellow box due to source map fetching failed, as per the referenced comment. Doing the same for this branch doesn't produce any yellow boxes. Closes #6594 Differential Revision: D3088218 Pulled By: martinbigio fb-gh-sync-id: 0d1c19cc263de5c6c62061c399eef33fa4ac4a7b shipit-source-id: 0d1c19cc263de5c6c62061c399eef33fa4ac4a7b
same error as above still react-native version: |
Summary:Source maps are broken on Genymotion right now as they aren't being loaded from the correct URL. refer - facebook#5338 (comment) **Test plan** Build and install UIExplorer from master branch in genymotion and enable hot reload. When you change a file and save it, you'll see a Yellow box due to source map fetching failed, as per the referenced comment. Doing the same for this branch doesn't produce any yellow boxes. Closes facebook#6594 Differential Revision: D3088218 Pulled By: martinbigio fb-gh-sync-id: 0d1c19cc263de5c6c62061c399eef33fa4ac4a7b shipit-source-id: 0d1c19cc263de5c6c62061c399eef33fa4ac4a7b
Summary:Source maps are broken on Genymotion right now as they aren't being loaded from the correct URL. refer - facebook/react-native#5338 (comment) **Test plan** Build and install UIExplorer from master branch in genymotion and enable hot reload. When you change a file and save it, you'll see a Yellow box due to source map fetching failed, as per the referenced comment. Doing the same for this branch doesn't produce any yellow boxes. Closes facebook/react-native#6594 Differential Revision: D3088218 Pulled By: martinbigio fb-gh-sync-id: 0d1c19cc263de5c6c62061c399eef33fa4ac4a7b shipit-source-id: 0d1c19cc263de5c6c62061c399eef33fa4ac4a7b
We've done quite many changes to HMR since @satya164 added the Hot Loading option to the dev menu. This task is to make sure Hot Loading works on a brand new project. Also, we need to gate the feature for now, we don't want to release up until we're sure it's stable.
The text was updated successfully, but these errors were encountered: