Skip to content
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

improve dev mode and HMR interop #24377

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ public void showDevOptionsDialog() {
new DevOptionHandler() {
@Override
public void onOptionSelected() {
if (mDevSettings.isHotModuleReplacementEnabled()) {
Toast.makeText(mApplicationContext, "Dev mode and HRM cannot be both enabled at once. Disabling HMR...", Toast.LENGTH_LONG).show();
vonovak marked this conversation as resolved.
Show resolved Hide resolved
mDevSettings.setHotModuleReplacementEnabled(false);
}
handleReloadJS();
}
});
Expand Down Expand Up @@ -509,6 +513,10 @@ public void onOptionSelected() {
new DevOptionHandler() {
@Override
public void onOptionSelected() {
if (!mDevSettings.isJSDevModeEnabled()) {
Toast.makeText(mApplicationContext, "Dev mode needs to be turned on to enable HRM.", Toast.LENGTH_LONG).show();
vonovak marked this conversation as resolved.
Show resolved Hide resolved
return;
}
mDevSettings.setHotModuleReplacementEnabled(!mDevSettings.isHotModuleReplacementEnabled());
handleReloadJS();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<CheckBoxPreference
android:key="js_dev_mode_debug"
android:title="JS Dev Mode"
android:summary="Load JavaScript bundle with __DEV__ = true for easier debugging. Disable for performance testing. Reload for the change to take effect."
android:summary="Load JavaScript bundle with __DEV__ = true for easier debugging. Disable for performance testing. Reload for the change to take effect."
android:defaultValue="true"
/>
<CheckBoxPreference
Expand Down