-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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] Improve Hot Loading gating #5339
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.
|
I'll look into how to do this on Android. |
@javache any pointer on how to enable this on |
Our default app delegate template (https://github.com/facebook/react-native/blob/master/local-cli/generator-ios/templates/app/AppDelegate.m) doesn't really make use of the bridge's delegate methods. We could change this to create a RCTBridge first, but you'd lose the advantage of the simple RCTRootView API. Anyone who has a slightly more complicated setup should be able to simply element the new delegate method. |
I was thinking, on Android, we can have the following to enable experimental features, protected List<Integer> getEnabledExperiments() {
return Array<Integer>.asList(
Experiments.HOT_MODULE_REPLACEMENT,
Experiments.SOME_OTHER_CRAZY_EXPERIMENT);
} Or simpler, call Experiments.setEnabledExperiments(
Array<Integer>.asList(
Experiments.HOT_MODULE_REPLACEMENT,
Experiments.SOME_OTHER_CRAZY_EXPERIMENT)); Then in the code which implements the experiment, we can do the following, if (Experiments.isExperimentEnabled(Experiments.HOT_MODULE_REPLACEMENT)) {
// Do stuff
} What do you think about the approach before I implement it? |
cc @mkonicek |
So another approach would be to allow people enable experiments from dev settings UI as @mkonicek suggested. |
I'm not sure about having it in the UI, because it's very easy to find and enable, and then we can get bug reports even if it's not ready. Adding it only in code means that only people who know what they are doing enable experimental things, and we get better quality bug reports. |
Yeah, that makes sense |
@martinbigio When I start the packager in a new RN app I see it listens on "/hot" by default. Is that intentional? |
@mkonicek It'll only work when the url has |
Cool, that makes sense. Don't think it should be enabled by default on iOS though, should it? |
@mkonicek Yes, it shouldn't. @martinbigio can confirm :) |
The feature is disabled but if a user would modify |
Hey, is there any guidelines on testing the feature for android? I'd love to give some feedback on it, but can't seem to figure out how to enable it. |
@JohnyDays For now you can install from master. There will be an option to enable it in the dev menu. |
Now HMR is enabled in 0.22.0, is this issue still relevant? |
No, let's close it. |
Hot Loading is currently disabled by default until we're confident enough it's good to go. On iOS, users have to enable it by tweaking the method
hotLoadingEnabled
onRCTDevMenu.m
. @satya164 might know about how to enable this on Android.Ideally the feature should be enabled way easier (i.e.: by implementing a method on
AppDelegate.m
for instance). I don't know much about Android to make a proposal.The text was updated successfully, but these errors were encountered: