From 45ba31abd64ffa66a7663b8525ae25f341bd9709 Mon Sep 17 00:00:00 2001 From: Andrew <30809111+acoates-ms@users.noreply.github.com> Date: Mon, 12 Feb 2024 11:44:37 -0800 Subject: [PATCH 1/2] Remove WebDebugging support --- .spelling | 1 - docs/inspector.md | 1 - .../cli/src/commands/runWindows/runWindows.ts | 1 - .../commands/runWindows/runWindowsOptions.ts | 1 - .../cli/src/e2etest/runWindows.test.ts | 1 - .../cli/src/utils/deploy.ts | 3 - packages/debug-test/DebuggingFeatures.test.ts | 6 - packages/debug-test/PlaygroundAutomation.ts | 29 -- .../windows/RNTesterApp/App.xaml.cs | 2 - .../windows/integrationtest/App.cpp | 2 - packages/playground/CoreApp/App.cpp | 1 - packages/playground/CoreApp/app.config.json | 1 - .../Playground-Composition.cpp | 8 +- .../playground-win32/Playground-Win32.cpp | 13 +- .../playground-win32/Playground-Win32.rc | 1 - .../windows/playground-win32/resource.h | 1 - .../windows/playground/MainPage.cpp | 75 ++--- .../playground/windows/playground/MainPage.h | 6 - .../windows/playground/MainPage.xaml | 7 - .../sample-apps/windows/SampleAppCPP/App.cpp | 2 - .../windows/SampleAppCS/App.xaml.cs | 2 - .../RNTesterIntegrationTests.cpp | 3 - .../React.Windows.Desktop.UnitTests.vcxproj | 1 - ....Windows.Desktop.UnitTests.vcxproj.filters | 3 - .../WebSocketJSExecutorTest.cpp | 25 -- vnext/IntegrationTests/TestRunner.cpp | 1 - .../ReactContextTest.cpp | 4 - .../ReactModuleBuilderMock.h | 4 - vnext/Microsoft.ReactNative.Cxx/CoreApp.h | 2 - .../TestReactNativeHostHolder.cpp | 1 - .../TestReactNativeHostHolder.cs | 1 - .../ReactModuleBuilderMock.cs | 2 - .../ReactSettingsSnapshot.cs | 2 - vnext/Microsoft.ReactNative/CoreApp.cpp | 3 - .../Microsoft.ReactNative/DevMenuControl.idl | 3 - .../Microsoft.ReactNative/DevMenuControl.xaml | 16 +- vnext/Microsoft.ReactNative/IReactContext.cpp | 4 - vnext/Microsoft.ReactNative/IReactContext.h | 1 - vnext/Microsoft.ReactNative/IReactContext.idl | 12 +- .../IReactPackageBuilder.idl | 4 +- .../Modules/DevSettingsModule.cpp | 4 +- .../ReactApplication.cpp | 2 - .../ReactHost/IReactInstance.h | 1 - .../ReactHost/MsoReactContext.cpp | 7 - .../ReactHost/MsoReactContext.h | 1 - vnext/Microsoft.ReactNative/ReactHost/React.h | 12 - .../ReactHost/ReactHost.cpp | 37 --- .../ReactHost/ReactInstanceWin.cpp | 191 ++++-------- .../ReactHost/ReactInstanceWin.h | 4 - .../ReactInstanceSettings.cpp | 8 - .../ReactInstanceSettings.h | 6 - .../ReactInstanceSettings.idl | 16 +- .../Microsoft.ReactNative/ReactNativeHost.cpp | 8 +- .../ReactPackageBuilder.cpp | 16 +- .../ReactPackageBuilder.h | 9 +- vnext/Microsoft.ReactNative/Views/DevMenu.cpp | 25 +- vnext/Shared/DevSettings.h | 8 - vnext/Shared/DevSupportManager.cpp | 33 -- vnext/Shared/DevSupportManager.h | 3 - .../Shared/Executors/WebSocketJSExecutor.cpp | 294 ------------------ vnext/Shared/Executors/WebSocketJSExecutor.h | 123 -------- .../Executors/WebSocketJSExecutorFactory.cpp | 25 -- vnext/Shared/IDevSupportManager.h | 1 - vnext/Shared/OInstance.cpp | 259 +++++++-------- vnext/Shared/Shared.vcxitems | 4 - vnext/Shared/Shared.vcxitems.filters | 12 - vnext/Shared/WebSocketJSExecutorFactory.h | 26 -- vnext/template/cpp-app/src/App.cpp | 2 - vnext/template/cs-app/src/App.xaml.cs | 2 - 69 files changed, 230 insertions(+), 1165 deletions(-) delete mode 100644 vnext/Desktop.UnitTests/WebSocketJSExecutorTest.cpp delete mode 100644 vnext/Shared/Executors/WebSocketJSExecutor.cpp delete mode 100644 vnext/Shared/Executors/WebSocketJSExecutor.h delete mode 100644 vnext/Shared/Executors/WebSocketJSExecutorFactory.cpp delete mode 100644 vnext/Shared/WebSocketJSExecutorFactory.h diff --git a/.spelling b/.spelling index fe94c2e6c75..3883f148b3d 100644 --- a/.spelling +++ b/.spelling @@ -851,7 +851,6 @@ WDIO WEAKPTR WEAKREFCOUNT weakthis -webdebugger webdriverio webhosthidden Wexceptions diff --git a/docs/inspector.md b/docs/inspector.md index 67ddd7fcbff..6293e154037 100644 --- a/docs/inspector.md +++ b/docs/inspector.md @@ -11,7 +11,6 @@ Hence, we expect most tooling available on other platforms to just work on Windo 1. Initialize React Native Host, - Turn on `DeveloperSupport` - Turn on `FastRefresh` - - Turn off `WebDebugger` - Turn on `Direct Debugging` 2. Ensure Dev-Server is running 3. Start the application diff --git a/packages/@react-native-windows/cli/src/commands/runWindows/runWindows.ts b/packages/@react-native-windows/cli/src/commands/runWindows/runWindows.ts index 6b04c22a09c..7b9d51733fc 100644 --- a/packages/@react-native-windows/cli/src/commands/runWindows/runWindows.ts +++ b/packages/@react-native-windows/cli/src/commands/runWindows/runWindows.ts @@ -56,7 +56,6 @@ function optionSanitizer(key: keyof RunWindowsOptions, value: any): any { case 'singleproc': case 'emulator': case 'device': - case 'remoteDebugging': case 'logging': case 'packager': case 'bundle': diff --git a/packages/@react-native-windows/cli/src/commands/runWindows/runWindowsOptions.ts b/packages/@react-native-windows/cli/src/commands/runWindows/runWindowsOptions.ts index 9fe21ab5af0..37011bbd545 100644 --- a/packages/@react-native-windows/cli/src/commands/runWindows/runWindowsOptions.ts +++ b/packages/@react-native-windows/cli/src/commands/runWindows/runWindowsOptions.ts @@ -40,7 +40,6 @@ export interface RunWindowsOptions { emulator?: boolean; device?: boolean; target?: string; - remoteDebugging?: string; logging?: boolean; packager?: boolean; bundle?: boolean; diff --git a/packages/@react-native-windows/cli/src/e2etest/runWindows.test.ts b/packages/@react-native-windows/cli/src/e2etest/runWindows.test.ts index b6cff845264..23c1f3b0b4e 100644 --- a/packages/@react-native-windows/cli/src/e2etest/runWindows.test.ts +++ b/packages/@react-native-windows/cli/src/e2etest/runWindows.test.ts @@ -25,7 +25,6 @@ function validateOptionName( case 'emulator': case 'device': case 'target': - case 'remoteDebugging': case 'logging': case 'packager': case 'bundle': diff --git a/packages/@react-native-windows/cli/src/utils/deploy.ts b/packages/@react-native-windows/cli/src/utils/deploy.ts index 2b699036454..ccff14a442b 100644 --- a/packages/@react-native-windows/cli/src/utils/deploy.ts +++ b/packages/@react-native-windows/cli/src/utils/deploy.ts @@ -380,9 +380,6 @@ export async function deployToDesktop( const vsVersion = Version.fromString(buildTools.installationVersion); const args = []; - if (options.remoteDebugging) { - args.push('--remote-debugging'); - } if (options.directDebugging) { args.push('--direct-debugging', options.directDebugging.toString()); diff --git a/packages/debug-test/DebuggingFeatures.test.ts b/packages/debug-test/DebuggingFeatures.test.ts index e244c303640..05d5dc10af3 100644 --- a/packages/debug-test/DebuggingFeatures.test.ts +++ b/packages/debug-test/DebuggingFeatures.test.ts @@ -65,7 +65,6 @@ test('debug target properties', async () => { testLog.message(`executing 'debug target properties' on PID ${pid}`); const settings = await PlaygroundDebugSettings.set({ - webDebugger: false, directDebugging: true, jsEngine: 'Hermes', }); @@ -111,7 +110,6 @@ test('enable, disable', async () => { testLog.message(`executing 'enable, disable' test on PID ${pid}`); const settings = await PlaygroundDebugSettings.set({ - webDebugger: false, directDebugging: true, jsEngine: 'Hermes', }); @@ -136,7 +134,6 @@ test('pause, resume', async () => { testLog.message(`executing 'pause, resume' test on PID ${pid}`); const settings = await PlaygroundDebugSettings.set({ - webDebugger: false, directDebugging: true, jsEngine: 'Hermes', }); @@ -199,7 +196,6 @@ test('set, remove breakpoint', async () => { testLog.message(`executing 'set, remove breakpoint' test on PID ${pid}`); const settings = await PlaygroundDebugSettings.set({ - webDebugger: false, directDebugging: true, jsEngine: 'Hermes', }); @@ -246,7 +242,6 @@ test('reload after continue', async () => { testLog.message(`executing 'pause, resume' test on PID ${pid}`); const settings = await PlaygroundDebugSettings.set({ - webDebugger: false, directDebugging: true, jsEngine: 'Hermes', }); @@ -285,7 +280,6 @@ test('execution context identifier in Debugger.scriptParsed event', async () => testLog.message(`executing 'pause, resume' test on PID ${pid}`); const settings = await PlaygroundDebugSettings.set({ - webDebugger: false, directDebugging: true, jsEngine: 'Hermes', }); diff --git a/packages/debug-test/PlaygroundAutomation.ts b/packages/debug-test/PlaygroundAutomation.ts index 5c4ddca5152..127a40d488a 100644 --- a/packages/debug-test/PlaygroundAutomation.ts +++ b/packages/debug-test/PlaygroundAutomation.ts @@ -246,9 +246,6 @@ export async function loadPackage( * Debug settings for the Playground app. */ export type DebugSettings = { - // value representing the "Web Debugger" checkbox - webDebugger?: boolean; - // value representing the "Direct Debugging" checkbox directDebugging?: boolean; @@ -292,9 +289,6 @@ export class PlaygroundDebugSettings { } private async fetchSettings(settings: DebugSettings) { - const webDebugger = await $$(this.webDebuggerCheckBoxSelector).then(a => - a[0].isSelected(), - ); const directDebugging = await $$(this.directDebuggingCheckBoxSelector).then( a => a[0].isSelected(), ); @@ -305,18 +299,12 @@ export class PlaygroundDebugSettings { a[0].getText(), ); - settings.webDebugger = webDebugger; settings.directDebugging = directDebugging; settings.debuggerPort = parseInt(debuggerPort, 10); settings.jsEngine = jsEngine; } private async adjustSettings(settings: DebugSettings) { - // Treating the "Web Debugger" check box special as checking it disables the "Debugger Port" - // edit and the "JS Engine" combo. - const webDebuggerCheckBox = (await $$(this.webDebuggerCheckBoxSelector))[0]; - let restoreWebDebugger = false; - if (settings.directDebugging !== undefined) { const directDebuggingCheckBox = ( await $$(this.directDebuggingCheckBoxSelector) @@ -329,12 +317,6 @@ export class PlaygroundDebugSettings { const currentPortText = await debuggerPortEdit.getText(); if (currentPortText !== settings.debuggerPort.toString()) { - if (await webDebuggerCheckBox.isSelected()) { - // enable port number to be changed - await setCheckedState(webDebuggerCheckBox, false); - restoreWebDebugger = true; // restore it later (unless it should be off per settings) - } - await debuggerPortEdit.setValue(settings.debuggerPort); } } @@ -380,22 +362,11 @@ export class PlaygroundDebugSettings { `no JS engine specified, leaving at current setting ("${oldJsEngine}")`, ); } - - if (settings.webDebugger !== undefined) { - await setCheckedState(webDebuggerCheckBox, settings.webDebugger); - restoreWebDebugger = false; - } - - if (restoreWebDebugger) { - await setCheckedState(webDebuggerCheckBox, true); - } } private readonly oldSettings: DebugSettings = {}; private readonly newSettings: DebugSettings; - private readonly webDebuggerCheckBoxSelector = - './Window/CheckBox[@AutomationId="x_UseWebDebuggerCheckBox"]'; private readonly directDebuggingCheckBoxSelector = './Window/CheckBox[@AutomationId="x_UseDirectDebuggerCheckBox"]'; private readonly debuggerPortEditSelector = diff --git a/packages/e2e-test-app/windows/RNTesterApp/App.xaml.cs b/packages/e2e-test-app/windows/RNTesterApp/App.xaml.cs index 227982cff67..bf42df19c76 100644 --- a/packages/e2e-test-app/windows/RNTesterApp/App.xaml.cs +++ b/packages/e2e-test-app/windows/RNTesterApp/App.xaml.cs @@ -29,12 +29,10 @@ public App() { #if BUNDLE JavaScriptBundleFile = "index.windows"; - InstanceSettings.UseWebDebugger = false; InstanceSettings.UseDirectDebugger = false; InstanceSettings.UseFastRefresh = false; #else JavaScriptBundleFile = "app/index"; - InstanceSettings.UseWebDebugger = false; InstanceSettings.UseDirectDebugger = true; InstanceSettings.UseFastRefresh = true; #endif diff --git a/packages/integration-test-app/windows/integrationtest/App.cpp b/packages/integration-test-app/windows/integrationtest/App.cpp index 031f80279f6..76107205ddf 100644 --- a/packages/integration-test-app/windows/integrationtest/App.cpp +++ b/packages/integration-test-app/windows/integrationtest/App.cpp @@ -23,11 +23,9 @@ using namespace Windows::ApplicationModel; App::App() noexcept { #if BUNDLE JavaScriptBundleFile(L"index.windows"); - InstanceSettings().UseWebDebugger(false); InstanceSettings().UseFastRefresh(false); #else JavaScriptBundleFile(L"index"); - InstanceSettings().UseWebDebugger(true); InstanceSettings().UseFastRefresh(true); #endif diff --git a/packages/playground/CoreApp/App.cpp b/packages/playground/CoreApp/App.cpp index afd6f3d6189..d9c227b73b7 100644 --- a/packages/playground/CoreApp/App.cpp +++ b/packages/playground/CoreApp/App.cpp @@ -52,7 +52,6 @@ int __stdcall wWinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ PWSTR /*server*/ app->componentName = L"RNTesterApp"; app->jsBundleFile = LR"(Samples\rntester)"; app->useDeveloperSupport = true; - app->useWebDebugger = false; #ifdef WITH_MODULES app->packageProvidersAbiCount = 1; diff --git a/packages/playground/CoreApp/app.config.json b/packages/playground/CoreApp/app.config.json index 0266f9f5d34..c2eb53145b0 100644 --- a/packages/playground/CoreApp/app.config.json +++ b/packages/playground/CoreApp/app.config.json @@ -4,7 +4,6 @@ // the path to the JS bundle, relative to bundleRootPath. Default value: "index.windows" "jsBundleFile": "Samples\\rntester", // "bundleRootPath": "ms-appx:///Bundle/", - "useWebDebugger": false, // "useFastRefresh": true, "useDeveloperSupport": true, // "useDirectDebugger": false, diff --git a/packages/playground/windows/playground-composition/Playground-Composition.cpp b/packages/playground/windows/playground-composition/Playground-Composition.cpp index 27742ede58f..4ecab3329c9 100644 --- a/packages/playground/windows/playground-composition/Playground-Composition.cpp +++ b/packages/playground/windows/playground-composition/Playground-Composition.cpp @@ -54,7 +54,7 @@ winrt::Windows::UI::Composition::Compositor g_compositor{nullptr}; constexpr auto WindowDataProperty = L"WindowData"; -int RunPlayground(int showCmd, bool useWebDebugger); +int RunPlayground(int showCmd); winrt::Microsoft::ReactNative::IReactPackageProvider CreateStubDeviceInfoPackageProvider() noexcept; struct WindowData { @@ -250,7 +250,7 @@ struct WindowData { std::thread playgroundThread{([]() { // For subsequent RN windows do not use the web debugger by default, // since one instance can be connected to it at a time. - RunPlayground(SW_SHOW, false); + RunPlayground(SW_SHOW); })}; playgroundThread.detach(); break; @@ -497,7 +497,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) constexpr PCWSTR c_windowClassName = L"MS_REACTNATIVE_PLAYGROUND_COMPOSITION"; -int RunPlayground(int showCmd, bool useWebDebugger) { +int RunPlayground(int showCmd) { constexpr PCWSTR appName = L"React Native Playground (Composition)"; auto windowData = std::make_unique(); @@ -574,5 +574,5 @@ _Use_decl_annotations_ int CALLBACK WinMain(HINSTANCE instance, HINSTANCE, PSTR auto playgroundApp{winrt::make()}; #endif - return RunPlayground(showCmd, false); + return RunPlayground(showCmd); } diff --git a/packages/playground/windows/playground-win32/Playground-Win32.cpp b/packages/playground/windows/playground-win32/Playground-Win32.cpp index a3c45b43f68..c888b8d94f8 100644 --- a/packages/playground/windows/playground-win32/Playground-Win32.cpp +++ b/packages/playground/windows/playground-win32/Playground-Win32.cpp @@ -42,7 +42,7 @@ namespace hosting = xaml::Hosting; constexpr auto WindowDataProperty = L"WindowData"; -int RunPlayground(int showCmd, bool useWebDebugger); +int RunPlayground(int showCmd); HWND GetXamlIslandHwnd(const hosting::DesktopWindowXamlSource &dwxs) { auto interop = dwxs.as(); @@ -63,7 +63,6 @@ struct WindowData { winrt::Microsoft::ReactNative::ReactNativeHost m_host{nullptr}; winrt::Microsoft::ReactNative::ReactInstanceSettings m_instanceSettings{nullptr}; - bool m_useWebDebugger{false}; bool m_fastRefreshEnabled{true}; bool m_useDirectDebugger{true}; bool m_breakOnNextLine{false}; @@ -115,7 +114,6 @@ struct WindowData { host.InstanceSettings().JavaScriptBundleFile(m_bundleFile); - host.InstanceSettings().UseWebDebugger(m_useWebDebugger); host.InstanceSettings().UseDirectDebugger(m_useDirectDebugger); host.InstanceSettings().BundleRootPath( std::wstring(L"file:").append(workingDir).append(L"\\Bundle\\").c_str()); @@ -156,7 +154,7 @@ struct WindowData { std::thread playgroundThread{([]() { // For subsequent RN windows do not use the web debugger by default, // since one instance can be connected to it at a time. - RunPlayground(SW_SHOW, false); + RunPlayground(SW_SHOW); })}; playgroundThread.detach(); break; @@ -271,7 +269,6 @@ struct WindowData { case WM_INITDIALOG: { auto boolToCheck = [](bool b) { return b ? BST_CHECKED : BST_UNCHECKED; }; auto self = reinterpret_cast(lparam); - CheckDlgButton(hwnd, IDC_WEBDEBUGGER, boolToCheck(self->m_useWebDebugger)); CheckDlgButton(hwnd, IDC_FASTREFRESH, boolToCheck(self->m_fastRefreshEnabled)); CheckDlgButton(hwnd, IDC_DIRECTDEBUGGER, boolToCheck(self->m_useDirectDebugger)); CheckDlgButton(hwnd, IDC_BREAKONNEXTLINE, boolToCheck(self->m_breakOnNextLine)); @@ -298,7 +295,6 @@ struct WindowData { switch (LOWORD(wparam)) { case IDOK: { auto self = GetFromWindow(GetParent(hwnd)); - self->m_useWebDebugger = IsDlgButtonChecked(hwnd, IDC_WEBDEBUGGER) == BST_CHECKED; self->m_fastRefreshEnabled = IsDlgButtonChecked(hwnd, IDC_FASTREFRESH) == BST_CHECKED; self->m_useDirectDebugger = IsDlgButtonChecked(hwnd, IDC_DIRECTDEBUGGER) == BST_CHECKED; self->m_breakOnNextLine = IsDlgButtonChecked(hwnd, IDC_BREAKONNEXTLINE) == BST_CHECKED; @@ -382,7 +378,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) constexpr PCWSTR c_windowClassName = L"MS_REACTNATIVE_PLAYGROUND_WIN32"; -int RunPlayground(int showCmd, bool useWebDebugger) { +int RunPlayground(int showCmd) { #ifdef USE_WINUI3 constexpr PCWSTR appName = L"React Native Playground (Win32 WinUI3)"; #else @@ -401,7 +397,6 @@ int RunPlayground(int showCmd, bool useWebDebugger) { hosting::DesktopWindowXamlSource desktopXamlSource; auto windowData = std::make_unique(desktopXamlSource); - windowData->m_useWebDebugger = useWebDebugger; // We have to use a XAML string here to access the ThemeResource. // XAML Islands requires us to set the background color to handle theme changes. @@ -474,5 +469,5 @@ _Use_decl_annotations_ int CALLBACK WinMain(HINSTANCE instance, HINSTANCE, PSTR WINRT_VERIFY(classId); winrt::check_win32(!classId); - return RunPlayground(showCmd, false); + return RunPlayground(showCmd); } diff --git a/packages/playground/windows/playground-win32/Playground-Win32.rc b/packages/playground/windows/playground-win32/Playground-Win32.rc index 0711c9366e3..1e850ae6c8a 100644 --- a/packages/playground/windows/playground-win32/Playground-Win32.rc +++ b/packages/playground/windows/playground-win32/Playground-Win32.rc @@ -105,7 +105,6 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSM CAPTION "Settings" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - CONTROL "&Web Debugger",IDC_WEBDEBUGGER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,8,104,10 CONTROL "&Fast Refresh",IDC_FASTREFRESH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,26,104,10 CONTROL "&Direct Debugger",IDC_DIRECTDEBUGGER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,44,104,10 CONTROL "&Break On Next Line",IDC_BREAKONNEXTLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,63,104,10 diff --git a/packages/playground/windows/playground-win32/resource.h b/packages/playground/windows/playground-win32/resource.h index 299b28f671a..de62a0c6e33 100644 --- a/packages/playground/windows/playground-win32/resource.h +++ b/packages/playground/windows/playground-win32/resource.h @@ -4,7 +4,6 @@ // #define IDC_PLAYGROUND_WIN32 100 #define IDD_ABOUTBOX 100 -#define IDC_WEBDEBUGGER 100 #define IDC_JSBUNDLELIST 100 #define IDM_ABOUT 100 #define IDD_SETTINGSBOX 101 diff --git a/packages/playground/windows/playground/MainPage.cpp b/packages/playground/windows/playground/MainPage.cpp index f51565816a9..dcd4809def0 100644 --- a/packages/playground/windows/playground/MainPage.cpp +++ b/packages/playground/windows/playground/MainPage.cpp @@ -69,7 +69,6 @@ void MainPage::OnLoadClick( ReactRootView().ReactNativeHost(host); host.InstanceSettings().UseDeveloperSupport(true); - host.InstanceSettings().UseWebDebugger(x_UseWebDebuggerCheckBox().IsChecked().GetBoolean()); host.InstanceSettings().UseDirectDebugger(x_UseDirectDebuggerCheckBox().IsChecked().GetBoolean()); host.InstanceSettings().DebuggerBreakOnNextLine(x_BreakOnFirstLineCheckBox().IsChecked().GetBoolean()); host.InstanceSettings().UseFastRefresh(x_UseFastRefreshCheckBox().IsChecked().GetBoolean()); @@ -86,35 +85,31 @@ void MainPage::OnLoadClick( } } - host.InstanceSettings().InstanceCreated([wkThis = get_weak()]( - auto sender, - winrt::Microsoft::ReactNative::InstanceCreatedEventArgs args) { - if (auto strongThis = wkThis.get()) { - args.Context().UIDispatcher().Post([wkThis, context = args.Context()]() { + host.InstanceSettings().InstanceCreated( + [wkThis = get_weak()](auto sender, winrt::Microsoft::ReactNative::InstanceCreatedEventArgs args) { if (auto strongThis = wkThis.get()) { - strongThis->x_UseWebDebuggerCheckBox().IsChecked(context.SettingsSnapshot().UseWebDebugger()); - strongThis->x_UseFastRefreshCheckBox().IsChecked(context.SettingsSnapshot().UseFastRefresh()); - strongThis->x_UseDirectDebuggerCheckBox().IsChecked(context.SettingsSnapshot().UseDirectDebugger()); - strongThis->x_BreakOnFirstLineCheckBox().IsChecked(context.SettingsSnapshot().DebuggerBreakOnNextLine()); - auto debugBundlePath = context.SettingsSnapshot().DebugBundlePath(); - for (auto item : strongThis->x_entryPointCombo().Items()) { - if (winrt::unbox_value(item.as().Content()) == debugBundlePath) { - strongThis->x_entryPointCombo().SelectedItem(item); - break; + args.Context().UIDispatcher().Post([wkThis, context = args.Context()]() { + if (auto strongThis = wkThis.get()) { + strongThis->x_UseFastRefreshCheckBox().IsChecked(context.SettingsSnapshot().UseFastRefresh()); + strongThis->x_UseDirectDebuggerCheckBox().IsChecked(context.SettingsSnapshot().UseDirectDebugger()); + strongThis->x_BreakOnFirstLineCheckBox().IsChecked(context.SettingsSnapshot().DebuggerBreakOnNextLine()); + auto debugBundlePath = context.SettingsSnapshot().DebugBundlePath(); + for (auto item : strongThis->x_entryPointCombo().Items()) { + if (winrt::unbox_value(item.as().Content()) == debugBundlePath) { + strongThis->x_entryPointCombo().SelectedItem(item); + break; + } + } + strongThis->x_DebuggerPort().Text(winrt::to_hstring(context.SettingsSnapshot().DebuggerPort())); + if (strongThis->RequestedTheme() == xaml::ElementTheme::Light) { + xaml::Window::Current().Content().as().RequestedTheme( + xaml::ElementTheme::Default); + strongThis->x_themeDefault().IsSelected(true); + } } - } - strongThis->x_DebuggerPort().Text(winrt::to_hstring(context.SettingsSnapshot().DebuggerPort())); - if (context.SettingsSnapshot().UseWebDebugger()) { - xaml::Window::Current().Content().as().RequestedTheme(xaml::ElementTheme::Light); - strongThis->x_themeLight().IsSelected(true); - } else if (strongThis->RequestedTheme() == xaml::ElementTheme::Light) { - xaml::Window::Current().Content().as().RequestedTheme(xaml::ElementTheme::Default); - strongThis->x_themeDefault().IsSelected(true); - } + }); } }); - } - }); // Nudge the ReactNativeHost to create the instance and wrapping context host.ReloadInstance(); } @@ -142,34 +137,6 @@ void winrt::playground::implementation::MainPage::x_entryPointCombo_SelectionCha } } -void winrt::playground::implementation::MainPage::x_UseWebDebuggerCheckBox_Checked( - winrt::Windows::Foundation::IInspectable const & /*sender*/, - winrt::Windows::Foundation::IInspectable const & /*e*/) { - if (x_JsEngine()) { - x_JsEngine().IsEnabled(false); - } - if (x_DebuggerPort()) { - x_DebuggerPort().IsEnabled(false); - } - if (x_BreakOnFirstLineCheckBox()) { - x_BreakOnFirstLineCheckBox().IsEnabled(false); - } -} - -void winrt::playground::implementation::MainPage::x_UseWebDebuggerCheckBox_Unchecked( - winrt::Windows::Foundation::IInspectable const & /*sender*/, - winrt::Windows::Foundation::IInspectable const & /*e*/) { - if (x_JsEngine()) { - x_JsEngine().IsEnabled(true); - } - if (x_DebuggerPort()) { - x_DebuggerPort().IsEnabled(true); - } - if (x_BreakOnFirstLineCheckBox()) { - x_BreakOnFirstLineCheckBox().IsEnabled(true); - } -} - void winrt::playground::implementation::MainPage::x_Theme_SelectionChanged( winrt::Windows::Foundation::IInspectable const &, xaml::Controls::SelectionChangedEventArgs const &) { diff --git a/packages/playground/windows/playground/MainPage.h b/packages/playground/windows/playground/MainPage.h index 76312129542..0ecd02a8124 100644 --- a/packages/playground/windows/playground/MainPage.h +++ b/packages/playground/windows/playground/MainPage.h @@ -23,12 +23,6 @@ struct MainPage : MainPageT { void x_entryPointCombo_SelectionChanged( winrt::Windows::Foundation::IInspectable const &sender, xaml::Controls::SelectionChangedEventArgs const &e); - void x_UseWebDebuggerCheckBox_Checked( - winrt::Windows::Foundation::IInspectable const &sender, - winrt::Windows::Foundation::IInspectable const &e); - void x_UseWebDebuggerCheckBox_Unchecked( - winrt::Windows::Foundation::IInspectable const &sender, - winrt::Windows::Foundation::IInspectable const &e); void x_Theme_SelectionChanged( winrt::Windows::Foundation::IInspectable const &sender, xaml::Controls::SelectionChangedEventArgs const &e); diff --git a/packages/playground/windows/playground/MainPage.xaml b/packages/playground/windows/playground/MainPage.xaml index b054ab8b379..8f24c8e9796 100644 --- a/packages/playground/windows/playground/MainPage.xaml +++ b/packages/playground/windows/playground/MainPage.xaml @@ -120,13 +120,6 @@ Orientation="Horizontal" BorderThickness="1,0,0,0" BorderBrush="{ThemeResource SystemBaseMediumColor}"> - - diff --git a/vnext/Desktop.UnitTests/React.Windows.Desktop.UnitTests.vcxproj.filters b/vnext/Desktop.UnitTests/React.Windows.Desktop.UnitTests.vcxproj.filters index dd412b1b311..8589d630808 100644 --- a/vnext/Desktop.UnitTests/React.Windows.Desktop.UnitTests.vcxproj.filters +++ b/vnext/Desktop.UnitTests/React.Windows.Desktop.UnitTests.vcxproj.filters @@ -31,9 +31,6 @@ Unit Tests - - Unit Tests - Unit Tests diff --git a/vnext/Desktop.UnitTests/WebSocketJSExecutorTest.cpp b/vnext/Desktop.UnitTests/WebSocketJSExecutorTest.cpp deleted file mode 100644 index 3383158aac7..00000000000 --- a/vnext/Desktop.UnitTests/WebSocketJSExecutorTest.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -#include -#include - -using namespace Microsoft::ReactNative; -using namespace Microsoft::VisualStudio::CppUnitTestFramework; - -namespace Microsoft::React::Test { - -// We turn clang format off here because it does not work with some of the -// test macros. -// clang-format off - -TEST_CLASS(WebSocketJSExecutorTest) { - TEST_METHOD(WebSocketJSExecutorTest_Instantiate){ - auto wsje = std::make_shared(nullptr, nullptr); - Assert::IsFalse(nullptr == wsje); - } -}; - -// clang-format on - -} // namespace Microsoft::React::Test diff --git a/vnext/IntegrationTests/TestRunner.cpp b/vnext/IntegrationTests/TestRunner.cpp index f2fe695d498..d8b32567575 100644 --- a/vnext/IntegrationTests/TestRunner.cpp +++ b/vnext/IntegrationTests/TestRunner.cpp @@ -85,7 +85,6 @@ TestResult TestRunner::RunTest(string &&bundlePath, string &&appName, NativeLogg // Note, further configuration should be done in each Windows variant's // TestRunner implementation. shared_ptr devSettings = make_shared(); - devSettings->useWebDebugger = GetRuntimeOptionBool("RNTester.UseWebDebugger"); devSettings->liveReloadCallback = []() {}; // Enables ChakraExecutor devSettings->errorCallback = [&result](string message) { result.Message = Microsoft::Common::Unicode::Utf8ToUtf16(message); diff --git a/vnext/Microsoft.ReactNative.Cxx.UnitTests/ReactContextTest.cpp b/vnext/Microsoft.ReactNative.Cxx.UnitTests/ReactContextTest.cpp index 059a6f83ccf..c9129200a9f 100644 --- a/vnext/Microsoft.ReactNative.Cxx.UnitTests/ReactContextTest.cpp +++ b/vnext/Microsoft.ReactNative.Cxx.UnitTests/ReactContextTest.cpp @@ -79,10 +79,6 @@ struct ReactContextStub : implements { VerifyElseCrashSz(false, "Not implemented"); } - bool UseWebDebugger() noexcept { - VerifyElseCrashSz(false, "Not implemented"); - } - hstring DebugBundlePath() noexcept { VerifyElseCrashSz(false, "Not implemented"); } diff --git a/vnext/Microsoft.ReactNative.Cxx.UnitTests/ReactModuleBuilderMock.h b/vnext/Microsoft.ReactNative.Cxx.UnitTests/ReactModuleBuilderMock.h index 708a18c0030..abe35e02330 100644 --- a/vnext/Microsoft.ReactNative.Cxx.UnitTests/ReactModuleBuilderMock.h +++ b/vnext/Microsoft.ReactNative.Cxx.UnitTests/ReactModuleBuilderMock.h @@ -166,10 +166,6 @@ struct ReactContextMock : implements { VerifyElseCrashSz(false, "Not implemented"); } - bool UseWebDebugger() noexcept { - VerifyElseCrashSz(false, "Not implemented"); - } - hstring DebugBundlePath() noexcept { VerifyElseCrashSz(false, "Not implemented"); } diff --git a/vnext/Microsoft.ReactNative.Cxx/CoreApp.h b/vnext/Microsoft.ReactNative.Cxx/CoreApp.h index a443c5c500c..ebb5ddc36ed 100644 --- a/vnext/Microsoft.ReactNative.Cxx/CoreApp.h +++ b/vnext/Microsoft.ReactNative.Cxx/CoreApp.h @@ -10,8 +10,6 @@ struct RNCoreApp { /// Provide the name of your React component here wchar_t const *componentName; - /// default value: true - bool useWebDebugger; /// default value: true bool useFastRefresh; /// default value: true diff --git a/vnext/Microsoft.ReactNative.IntegrationTests/TestReactNativeHostHolder.cpp b/vnext/Microsoft.ReactNative.IntegrationTests/TestReactNativeHostHolder.cpp index 5c78991b2f8..7959fb0c78c 100644 --- a/vnext/Microsoft.ReactNative.IntegrationTests/TestReactNativeHostHolder.cpp +++ b/vnext/Microsoft.ReactNative.IntegrationTests/TestReactNativeHostHolder.cpp @@ -64,7 +64,6 @@ TestReactNativeHostHolder::TestReactNativeHostHolder( m_host.InstanceSettings().BundleRootPath(testBinaryPath); m_host.InstanceSettings().JavaScriptBundleFile(jsBundle); m_host.InstanceSettings().UseDeveloperSupport(false); - m_host.InstanceSettings().UseWebDebugger(false); m_host.InstanceSettings().UseFastRefresh(false); m_host.InstanceSettings().UseLiveReload(false); m_host.InstanceSettings().EnableDeveloperMenu(false); diff --git a/vnext/Microsoft.ReactNative.Managed.IntegrationTests/TestReactNativeHostHolder.cs b/vnext/Microsoft.ReactNative.Managed.IntegrationTests/TestReactNativeHostHolder.cs index 9dce49ac373..65e3bd60f56 100644 --- a/vnext/Microsoft.ReactNative.Managed.IntegrationTests/TestReactNativeHostHolder.cs +++ b/vnext/Microsoft.ReactNative.Managed.IntegrationTests/TestReactNativeHostHolder.cs @@ -36,7 +36,6 @@ public TestReactNativeHostHolder(string jsBundle, Action hostIn Host.InstanceSettings.BundleRootPath = Path.GetFullPath(testBinaryPath + "\\..\\JSBundles"); Host.InstanceSettings.JavaScriptBundleFile = jsBundle; Host.InstanceSettings.UseDeveloperSupport = false; - Host.InstanceSettings.UseWebDebugger = false; Host.InstanceSettings.UseFastRefresh = false; Host.InstanceSettings.UseDeveloperSupport = false; diff --git a/vnext/Microsoft.ReactNative.Managed.UnitTests/ReactModuleBuilderMock.cs b/vnext/Microsoft.ReactNative.Managed.UnitTests/ReactModuleBuilderMock.cs index b324c203636..a762eb81c1b 100644 --- a/vnext/Microsoft.ReactNative.Managed.UnitTests/ReactModuleBuilderMock.cs +++ b/vnext/Microsoft.ReactNative.Managed.UnitTests/ReactModuleBuilderMock.cs @@ -311,8 +311,6 @@ class ReactSettingsSnapshot : IReactSettingsSnapshot public bool UseFastRefresh => throw new NotImplementedException(); - public bool UseWebDebugger => throw new NotImplementedException(); - public string BundleRootPath => throw new NotImplementedException(); public string DebugBundlePath => throw new NotImplementedException(); diff --git a/vnext/Microsoft.ReactNative.Managed/ReactSettingsSnapshot.cs b/vnext/Microsoft.ReactNative.Managed/ReactSettingsSnapshot.cs index 2fdbe7a3ee6..495fb41bf59 100644 --- a/vnext/Microsoft.ReactNative.Managed/ReactSettingsSnapshot.cs +++ b/vnext/Microsoft.ReactNative.Managed/ReactSettingsSnapshot.cs @@ -30,8 +30,6 @@ public struct ReactSettingsSnapshot public bool UseFastRefresh => IsValid ? Handle.UseFastRefresh : false; - public bool UseWebDebugger => IsValid ? Handle.UseWebDebugger : false; - public bool RequestDevBundle => IsValid ? Handle.RequestDevBundle : true; public IReactSettingsSnapshot Handle { get; } diff --git a/vnext/Microsoft.ReactNative/CoreApp.cpp b/vnext/Microsoft.ReactNative/CoreApp.cpp index 1f4eb5b5e10..65e1dc1d71f 100644 --- a/vnext/Microsoft.ReactNative/CoreApp.cpp +++ b/vnext/Microsoft.ReactNative/CoreApp.cpp @@ -22,7 +22,6 @@ void RNCoreAppSetDefaults(RNCoreApp *appSettings) { appSettings->jsBundleFile = L"index.windows"; appSettings->bundleRootPath = L"ms-appx:///Bundle/"; appSettings->componentName = L""; - appSettings->useWebDebugger = true; appSettings->useFastRefresh = true; appSettings->useDeveloperSupport = true; appSettings->useDirectDebugger = false; @@ -84,7 +83,6 @@ NORETURN void RNCoreAppStartInternal(RNCoreApp *appSettings, RNCoreAppCallback l settings.BundleRootPath(appSettings->bundleRootPath); - settings.UseWebDebugger(appSettings->useWebDebugger); settings.UseFastRefresh(appSettings->useFastRefresh); settings.UseDeveloperSupport(appSettings->useDeveloperSupport); settings.UseDirectDebugger(appSettings->useDirectDebugger); @@ -276,7 +274,6 @@ extern "C" NORETURN void __cdecl RNCoreAppStartFromConfigJson( SET_FROM_JSON(jsBundleFile); SET_FROM_JSON(bundleRootPath); SET_FROM_JSON(componentName); - SET_FROM_JSON(useWebDebugger); SET_FROM_JSON(useFastRefresh); SET_FROM_JSON(useDeveloperSupport); SET_FROM_JSON(useDirectDebugger); diff --git a/vnext/Microsoft.ReactNative/DevMenuControl.idl b/vnext/Microsoft.ReactNative/DevMenuControl.idl index 7e3ddc43ce9..60f9412aab3 100644 --- a/vnext/Microsoft.ReactNative/DevMenuControl.idl +++ b/vnext/Microsoft.ReactNative/DevMenuControl.idl @@ -14,11 +14,8 @@ namespace Microsoft.ReactNative XAML_NAMESPACE.Controls.Button BreakOnNextLine { get; }; XAML_NAMESPACE.Controls.Button DirectDebug { get; }; - XAML_NAMESPACE.Controls.Button RemoteDebug { get; }; XAML_NAMESPACE.Controls.Button Reload { get; }; - XAML_NAMESPACE.Controls.TextBlock RemoteDebugText { get; }; - XAML_NAMESPACE.Controls.TextBlock RemoteDebugDesc { get; }; XAML_NAMESPACE.Controls.TextBlock FastRefreshText { get; }; XAML_NAMESPACE.Controls.TextBlock DirectDebugText { get; }; XAML_NAMESPACE.Controls.TextBlock DirectDebugDesc { get; }; diff --git a/vnext/Microsoft.ReactNative/DevMenuControl.xaml b/vnext/Microsoft.ReactNative/DevMenuControl.xaml index 873b66aaa17..3fc9b868394 100644 --- a/vnext/Microsoft.ReactNative/DevMenuControl.xaml +++ b/vnext/Microsoft.ReactNative/DevMenuControl.xaml @@ -50,21 +50,7 @@ Restarts the JS instance. Any javascript state will be lost. - +