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

Enable fast refresh banner #40999

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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 @@ -86,9 +86,6 @@ public BridgeDevSupportManager(
surfaceDelegateFactory,
devLoadingViewManager);

mReactInstanceManagerHelper = reactInstanceManagerHelper;
mDevLoadingViewManager = devLoadingViewManager;

if (getDevSettings().isStartSamplingProfilerOnInit()) {
// Only start the profiler. If its already running, there is an error
if (!mIsSamplingProfilerEnabled) {
Expand All @@ -112,14 +109,6 @@ public void onOptionSelected() {
});
}

public DevLoadingViewManager getDevLoadingViewManager() {
return mDevLoadingViewManager;
}

public ReactInstanceDevHelper getReactInstanceManagerHelper() {
return mReactInstanceManagerHelper;
}

@Override
protected String getUniqueTag() {
return "Bridge";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,11 @@ public DevServerHelper getDevServerHelper() {
return mDevServerHelper;
}

protected ReactInstanceDevHelper getReactInstanceDevHelper() {
public DevLoadingViewManager getDevLoadingViewManager() {
return mDevLoadingViewManager;
}

public ReactInstanceDevHelper getReactInstanceDevHelper() {
return mReactInstanceDevHelper;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
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;

Expand All @@ -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();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,7 @@ private Task<ReactInstance> newGetOrCreateReactInstanceTask() {
final JSBundleLoader bundleLoader = task.getResult();
final BridgelessReactContext reactContext = getOrCreateReactContext();
final DevSupportManager devSupportManager = getDevSupportManager();
reactContext.setJSExceptionHandler(devSupportManager);

log(method, "Creating ReactInstance");
final ReactInstance instance =
Expand Down Expand Up @@ -1036,6 +1037,7 @@ private Task<ReactInstance> oldGetOrCreateReactInstanceTask() {

final BridgelessReactContext reactContext = getOrCreateReactContext();
final DevSupportManager devSupportManager = getDevSupportManager();
reactContext.setJSExceptionHandler(devSupportManager);

return getJsBundleLoader()
.onSuccess(
Expand Down