mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-06-19 21:29:36 +08:00
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:
committed by
Facebook Github Bot
parent
8ad695b10e
commit
75f2da23c5
@@ -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:
|
||||
|
||||
@@ -220,6 +220,9 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (BOOL)isRemoteDebuggingAvailable
|
||||
{
|
||||
if (RCTTurboModuleEnabled()) {
|
||||
return NO;
|
||||
}
|
||||
Class jsDebuggingExecutorClass = objc_lookUpClass("RCTWebSocketExecutor");
|
||||
return (jsDebuggingExecutorClass != nil);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user