Skip to content

Commit

Permalink
Option to use fallback bundle in dev mode
Browse files Browse the repository at this point in the history
Summary: Changelog: [Android] [Added] - Adds option use fallback bundle instead of cached bundle when the packager isn't running in ReactInstanceManager

Reviewed By: ShikaSD

Differential Revision: D30899295

fbshipit-source-id: 7ea68fb13029bde9c3170cacee92b3c8a0a7367d
  • Loading branch information
amy588 authored and facebook-github-bot committed Sep 17, 2021
1 parent 9f55bda commit dd10134
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ public interface ReactInstanceEventListener {
private final @Nullable JSIModulePackage mJSIModulePackage;
private final @Nullable ReactPackageTurboModuleManagerDelegate.Builder mTMMDelegateBuilder;
private List<ViewManager> mViewManagers;
private boolean mUseFallbackBundle = false;

private class ReactContextInitParams {
private final JavaScriptExecutorFactory mJsExecutorFactory;
Expand Down Expand Up @@ -350,6 +351,10 @@ public void destroyRootView(View rootView) {
};
}

public synchronized void setUseFallbackBundle(boolean useFallbackBundle) {
mUseFallbackBundle = useFallbackBundle;
}

private JavaScriptExecutorFactory getJSExecutorFactory() {
return mJavaScriptExecutorFactory;
}
Expand Down Expand Up @@ -452,7 +457,8 @@ public void run() {
if (packagerIsRunning) {
mDevSupportManager.handleReloadJS();
} else if (mDevSupportManager.hasUpToDateJSBundleInCache()
&& !devSettings.isRemoteJSDebugEnabled()) {
&& !devSettings.isRemoteJSDebugEnabled()
&& !mUseFallbackBundle) {
// If there is a up-to-date bundle downloaded from server,
// with remote JS debugging disabled, always use that.
onJSBundleLoadedFromServer();
Expand Down

0 comments on commit dd10134

Please sign in to comment.