TM iOS: disable remote debugging toggle when TurboModule is active

Summary: TurboModule needs sync calls from JS to native, and that's not supported with the current Chrome debugger. Until we have proper solution, disable it to avoid confusion.

Reviewed By: PeteTheHeat

Differential Revision: D14286383

fbshipit-source-id: e93903bf8fdfc714960d0d58e3f3eb0442c811bd
This commit is contained in:
Kevin Gozali
2019-03-01 14:25:29 -08:00
committed by Facebook Github Bot
parent 8ad695b10e
commit 75f2da23c5
2 changed files with 7 additions and 1 deletions

View File

@@ -219,9 +219,12 @@ RCT_EXPORT_MODULE()
if (!devSettings.isRemoteDebuggingAvailable) {
[items addObject:[RCTDevMenuItem buttonItemWithTitle:@"Remote JS Debugger Unavailable" handler:^{
NSString *message = RCTTurboModuleEnabled() ?
@"You cannot use remote JS debugging when TurboModule system is enabled" :
@"You need to include the RCTWebSocket library to enable remote JS debugging";
UIAlertController *alertController = [UIAlertController
alertControllerWithTitle:@"Remote JS Debugger Unavailable"
message:@"You need to include the RCTWebSocket library to enable remote JS debugging"
message:message
preferredStyle:UIAlertControllerStyleAlert];
__weak typeof(alertController) weakAlertController = alertController;
[alertController addAction:

View File

@@ -220,6 +220,9 @@ RCT_EXPORT_MODULE()
- (BOOL)isRemoteDebuggingAvailable
{
if (RCTTurboModuleEnabled()) {
return NO;
}
Class jsDebuggingExecutorClass = objc_lookUpClass("RCTWebSocketExecutor");
return (jsDebuggingExecutorClass != nil);
}