mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 01:38:07 +08:00
This CL fixes an issue where one or both of the two instances of the DOM breakpoints pane (in Sources and Elements) fail to update when a breakpoint is hit. There's a video in the linked bug showing more specific repro steps, but the issue stems from three different extensions in browser_debugger.json that reference DOMBreakpointsSidebarPane: two views and a ContextFlavorListener. Unlike every other view in the devtools, these ones define a factoryName rather than a className. This makes the devtools create separate instances for each rather than using runtime.sharedInstance(), which breaks UI.Context._dispatchFlavorChange(), which does rely on runtime.sharedInstance(). In order to make _dispatchFlavorChange() work properly with both the Elements and Sources panel views, I replaced their factoryNames with classNames, i.e. made them share an instance. Some minor changes to ContainerWidget and _ExpandableContainerWidget were needed to make sure the shared instance actually shows up where needed, but everything now works as expected. An alternative would be to rework Extension.instance() and ContextFlavorListener, but that seems more invasive. Bug: 973251 Change-Id: I288dea794518605f8f93c28c7826372dbaea2e1f Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1984805 Commit-Queue: Jack Lynch <jalyn@microsoft.com> Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
135 lines
4.3 KiB
JSON
135 lines
4.3 KiB
JSON
{
|
|
"extensions": [
|
|
{
|
|
"type": "view",
|
|
"location": "sources.sidebar-bottom",
|
|
"id": "sources.eventListenerBreakpoints",
|
|
"title": "Event Listener Breakpoints",
|
|
"order": 9,
|
|
"persistence": "permanent",
|
|
"className": "BrowserDebugger.EventListenerBreakpointsSidebarPane"
|
|
},
|
|
{
|
|
"type": "@UI.ContextFlavorListener",
|
|
"contextTypes": [
|
|
"SDK.DebuggerPausedDetails"
|
|
],
|
|
"className": "BrowserDebugger.XHRBreakpointsSidebarPane"
|
|
},
|
|
{
|
|
"type": "view",
|
|
"location": "sources.sidebar-bottom",
|
|
"id": "sources.xhrBreakpoints",
|
|
"title": "XHR/fetch Breakpoints",
|
|
"order": 5,
|
|
"hasToolbar": true,
|
|
"persistence": "permanent",
|
|
"className": "BrowserDebugger.XHRBreakpointsSidebarPane"
|
|
},
|
|
{
|
|
"type": "view",
|
|
"location": "sources.sidebar-bottom",
|
|
"id": "sources.domBreakpoints",
|
|
"title": "DOM Breakpoints",
|
|
"order": 7,
|
|
"persistence": "permanent",
|
|
"className": "BrowserDebugger.DOMBreakpointsSidebarPane"
|
|
},
|
|
{
|
|
"type": "view",
|
|
"location": "elements-sidebar",
|
|
"id": "elements.domBreakpoints",
|
|
"title": "DOM Breakpoints",
|
|
"order": 6,
|
|
"persistence": "permanent",
|
|
"className": "BrowserDebugger.DOMBreakpointsSidebarPane"
|
|
},
|
|
{
|
|
"type": "@Elements.MarkerDecorator",
|
|
"factoryName": "Elements.GenericDecorator",
|
|
"marker": "breakpoint-marker",
|
|
"title": "DOM Breakpoint",
|
|
"color": "rgb(105, 140, 254)"
|
|
},
|
|
{
|
|
"type": "@UI.ContextMenu.Provider",
|
|
"contextTypes": [
|
|
"SDK.DOMNode"
|
|
],
|
|
"className": "BrowserDebugger.DOMBreakpointsSidebarPane.ContextMenuProvider"
|
|
},
|
|
{
|
|
"type": "@UI.ContextFlavorListener",
|
|
"contextTypes": [
|
|
"SDK.DebuggerPausedDetails"
|
|
],
|
|
"className": "BrowserDebugger.DOMBreakpointsSidebarPane"
|
|
},
|
|
{
|
|
"type": "view",
|
|
"location": "sources.sidebar-bottom",
|
|
"id": "sources.globalListeners",
|
|
"title": "Global Listeners",
|
|
"order": 8,
|
|
"hasToolbar": true,
|
|
"persistence": "permanent",
|
|
"className": "BrowserDebugger.ObjectEventListenersSidebarPane"
|
|
},
|
|
{
|
|
"type": "view",
|
|
"location": "navigator-view",
|
|
"id": "navigator-network",
|
|
"title": "Page",
|
|
"order": 2,
|
|
"persistence": "permanent",
|
|
"className": "Sources.NetworkNavigatorView"
|
|
},
|
|
{
|
|
"type": "view",
|
|
"location": "navigator-view",
|
|
"id": "navigator-overrides",
|
|
"title": "Overrides",
|
|
"order": 4,
|
|
"persistence": "permanent",
|
|
"className": "Sources.OverridesNavigatorView"
|
|
},
|
|
{
|
|
"type": "view",
|
|
"location": "navigator-view",
|
|
"id": "navigator-contentScripts",
|
|
"title": "Content scripts",
|
|
"order": 5,
|
|
"persistence": "permanent",
|
|
"className": "Sources.ContentScriptsNavigatorView"
|
|
},
|
|
{
|
|
"type": "@Sources.NavigatorView",
|
|
"viewId": "navigator-overrides",
|
|
"className": "Sources.OverridesNavigatorView"
|
|
},
|
|
{
|
|
"type": "@Sources.NavigatorView",
|
|
"viewId": "navigator-contentScripts",
|
|
"className": "Sources.ContentScriptsNavigatorView"
|
|
}
|
|
],
|
|
"dependencies": [
|
|
"elements",
|
|
"sources",
|
|
"console"
|
|
],
|
|
"modules": [
|
|
"browser_debugger.js",
|
|
"browser_debugger-legacy.js",
|
|
"DOMBreakpointsSidebarPane.js",
|
|
"EventListenerBreakpointsSidebarPane.js",
|
|
"ObjectEventListenersSidebarPane.js",
|
|
"XHRBreakpointsSidebarPane.js"
|
|
],
|
|
"resources": [
|
|
"domBreakpointsSidebarPane.css",
|
|
"eventListenerBreakpoints.css",
|
|
"xhrBreakpointsSidebarPane.css"
|
|
]
|
|
}
|