Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove web debugging support #12721

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,6 @@ WDIO
WEAKPTR
WEAKREFCOUNT
weakthis
webdebugger
webdriverio
webhosthidden
Wexceptions
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Remove WebDebugging support",
"packageName": "@react-native-windows/cli",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Remove WebDebugging support",
"packageName": "react-native-windows",
"email": "[email protected]",
"dependentChangeType": "patch"
}
1 change: 0 additions & 1 deletion docs/inspector.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export interface RunWindowsOptions {
emulator?: boolean;
device?: boolean;
target?: string;
remoteDebugging?: string;
logging?: boolean;
packager?: boolean;
bundle?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ function validateOptionName(
case 'emulator':
case 'device':
case 'target':
case 'remoteDebugging':
case 'logging':
case 'packager':
case 'bundle':
Expand Down
3 changes: 0 additions & 3 deletions packages/@react-native-windows/cli/src/utils/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
6 changes: 0 additions & 6 deletions packages/debug-test/DebuggingFeatures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
Expand Down Expand Up @@ -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',
});
Expand All @@ -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',
});
Expand Down Expand Up @@ -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',
});
Expand Down Expand Up @@ -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',
});
Expand Down Expand Up @@ -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',
});
Expand Down
29 changes: 0 additions & 29 deletions packages/debug-test/PlaygroundAutomation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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(),
);
Expand All @@ -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)
Expand All @@ -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);
}
}
Expand Down Expand Up @@ -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 =
Expand Down
2 changes: 0 additions & 2 deletions packages/e2e-test-app/windows/RNTesterApp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion packages/playground/CoreApp/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion packages/playground/CoreApp/app.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<WindowData>();
Expand Down Expand Up @@ -574,5 +574,5 @@ _Use_decl_annotations_ int CALLBACK WinMain(HINSTANCE instance, HINSTANCE, PSTR
auto playgroundApp{winrt::make<winrt::Playground::implementation::App>()};
#endif

return RunPlayground(showCmd, false);
return RunPlayground(showCmd);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<IDesktopWindowXamlSourceNative>();
Expand All @@ -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};
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -271,7 +269,6 @@ struct WindowData {
case WM_INITDIALOG: {
auto boolToCheck = [](bool b) { return b ? BST_CHECKED : BST_UNCHECKED; };
auto self = reinterpret_cast<WindowData *>(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));
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -401,7 +397,6 @@ int RunPlayground(int showCmd, bool useWebDebugger) {

hosting::DesktopWindowXamlSource desktopXamlSource;
auto windowData = std::make_unique<WindowData>(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.
Expand Down Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion packages/playground/windows/playground-win32/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading