Skip to content

Commit

Permalink
Inspector: Add pageId to /json/list, support /open-debugger to a spec…
Browse files Browse the repository at this point in the history
…ific page

Summary:
- Add a `pageId` to the `reactNative` section of `/json/list` inspector proxy responses.
 - Allow specifying a `page` query param to `/open-debugger`, which will use it as a target filter if given.

Changelog:
[General][Added]: Inspector: Add pageId to /json/list, support /open-debugger to a specific page

Differential Revision: D58951952
  • Loading branch information
robhogan authored and facebook-github-bot committed Jun 24, 2024
1 parent 9ba600c commit b709831
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/dev-middleware/src/index.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ export type {
CustomMessageHandlerConnection,
CreateCustomMessageHandlerFn,
} from './inspector-proxy/CustomMessageHandler';
export type {PageDescription} from './inspector-proxy/types';
13 changes: 5 additions & 8 deletions packages/dev-middleware/src/middleware/openDebuggerMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,11 @@ export default function openDebuggerMiddleware({
(launchType === 'launch' ? 'Launching' : 'Redirecting to') +
' JS debugger (experimental)...',
);
if (typeof device === 'string') {
target = targets.find(
_target => _target.reactNative.logicalDeviceId === device,
);
}
if (!target && typeof appId === 'string') {
target = targets.find(_target => _target.description === appId);
}
target = targets.find(
_target =>
(appId == null || _target.description === appId) &&
(device == null || _target.reactNative.logicalDeviceId === device),
);
} else if (targets.length > 0) {
logger?.info(
(launchType === 'launch' ? 'Launching' : 'Redirecting to') +
Expand Down

0 comments on commit b709831

Please sign in to comment.