Skip to content

Commit

Permalink
[dev-server] fix debugger pause from devtools startup (#21807)
Browse files Browse the repository at this point in the history
# Why

close ENG-7631

# How

this is a side effect of #21265 where we enable full feature devtools. the `Debugger.pause` events are sent by devtools frontend: https://github.com/ChromeDevTools/devtools-frontend/blob/e0d743c4f184589db10fb1d276b87dbe90498077/front_end/entrypoints/inspector_main/InspectorMain.ts#L62-L97. we reached the `waitForDebuggerInPage===true` case and then devtools frontend calls `debuggerModel.pause()`.

to skip the call path, we could either set `targetType=tab` or not set `panel=sources`. i am kinda afraid to change targetType which may cause other side effects, so to change the panel instead. with this pr, the initial devtools tab would be the "console" tab.

# Test Plan

bare-expo + devtools + sending js `fetch` call
  • Loading branch information
Kudo committed Mar 22, 2023
1 parent 9160af5 commit 80135d2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/@expo/dev-server/build/JsInspector.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/@expo/dev-server/build/JsInspector.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/@expo/dev-server/src/JsInspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function openJsInspector(app: MetroInspectorProxyApp) {

const urlBase = `https://chrome-devtools-frontend.appspot.com/serve_rev/@${devtoolsFrontendRev}/devtools_app.html`;
const ws = app.webSocketDebuggerUrl.replace(/^ws:\/\//, '');
const url = `${urlBase}?panel=sources&ws=${encodeURIComponent(ws)}`;
const url = `${urlBase}?panel=console&ws=${encodeURIComponent(ws)}`;
await closeJsInspector();
openingBrowserInstance = await launchBrowserAsync(url);
}
Expand Down

0 comments on commit 80135d2

Please sign in to comment.