Skip to content

Commit 755895e

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Remove legacy debugger entry point selection (#55548)
Summary: Pull Request resolved: #55548 **Context** Clean up the legacy `rn_inspector.html` entry point. React Native DevTools has been the default since 0.76, and we have now removed all internal dependencies at Meta. We've verified that Reanimated (`react-native-worklets`) also do not depend on this workflow, and documents `chrome://inspect` instead. **This diff** - Launching the debugger will no longer check for the `prefersFuseboxFrontend` capability flag (internal contract with the debugger server). - The modern `rn_fusebox.html` entry point will always be used. Changelog: [Internal] Reviewed By: vzaidman Differential Revision: D93247604 fbshipit-source-id: 1c7b6838d9105c9206ffc0030374dc1ee559a6dd
1 parent ddadca7 commit 755895e

8 files changed

Lines changed: 20 additions & 47 deletions

File tree

packages/dev-middleware/src/__tests__/InspectorProxyHttpApi-test.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jest.useFakeTimers();
2727
describe('inspector proxy HTTP API', () => {
2828
const serverRef = withServerForEachTest({
2929
logger: undefined,
30+
unstable_experiments: {
31+
enableStandaloneFuseboxShell: false,
32+
},
3033
});
3134
const autoCleanup = withAbortSignalForEachTest();
3235
afterEach(() => {
@@ -189,7 +192,9 @@ describe('inspector proxy HTTP API', () => {
189192
devtoolsFrontendUrl: expect.any(String),
190193
id: 'device1-page1',
191194
reactNative: {
192-
capabilities: {},
195+
capabilities: {
196+
supportsMultipleDebuggers: false,
197+
},
193198
logicalDeviceId: 'device1',
194199
},
195200
title: 'bar-title',
@@ -204,7 +209,9 @@ describe('inspector proxy HTTP API', () => {
204209
devtoolsFrontendUrl: expect.any(String),
205210
id: 'device2-page1',
206211
reactNative: {
207-
capabilities: {},
212+
capabilities: {
213+
supportsMultipleDebuggers: false,
214+
},
208215
logicalDeviceId: 'device2',
209216
},
210217
title: 'bar-title',

packages/dev-middleware/src/__tests__/StandaloneFuseboxShell-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ describe('enableStandaloneFuseboxShell experiment', () => {
6060
capabilities: {
6161
// Ensure the device target can be found when launching the debugger
6262
nativePageReloads: true,
63-
// Mark as Fusebox
64-
prefersFuseboxFrontend: true,
6563
},
6664
},
6765
]);

packages/dev-middleware/src/__tests__/getDevToolsFrontendUrl-test.js

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('getDevToolsFrontendUrl', () => {
3030
);
3131
const url = new URL(actual);
3232
expect(url.host).toBe('localhost:8081');
33-
expect(url.pathname).toBe('/debugger-frontend/rn_inspector.html');
33+
expect(url.pathname).toBe('/debugger-frontend/rn_fusebox.html');
3434
expect(url.searchParams.get('ws')).toBe(
3535
'/inspector/debug?device=1a9372c&page=-1',
3636
);
@@ -44,7 +44,7 @@ describe('getDevToolsFrontendUrl', () => {
4444
);
4545
const url = new URL(actual);
4646
expect(url.host).toBe('localhost:8081');
47-
expect(url.pathname).toBe('/debugger-frontend/rn_inspector.html');
47+
expect(url.pathname).toBe('/debugger-frontend/rn_fusebox.html');
4848
expect(url.searchParams.get('unstable_enableNetworkPanel')).toBe('true');
4949
expect(url.searchParams.get('ws')).toBe(
5050
'/inspector/debug?device=1a9372c&page=-1',
@@ -87,7 +87,7 @@ describe('getDevToolsFrontendUrl', () => {
8787
},
8888
);
8989
const url = assertValidRelativeURL(actual);
90-
expect(url.pathname).toBe('/debugger-frontend/rn_inspector.html');
90+
expect(url.pathname).toBe('/debugger-frontend/rn_fusebox.html');
9191
expect(url.searchParams.get('ws')).toBe(
9292
'/inspector/debug?device=1a9372c&page=-1',
9393
);
@@ -103,7 +103,7 @@ describe('getDevToolsFrontendUrl', () => {
103103
},
104104
);
105105
const url = assertValidRelativeURL(actual);
106-
expect(url.pathname).toBe('/debugger-frontend/rn_inspector.html');
106+
expect(url.pathname).toBe('/debugger-frontend/rn_fusebox.html');
107107
expect(url.searchParams.get('unstable_enableNetworkPanel')).toBe('true');
108108
expect(url.searchParams.get('ws')).toBe(
109109
'/inspector/debug?device=1a9372c&page=-1',
@@ -147,7 +147,7 @@ describe('getDevToolsFrontendUrl', () => {
147147
},
148148
);
149149
const url = new URL(actual);
150-
expect(url.pathname).toBe('/debugger-frontend/rn_inspector.html');
150+
expect(url.pathname).toBe('/debugger-frontend/rn_fusebox.html');
151151
expect(url.searchParams.get('ws')).toBe(
152152
'/inspector/debug?device=1a9372c&page=-1',
153153
);
@@ -168,7 +168,7 @@ describe('getDevToolsFrontendUrl', () => {
168168
},
169169
);
170170
const url = new URL(actual);
171-
expect(url.pathname).toBe('/debugger-frontend/rn_inspector.html');
171+
expect(url.pathname).toBe('/debugger-frontend/rn_fusebox.html');
172172
expect(url.searchParams.get('unstable_enableNetworkPanel')).toBe('true');
173173
expect(url.searchParams.get('ws')).toBe(
174174
'/inspector/debug?device=1a9372c&page=-1',
@@ -201,20 +201,4 @@ describe('getDevToolsFrontendUrl', () => {
201201
);
202202
});
203203
});
204-
205-
describe('useFuseboxEntryPoint: true', () => {
206-
test('should return rn_fusebox.html entry point', async () => {
207-
const result = getDevToolsFrontendUrl(
208-
experiments,
209-
webSocketDebuggerUrl,
210-
devServerUrl,
211-
{
212-
useFuseboxEntryPoint: true,
213-
},
214-
);
215-
const url = new URL(result);
216-
217-
expect(url.pathname).toBe('/debugger-frontend/rn_fusebox.html');
218-
});
219-
});
220204
});

packages/dev-middleware/src/inspector-proxy/InspectorProxy.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ export default class InspectorProxy implements InspectorProxyQueries {
258258
new URL(this.#serverBaseUrl),
259259
{
260260
relative: true,
261-
useFuseboxEntryPoint: page.capabilities.prefersFuseboxFrontend,
262261
},
263262
);
264263

packages/dev-middleware/src/inspector-proxy/__docs__/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ interface Page {
127127
capabilities?: {
128128
nativePageReloads?: boolean; // Target keeps the socket open across reloads
129129
nativeSourceCodeFetching?: boolean; // Target supports Network.loadNetworkResource
130-
prefersFuseboxFrontend?: boolean; // Target is designed for React Native DevTools
131130
supportsMultipleDebuggers?: boolean; // Supports concurrent debugger sessions
132131
};
133132
}
@@ -248,7 +247,6 @@ interface PageDescription {
248247
logicalDeviceId: string; // Used for target matching
249248
capabilities: {
250249
nativePageReloads?: boolean; // Used for target filtering
251-
prefersFuseboxFrontend?: boolean; // Used for frontend selection
252250
};
253251
};
254252
}

packages/dev-middleware/src/middleware/openDebuggerMiddleware.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ type Options = Readonly<{
3939
/**
4040
* Open the debugger frontend for a given CDP target.
4141
*
42-
* Currently supports React Native DevTools (rn_fusebox.html) and legacy Hermes
43-
* (rn_inspector.html) targets.
44-
*
4542
* @see https://chromedevtools.github.io/devtools-protocol/
4643
*/
4744
export default function openDebuggerMiddleware({
@@ -65,6 +62,7 @@ export default function openDebuggerMiddleware({
6562
return result;
6663
});
6764
}
65+
6866
return async (
6967
req: IncomingMessage,
7068
res: ServerResponse,
@@ -156,9 +154,6 @@ export default function openDebuggerMiddleware({
156154
return;
157155
}
158156

159-
const useFuseboxEntryPoint =
160-
target.reactNative.capabilities?.prefersFuseboxFrontend ?? false;
161-
162157
try {
163158
switch (launchType) {
164159
case 'launch': {
@@ -170,12 +165,11 @@ export default function openDebuggerMiddleware({
170165
launchId: query.launchId,
171166
telemetryInfo: query.telemetryInfo,
172167
appId: target.appId,
173-
useFuseboxEntryPoint,
174168
panel: query.panel,
175169
},
176170
);
177171
let shouldUseStandaloneFuseboxShell =
178-
useFuseboxEntryPoint && experiments.enableStandaloneFuseboxShell;
172+
experiments.enableStandaloneFuseboxShell;
179173
if (shouldUseStandaloneFuseboxShell) {
180174
const shellPreparationResult = await shellPreparationPromise;
181175
switch (shellPreparationResult.code) {
@@ -229,7 +223,6 @@ export default function openDebuggerMiddleware({
229223
launchId: query.launchId,
230224
telemetryInfo: query.telemetryInfo,
231225
appId: target.appId,
232-
useFuseboxEntryPoint,
233226
},
234227
),
235228
});
@@ -247,7 +240,7 @@ export default function openDebuggerMiddleware({
247240
pageId: target.id,
248241
deviceName: target.deviceName,
249242
targetDescription: target.description,
250-
prefersFuseboxFrontend: useFuseboxEntryPoint,
243+
prefersFuseboxFrontend: true,
251244
});
252245
return;
253246
} catch (e) {
@@ -261,7 +254,6 @@ export default function openDebuggerMiddleware({
261254
launchType,
262255
status: 'error',
263256
error: e,
264-
prefersFuseboxFrontend: useFuseboxEntryPoint,
265257
});
266258
return;
267259
}

packages/dev-middleware/src/types/Experiments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export type Experiments = Readonly<{
2424
enableNetworkInspector: boolean,
2525

2626
/**
27-
* Launch the Fusebox frontend in a standalone shell instead of a browser.
27+
* Launch the debugger frontend in a standalone shell instead of a browser.
2828
* When this is enabled, we will use the optional unstable_showFuseboxShell
2929
* method on the BrowserLauncher, or throw an error if the method is missing.
3030
*

packages/dev-middleware/src/utils/getDevToolsFrontendUrl.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ export default function getDevToolsFrontendUrl(
2222
relative?: boolean,
2323
launchId?: string,
2424
telemetryInfo?: string,
25-
/** Whether to use the modern `rn_fusebox.html` entry point. */
26-
useFuseboxEntryPoint?: boolean,
2725
appId?: string,
2826
panel?: string,
2927
}>,
@@ -35,10 +33,7 @@ export default function getDevToolsFrontendUrl(
3533

3634
const appUrl =
3735
(options?.relative === true ? '' : devServerUrl.origin) +
38-
'/debugger-frontend/' +
39-
(options?.useFuseboxEntryPoint === true
40-
? 'rn_fusebox.html'
41-
: 'rn_inspector.html');
36+
'/debugger-frontend/rn_fusebox.html';
4237

4338
const searchParams = new URLSearchParams([
4439
[wsParam.key, wsParam.value],

0 commit comments

Comments
 (0)