Skip to content

Commit d1474fc

Browse files
authored
Revert "chore: update devtools patches (2nd attempt) (#7008)" (#7131)
This reverts commit 4755bbc.
1 parent 07b5b25 commit d1474fc

25 files changed

+2742
-559
lines changed

.changeset/famous-birds-remain.md

-5
This file was deleted.

.gitignore

-4
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,6 @@ packages/quick-edit/web
190190
packages/wrangler/config-schema.json
191191
packages/wrangler-devtools/built-devtools
192192
packages/wrangler-devtools/.cipd
193-
packages/wrangler-devtools/.gclient
194-
packages/wrangler-devtools/.gclient_entries
195-
packages/wrangler-devtools/.gclient_previous_sync_commits
196-
packages/wrangler-devtools/.gcs_entries
197193
packages/wrangler-devtools/depot
198194
packages/wrangler-devtools/devtools-frontend
199195
packages/miniflare/dist-types/

.prettierignore

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ packages/create-cloudflare/templates*/**/*.*
2424
# but still exclude the worker-configuration.d.ts file, since it's generated
2525
!packages/create-cloudflare/templates*/hello-world/**/*.*
2626
packages/create-cloudflare/templates*/hello-world/**/worker-configuration.d.ts
27-
packages/wrangler-devtools/devtools-frontend
2827

2928
# dist-functions are generated in the fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self folder
3029
dist-functions

packages/wrangler-devtools/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ROOT = $(realpath .)
22
PATH_WITH_DEPOT = $(PATH):$(ROOT)/depot/
33
# The upstream devtools commit upon which our patches are based
4-
HEAD = 279239c4c670edbde12345aca4fadb7f07d503e8
4+
HEAD = 64208f10b3efe06a92c58d345bd828832d09c4a7
55
PATCHES = $(shell ls ${PWD}/patches/*.patch)
66
depot:
77
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git depot
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
From 24644cc732ec4bf8589715e853067eadd1b52e29 Mon Sep 17 00:00:00 2001
2+
From: Workers DevProd <[email protected]>
3+
Date: Mon, 2 Oct 2023 18:13:34 +0100
4+
Subject: [PATCH 01/15] Support viewing files over the network
5+
6+
---
7+
front_end/core/sdk/Target.ts | 4 ++++
8+
front_end/entrypoints/js_app/js_app.ts | 2 +-
9+
front_end/panels/sources/sources-meta.ts | 11 ++++++++---
10+
tsconfig.json | 3 ++-
11+
4 files changed, 15 insertions(+), 5 deletions(-)
12+
13+
diff --git a/front_end/core/sdk/Target.ts b/front_end/core/sdk/Target.ts
14+
index eed909ea64..5e1778885d 100644
15+
--- a/front_end/core/sdk/Target.ts
16+
+++ b/front_end/core/sdk/Target.ts
17+
@@ -82,6 +82,9 @@ export class Target extends ProtocolClient.InspectorBackend.TargetBase {
18+
case Type.Tab:
19+
this.#capabilitiesMask = Capability.Target | Capability.Tracing;
20+
break;
21+
+ case Type.Cloudflare:
22+
+ this.#capabilitiesMask = Capability.JS | Capability.Network;
23+
+ break;
24+
}
25+
this.#typeInternal = type;
26+
this.#parentTargetInternal = parentTarget;
27+
@@ -255,6 +258,7 @@ export enum Type {
28+
Browser = 'browser',
29+
AuctionWorklet = 'auction-worklet',
30+
Tab = 'tab',
31+
+ Cloudflare = 'cloudflare',
32+
}
33+
34+
// TODO(crbug.com/1167717): Make this a const enum again
35+
diff --git a/front_end/entrypoints/js_app/js_app.ts b/front_end/entrypoints/js_app/js_app.ts
36+
index cafecfa4ba..213ca7fecd 100644
37+
--- a/front_end/entrypoints/js_app/js_app.ts
38+
+++ b/front_end/entrypoints/js_app/js_app.ts
39+
@@ -38,7 +38,7 @@ export class JsMainImpl implements Common.Runnable.Runnable {
40+
Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConnectToNodeJSDirectly);
41+
void SDK.Connections.initMainConnection(async () => {
42+
const target = SDK.TargetManager.TargetManager.instance().createTarget(
43+
- 'main', i18nString(UIStrings.main), SDK.Target.Type.Node, null);
44+
+ 'main', i18nString(UIStrings.main), SDK.Target.Type.Cloudflare, null);
45+
void target.runtimeAgent().invoke_runIfWaitingForDebugger();
46+
}, Components.TargetDetachedDialog.TargetDetachedDialog.webSocketConnectionLost);
47+
}
48+
diff --git a/front_end/panels/sources/sources-meta.ts b/front_end/panels/sources/sources-meta.ts
49+
index a0c126df12..4b8244ea69 100644
50+
--- a/front_end/panels/sources/sources-meta.ts
51+
+++ b/front_end/panels/sources/sources-meta.ts
52+
@@ -41,6 +41,11 @@ const UIStrings = {
53+
*@description Title of the 'Snippets' tool in the Snippets Navigator View, which is part of the Sources tool
54+
*/
55+
snippets: 'Snippets',
56+
+ /**
57+
+ *@description Title of the 'Cloudflare' tool in the Cloudflare Navigator View, which is part of the Sources tool
58+
+ */
59+
+ cloudflare: 'Cloudflare',
60+
+ /**
61+
/**
62+
*@description Command for showing the 'Search' tool
63+
*/
64+
@@ -454,14 +459,14 @@ UI.ViewManager.registerViewExtension({
65+
66+
UI.ViewManager.registerViewExtension({
67+
location: UI.ViewManager.ViewLocationValues.NAVIGATOR_VIEW,
68+
- id: 'navigator-files',
69+
+ id: 'navigator-network',
70+
commandPrompt: i18nLazyString(UIStrings.showWorkspace),
71+
- title: i18nLazyString(UIStrings.workspace),
72+
+ title: i18nLazyString(UIStrings.cloudflare),
73+
order: 3,
74+
persistence: UI.ViewManager.ViewPersistence.PERMANENT,
75+
async loadView() {
76+
const Sources = await loadSourcesModule();
77+
- return Sources.SourcesNavigator.FilesNavigatorView.instance();
78+
+ return Sources.SourcesNavigator.NetworkNavigatorView.instance();
79+
},
80+
});
81+
82+
diff --git a/tsconfig.json b/tsconfig.json
83+
index ac0d4aaf68..29c726e185 100644
84+
--- a/tsconfig.json
85+
+++ b/tsconfig.json
86+
@@ -16,6 +16,7 @@
87+
"inspector_overlay"
88+
],
89+
"exclude": [
90+
- "front_end/**/*-legacy.ts"
91+
+ "front_end/**/*-legacy.ts",
92+
+ "third_party/**/*.ts"
93+
]
94+
}
95+
--
96+
2.39.3 (Apple Git-145)
97+

packages/wrangler-devtools/patches/0002-Setup-Cloudflare-devtools-target-type.patch

-48
This file was deleted.

0 commit comments

Comments
 (0)