mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Don't inject synthetic Debugger.disable message in modern CDP backend (#42400)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42400 Changelog: [Internal] TSIA - iOS counterpart of D52040149 on Android. The overarching principle is that nothing outside of an Agent should be doing anything with the CDP message stream. Here we have a case of `RCTInspectorDevServerHelper` basically impersonating the CDP frontend in order to paper over an apparent lifetime management bug in the old backend; this gets in the way of implementing reloads natively so we disable it under the new backend. NOTE: I'm gating out both the call site in `RCTBridge` (to signal intent) *and* the actual body of `disableDebugger` (in case any out-of-tree code happens to be using this method). Reviewed By: voideanvalue Differential Revision: D50967799 fbshipit-source-id: 759718bf155b8b16c7db54ac2d2507bc71c93436
This commit is contained in:
committed by
Facebook GitHub Bot
parent
26e33a5f17
commit
a89005d709
@@ -279,8 +279,11 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
||||
- (void)didReceiveReloadCommand
|
||||
{
|
||||
#if RCT_ENABLE_INSPECTOR
|
||||
// Disable debugger to resume the JsVM & avoid thread locks while reloading
|
||||
[RCTInspectorDevServerHelper disableDebugger];
|
||||
auto &inspectorFlags = facebook::react::jsinspector_modern::InspectorFlags::getInstance();
|
||||
if (!inspectorFlags.getEnableModernCDPRegistry()) {
|
||||
// Disable debugger to resume the JsVM & avoid thread locks while reloading
|
||||
[RCTInspectorDevServerHelper disableDebugger];
|
||||
}
|
||||
#endif
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:RCTBridgeWillReloadNotification object:self userInfo:nil];
|
||||
|
||||
@@ -145,7 +145,10 @@ static void sendEventToAllConnections(NSString *event)
|
||||
|
||||
+ (void)disableDebugger
|
||||
{
|
||||
sendEventToAllConnections(kDebuggerMsgDisable);
|
||||
auto &inspectorFlags = facebook::react::jsinspector_modern::InspectorFlags::getInstance();
|
||||
if (!inspectorFlags.getEnableModernCDPRegistry()) {
|
||||
sendEventToAllConnections(kDebuggerMsgDisable);
|
||||
}
|
||||
}
|
||||
|
||||
+ (id<RCTInspectorPackagerConnectionProtocol>)connectWithBundleURL:(NSURL *)bundleURL
|
||||
|
||||
Reference in New Issue
Block a user