From 361a944348e4da5d17f910965d0b89c9e65b18c7 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Fri, 17 Nov 2023 15:42:59 -0800 Subject: [PATCH] Remove "Open Debugger" action under JSC (#41535) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41535 ## Context **Remote JS Debugging removal** In React Native 0.73, we have deprecated Remote JS Debugging (execution of JavaScript in a separate V8 process) and also removed the Dev Menu launcher (https://github.com/facebook/react-native/pull/36754). ## This diff Follows D46187942 — this option wasn't correctly removed for Android when running JSC. This is now consistent with iOS. Changelog: [Android][Changed] "Open Debugger" is no longer available for remote JS debugging from the Dev Menu (non-Hermes). Please use `NativeDevSettings.setIsDebuggingRemotely()`. Reviewed By: blakef Differential Revision: D50555095 fbshipit-source-id: 1aeb48ab1390dc12ce300d6f321c30de5343cf0a --- .../react/devsupport/DevSupportManagerBase.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java index 2b4e4eabb64a98..e242858a71b2fc 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java @@ -363,15 +363,16 @@ public void onOptionSelected() { } }); - if (mDevSettings.isDeviceDebugEnabled()) { - // On-device JS debugging (CDP). Render action to open debugger frontend. + if (mDevSettings.isRemoteJSDebugEnabled()) { + // [Deprecated in React Native 0.73] Remote JS debugging. Handle reload + // via external JS executor. This capability will be removed in a future + // release. + mDevSettings.setRemoteJSDebugEnabled(false); + handleReloadJS(); + } - // Reset the old debugger setting so no one gets stuck. - // TODO: Remove in a few weeks. - if (mDevSettings.isRemoteJSDebugEnabled()) { - mDevSettings.setRemoteJSDebugEnabled(false); - handleReloadJS(); - } + if (mDevSettings.isDeviceDebugEnabled() && !mDevSettings.isRemoteJSDebugEnabled()) { + // On-device JS debugging (CDP). Render action to open debugger frontend. options.put( mApplicationContext.getString(R.string.catalyst_debug_open), () ->