mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Enable fast refresh banner (#40999)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/40999 Fast refresh banner for Android was introduced for Bridge-only (D42286425), in this diff we enable it for Bridgeless as well. Changelog: [Android][Changed] - Enable fast refresh banner for Bridgeless Reviewed By: cortinico Differential Revision: D50318991 fbshipit-source-id: 08e3cda5e4cc6e9b7319db57627c1e6bf7fcc67b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
56683b0c77
commit
66fbab2586
-11
@@ -86,9 +86,6 @@ public final class BridgeDevSupportManager extends DevSupportManagerBase {
|
||||
surfaceDelegateFactory,
|
||||
devLoadingViewManager);
|
||||
|
||||
mReactInstanceManagerHelper = reactInstanceManagerHelper;
|
||||
mDevLoadingViewManager = devLoadingViewManager;
|
||||
|
||||
if (getDevSettings().isStartSamplingProfilerOnInit()) {
|
||||
// Only start the profiler. If its already running, there is an error
|
||||
if (!mIsSamplingProfilerEnabled) {
|
||||
@@ -112,14 +109,6 @@ public final class BridgeDevSupportManager extends DevSupportManagerBase {
|
||||
});
|
||||
}
|
||||
|
||||
public DevLoadingViewManager getDevLoadingViewManager() {
|
||||
return mDevLoadingViewManager;
|
||||
}
|
||||
|
||||
public ReactInstanceDevHelper getReactInstanceManagerHelper() {
|
||||
return mReactInstanceManagerHelper;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getUniqueTag() {
|
||||
return "Bridge";
|
||||
|
||||
+5
-1
@@ -695,7 +695,11 @@ public abstract class DevSupportManagerBase implements DevSupportManager {
|
||||
return mDevServerHelper;
|
||||
}
|
||||
|
||||
protected ReactInstanceDevHelper getReactInstanceDevHelper() {
|
||||
public DevLoadingViewManager getDevLoadingViewManager() {
|
||||
return mDevLoadingViewManager;
|
||||
}
|
||||
|
||||
public ReactInstanceDevHelper getReactInstanceDevHelper() {
|
||||
return mReactInstanceDevHelper;
|
||||
}
|
||||
|
||||
|
||||
+3
-9
@@ -13,8 +13,7 @@ import com.facebook.react.bridge.JSExceptionHandler;
|
||||
import com.facebook.react.bridge.NativeModule;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.bridge.UiThreadUtil;
|
||||
import com.facebook.react.devsupport.BridgeDevSupportManager;
|
||||
import com.facebook.react.devsupport.DefaultDevLoadingViewImplementation;
|
||||
import com.facebook.react.devsupport.DevSupportManagerBase;
|
||||
import com.facebook.react.devsupport.interfaces.DevLoadingViewManager;
|
||||
import com.facebook.react.module.annotations.ReactModule;
|
||||
|
||||
@@ -28,14 +27,9 @@ public class DevLoadingModule extends NativeDevLoadingViewSpec {
|
||||
public DevLoadingModule(ReactApplicationContext reactContext) {
|
||||
super(reactContext);
|
||||
mJSExceptionHandler = reactContext.getJSExceptionHandler();
|
||||
if (mJSExceptionHandler != null && mJSExceptionHandler instanceof BridgeDevSupportManager) {
|
||||
if (mJSExceptionHandler != null && mJSExceptionHandler instanceof DevSupportManagerBase) {
|
||||
mDevLoadingViewManager =
|
||||
((BridgeDevSupportManager) mJSExceptionHandler).getDevLoadingViewManager();
|
||||
mDevLoadingViewManager =
|
||||
mDevLoadingViewManager != null
|
||||
? mDevLoadingViewManager
|
||||
: new DefaultDevLoadingViewImplementation(
|
||||
((BridgeDevSupportManager) mJSExceptionHandler).getReactInstanceManagerHelper());
|
||||
((DevSupportManagerBase) mJSExceptionHandler).getDevLoadingViewManager();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -922,6 +922,7 @@ public class ReactHostImpl implements ReactHost {
|
||||
final JSBundleLoader bundleLoader = task.getResult();
|
||||
final BridgelessReactContext reactContext = getOrCreateReactContext();
|
||||
final DevSupportManager devSupportManager = getDevSupportManager();
|
||||
reactContext.setJSExceptionHandler(devSupportManager);
|
||||
|
||||
log(method, "Creating ReactInstance");
|
||||
final ReactInstance instance =
|
||||
@@ -1036,6 +1037,7 @@ public class ReactHostImpl implements ReactHost {
|
||||
|
||||
final BridgelessReactContext reactContext = getOrCreateReactContext();
|
||||
final DevSupportManager devSupportManager = getDevSupportManager();
|
||||
reactContext.setJSExceptionHandler(devSupportManager);
|
||||
|
||||
return getJsBundleLoader()
|
||||
.onSuccess(
|
||||
|
||||
Reference in New Issue
Block a user