From 65a3e3590aff2f287c669172856512d6b29bd37f Mon Sep 17 00:00:00 2001 From: emily-shen <69125074+emily-shen@users.noreply.github.com> Date: Thu, 9 Jan 2025 13:15:59 +0000 Subject: [PATCH] chore: update devtools patches (#7693) * update patches * add "make dev" * changeset --- .changeset/red-pillows-provide.md | 5 +++++ packages/chrome-devtools-patches/Makefile | 7 ++++++- ...ser-support-make-it-work-in-Firefox-Safar.patch | 10 +++++----- ...002-Setup-Cloudflare-devtools-target-type.patch | 2 +- ...-improve-connection-stability.-Without-th.patch | 2 +- ...wing-source-files-over-the-network.-This-.patch | 14 +++++++------- ...cing-the-devtools-theme-via-a-query-param.patch | 2 +- .../patches/0006-All-about-the-network-tab.patch | 10 +++++----- ...0007-Limit-heap-profiling-modes-available.patch | 2 +- ...ker-name-as-the-title-for-the-Javascript-.patch | 2 +- 10 files changed, 33 insertions(+), 23 deletions(-) create mode 100644 .changeset/red-pillows-provide.md diff --git a/.changeset/red-pillows-provide.md b/.changeset/red-pillows-provide.md new file mode 100644 index 000000000000..78589c191409 --- /dev/null +++ b/.changeset/red-pillows-provide.md @@ -0,0 +1,5 @@ +--- +"@cloudflare/chrome-devtools-patches": patch +--- + +chore: rebases patches on latest devtools head diff --git a/packages/chrome-devtools-patches/Makefile b/packages/chrome-devtools-patches/Makefile index cb74249b9099..95be899561a8 100644 --- a/packages/chrome-devtools-patches/Makefile +++ b/packages/chrome-devtools-patches/Makefile @@ -1,7 +1,7 @@ ROOT = $(realpath .) PATH_WITH_DEPOT = $(PATH):$(ROOT)/depot/ # The upstream devtools commit upon which our patches are based -HEAD = 279239c4c670edbde12345aca4fadb7f07d503e8 +HEAD = 538f92a49ba5cbc615bcaa063214fca38ab87813 PATCHES = $(shell ls ${PWD}/patches/*.patch) depot: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git depot @@ -28,3 +28,8 @@ cleanup: test: git -C devtools-frontend am $(PATCHES) + +dev: + cd devtools-frontend && PATH="$(PATH_WITH_DEPOT)" npm run install-deps + cd devtools-frontend && PATH="$(PATH_WITH_DEPOT)" gn gen out/Default --args="devtools_skip_typecheck=true" + cd devtools-frontend && PATH="$(PATH_WITH_DEPOT)" npm run watch diff --git a/packages/chrome-devtools-patches/patches/0001-Expand-Browser-support-make-it-work-in-Firefox-Safar.patch b/packages/chrome-devtools-patches/patches/0001-Expand-Browser-support-make-it-work-in-Firefox-Safar.patch index a7f38d212e53..3471b5294e30 100644 --- a/packages/chrome-devtools-patches/patches/0001-Expand-Browser-support-make-it-work-in-Firefox-Safar.patch +++ b/packages/chrome-devtools-patches/patches/0001-Expand-Browser-support-make-it-work-in-Firefox-Safar.patch @@ -1,4 +1,4 @@ -From f33a1c016aca11dd75e912ba3373be01fc7480da Mon Sep 17 00:00:00 2001 +From 308d29672a61ba0cd0e4751460ae15c0f0930666 Mon Sep 17 00:00:00 2001 From: Workers DevProd Date: Fri, 25 Oct 2024 14:15:43 +0100 Subject: [PATCH 1/8] Expand Browser support (make it work in Firefox & Safari) @@ -23,7 +23,7 @@ If updating the commit of devtools upon which these patches are based, make sure 4 files changed, 46 insertions(+), 2 deletions(-) diff --git a/front_end/core/dom_extension/DOMExtension.ts b/front_end/core/dom_extension/DOMExtension.ts -index 940ce81924..e9542743ff 100644 +index 5060011dba..1ca615e641 100644 --- a/front_end/core/dom_extension/DOMExtension.ts +++ b/front_end/core/dom_extension/DOMExtension.ts @@ -132,7 +132,7 @@ Node.prototype.getComponentSelection = function(): Selection|null { @@ -100,7 +100,7 @@ index 45028f436a..6a154030b6 100644 static instance(opts: {forceNew: boolean|null} = {forceNew: null}): JsMainImpl { const {forceNew} = opts; diff --git a/front_end/ui/legacy/components/data_grid/DataGrid.ts b/front_end/ui/legacy/components/data_grid/DataGrid.ts -index 93a117e746..d9e37e3d7a 100644 +index 24f6b09d0c..8b9ca969ae 100644 --- a/front_end/ui/legacy/components/data_grid/DataGrid.ts +++ b/front_end/ui/legacy/components/data_grid/DataGrid.ts @@ -217,6 +217,8 @@ export class DataGridImpl extends Common.ObjectWrapper.ObjectWrapper *under* the + (this.dataTableBody as HTMLElement).style.height = 'calc(100% - 27px)'; - this.topFillerRow = (this.dataTableBody.createChild('tr', 'data-grid-filler-row revealed') as HTMLElement); + this.topFillerRow = this.dataTableBody.createChild('tr', 'data-grid-filler-row revealed'); UI.ARIAUtils.setHidden(this.topFillerRow, true); - this.bottomFillerRow = (this.dataTableBody.createChild('tr', 'data-grid-filler-row revealed') as HTMLElement); + this.bottomFillerRow = this.dataTableBody.createChild('tr', 'data-grid-filler-row revealed'); @@ -505,6 +507,9 @@ export class DataGridImpl extends Common.ObjectWrapper.ObjectWrapper Date: Fri, 25 Oct 2024 16:06:06 +0100 Subject: [PATCH 2/8] Setup Cloudflare devtools target type diff --git a/packages/chrome-devtools-patches/patches/0003-Add-ping-to-improve-connection-stability.-Without-th.patch b/packages/chrome-devtools-patches/patches/0003-Add-ping-to-improve-connection-stability.-Without-th.patch index f480c65b59f1..2f7e77c4a6c7 100644 --- a/packages/chrome-devtools-patches/patches/0003-Add-ping-to-improve-connection-stability.-Without-th.patch +++ b/packages/chrome-devtools-patches/patches/0003-Add-ping-to-improve-connection-stability.-Without-th.patch @@ -1,4 +1,4 @@ -From 233ae8633d7a84f662ebdea564070fcbee2f42d4 Mon Sep 17 00:00:00 2001 +From 202a5226a8f850a955b07c7abc301f3031d9a72d Mon Sep 17 00:00:00 2001 From: Workers DevProd Date: Fri, 25 Oct 2024 15:04:17 +0100 Subject: [PATCH 3/8] Add ping to improve connection stability. Without this, diff --git a/packages/chrome-devtools-patches/patches/0004-Support-viewing-source-files-over-the-network.-This-.patch b/packages/chrome-devtools-patches/patches/0004-Support-viewing-source-files-over-the-network.-This-.patch index 76468150b98c..8daf3007eca7 100644 --- a/packages/chrome-devtools-patches/patches/0004-Support-viewing-source-files-over-the-network.-This-.patch +++ b/packages/chrome-devtools-patches/patches/0004-Support-viewing-source-files-over-the-network.-This-.patch @@ -1,4 +1,4 @@ -From f55dc8200dda3025eb7866f2706a08851aa0d3dd Mon Sep 17 00:00:00 2001 +From 79eef448a1e63c2295d67938f92a83093289ffe6 Mon Sep 17 00:00:00 2001 From: Workers DevProd Date: Fri, 25 Oct 2024 15:26:38 +0100 Subject: [PATCH 4/8] Support viewing source files over the network. This @@ -23,7 +23,7 @@ Subject: [PATCH 4/8] Support viewing source files over the network. This 6 files changed, 15 insertions(+), 40 deletions(-) diff --git a/front_end/core/common/ParsedURL.ts b/front_end/core/common/ParsedURL.ts -index 832d76c19c..968439ade4 100644 +index 100d9ec45f..d75d6e4f2f 100644 --- a/front_end/core/common/ParsedURL.ts +++ b/front_end/core/common/ParsedURL.ts @@ -366,7 +366,7 @@ export class ParsedURL { @@ -88,20 +88,20 @@ index 1a6644df92..1724a33bd4 100644 persistence: UI.ViewManager.ViewPersistence.PERMANENT, async loadView() { diff --git a/front_end/entrypoints/main/MainImpl.ts b/front_end/entrypoints/main/MainImpl.ts -index 978092dea5..fc463ec0c9 100644 +index fbc6a1bd71..e6bc57bbb0 100644 --- a/front_end/entrypoints/main/MainImpl.ts +++ b/front_end/entrypoints/main/MainImpl.ts -@@ -421,6 +421,8 @@ export class MainImpl { - Root.Runtime.ExperimentName.TIMELINE_ANNOTATIONS, +@@ -414,6 +414,8 @@ export class MainImpl { Root.Runtime.ExperimentName.NETWORK_PANEL_FILTER_BAR_REDESIGN, Root.Runtime.ExperimentName.FLOATING_ENTRY_POINTS_FOR_AI_ASSISTANCE, + Root.Runtime.ExperimentName.TIMELINE_ALTERNATIVE_NAVIGATION, + Root.Runtime.ExperimentName.AUTHORED_DEPLOYED_GROUPING, + Root.Runtime.ExperimentName.JUST_MY_CODE, ...(Root.Runtime.Runtime.queryParam('isChromeForTesting') ? ['protocol-monitor'] : []), ]); diff --git a/front_end/panels/sources/NavigatorView.ts b/front_end/panels/sources/NavigatorView.ts -index 6f4c52f3e7..2f5ada52e6 100644 +index d9da41ab84..73f42a22be 100644 --- a/front_end/panels/sources/NavigatorView.ts +++ b/front_end/panels/sources/NavigatorView.ts @@ -795,8 +795,9 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O @@ -117,7 +117,7 @@ index 6f4c52f3e7..2f5ada52e6 100644 const parsedURL = new Common.ParsedURL.ParsedURL(projectOrigin); diff --git a/front_end/panels/sources/sources-meta.ts b/front_end/panels/sources/sources-meta.ts -index 42a2e17f07..c41a8d2c7a 100644 +index f4284da33b..76bb296abb 100644 --- a/front_end/panels/sources/sources-meta.ts +++ b/front_end/panels/sources/sources-meta.ts @@ -495,32 +495,6 @@ UI.ViewManager.registerViewExtension({ diff --git a/packages/chrome-devtools-patches/patches/0005-Support-forcing-the-devtools-theme-via-a-query-param.patch b/packages/chrome-devtools-patches/patches/0005-Support-forcing-the-devtools-theme-via-a-query-param.patch index 0c956636dc76..e0ca73f5256f 100644 --- a/packages/chrome-devtools-patches/patches/0005-Support-forcing-the-devtools-theme-via-a-query-param.patch +++ b/packages/chrome-devtools-patches/patches/0005-Support-forcing-the-devtools-theme-via-a-query-param.patch @@ -1,4 +1,4 @@ -From 0f7a1adad6b0bfbafe60fbc4c161fa9a7ef0381f Mon Sep 17 00:00:00 2001 +From 94301beb8effbc0b3a2d11934369d4c6071fe73c Mon Sep 17 00:00:00 2001 From: Workers DevProd Date: Fri, 25 Oct 2024 15:05:56 +0100 Subject: [PATCH 5/8] Support forcing the devtools theme via a query parameter, diff --git a/packages/chrome-devtools-patches/patches/0006-All-about-the-network-tab.patch b/packages/chrome-devtools-patches/patches/0006-All-about-the-network-tab.patch index a9dee1b74b0c..bb4a15ce9e61 100644 --- a/packages/chrome-devtools-patches/patches/0006-All-about-the-network-tab.patch +++ b/packages/chrome-devtools-patches/patches/0006-All-about-the-network-tab.patch @@ -1,4 +1,4 @@ -From 3b484138dabb583349363df0e2d69ffe3c1dc039 Mon Sep 17 00:00:00 2001 +From c0a3154c9483ac4390d8459cb5869b58afa8d503 Mon Sep 17 00:00:00 2001 From: Workers DevProd Date: Fri, 25 Oct 2024 16:05:12 +0100 Subject: [PATCH 6/8] All about the network tab! @@ -16,7 +16,7 @@ Subject: [PATCH 6/8] All about the network tab! 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/front_end/core/sdk/NetworkManager.ts b/front_end/core/sdk/NetworkManager.ts -index 8735116e61..953d3fc7b1 100644 +index 4093f80cf8..1eb3199a53 100644 --- a/front_end/core/sdk/NetworkManager.ts +++ b/front_end/core/sdk/NetworkManager.ts @@ -34,6 +34,7 @@ @@ -73,7 +73,7 @@ index 1724a33bd4..884c6264d2 100644 import * as Common from '../../core/common/common.js'; diff --git a/front_end/panels/network/NetworkPanel.ts b/front_end/panels/network/NetworkPanel.ts -index 71c40a6873..abf30cc4e8 100644 +index 7d44f68bf3..f4b7ec0973 100644 --- a/front_end/panels/network/NetworkPanel.ts +++ b/front_end/panels/network/NetworkPanel.ts @@ -75,14 +75,6 @@ const UIStrings = { @@ -91,7 +91,7 @@ index 71c40a6873..abf30cc4e8 100644 /** *@description Tooltip text that appears when hovering over the largeicon settings gear in show settings pane setting in network panel of the network panel */ -@@ -158,10 +150,6 @@ const UIStrings = { +@@ -180,10 +172,6 @@ const UIStrings = { *@description Text in Network Panel that is displayed when frames are being fetched. */ fetchingFrames: 'Fetching frames...', @@ -102,7 +102,7 @@ index 71c40a6873..abf30cc4e8 100644 }; const str_ = i18n.i18n.registerUIStrings('panels/network/NetworkPanel.ts', UIStrings); const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); -@@ -422,21 +410,6 @@ export class NetworkPanel extends UI.Panel.Panel implements +@@ -444,21 +432,6 @@ export class NetworkPanel extends UI.Panel.Panel implements this.panelToolbar.appendToolbarItem(new UI.Toolbar.ToolbarSettingCheckbox( this.preserveLogSetting, i18nString(UIStrings.doNotClearLogOnPageReload), i18nString(UIStrings.preserveLog))); diff --git a/packages/chrome-devtools-patches/patches/0007-Limit-heap-profiling-modes-available.patch b/packages/chrome-devtools-patches/patches/0007-Limit-heap-profiling-modes-available.patch index 8fa7a21e1e28..8d75040692a5 100644 --- a/packages/chrome-devtools-patches/patches/0007-Limit-heap-profiling-modes-available.patch +++ b/packages/chrome-devtools-patches/patches/0007-Limit-heap-profiling-modes-available.patch @@ -1,4 +1,4 @@ -From 01012531546fccc62536fba7d1bfde6c5cc1a6c2 Mon Sep 17 00:00:00 2001 +From 6bca6c563e616596aa75a88f1d52b8f9150ba93c Mon Sep 17 00:00:00 2001 From: Workers DevProd Date: Fri, 25 Oct 2024 16:07:24 +0100 Subject: [PATCH 7/8] Limit heap profiling modes available diff --git a/packages/chrome-devtools-patches/patches/0008-Use-the-worker-name-as-the-title-for-the-Javascript-.patch b/packages/chrome-devtools-patches/patches/0008-Use-the-worker-name-as-the-title-for-the-Javascript-.patch index f5b5fb15a81d..654eb21be1fd 100644 --- a/packages/chrome-devtools-patches/patches/0008-Use-the-worker-name-as-the-title-for-the-Javascript-.patch +++ b/packages/chrome-devtools-patches/patches/0008-Use-the-worker-name-as-the-title-for-the-Javascript-.patch @@ -1,4 +1,4 @@ -From 57b100b2455fc3adb794218c4d15c44052a16f52 Mon Sep 17 00:00:00 2001 +From 25c22c6909222b58a576a04c29c2baf517ecf69c Mon Sep 17 00:00:00 2001 From: Workers DevProd Date: Fri, 25 Oct 2024 16:11:10 +0100 Subject: [PATCH 8/8] Use the worker name as the title for the Javascript