Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DevTools] Add events necessary for click to inspect on RN #25111

Merged
merged 3 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-devtools-core/src/standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ function initialize(socket: WebSocket) {

store = new Store(bridge, {
checkBridgeProtocolCompatibility: true,
supportsNativeInspection: false,
supportsNativeInspection: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One other place the standalone is used in Safari. Could you test there as well to make sure inspection works there as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested on a react app on Safari, inspection works!

});

log('Connected');
Expand Down
2 changes: 2 additions & 0 deletions packages/react-devtools-shared/src/backend/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ type PersistedSelection = {|
export default class Agent extends EventEmitter<{|
hideNativeHighlight: [],
showNativeHighlight: [NativeType],
startInspectingNative: [],
stopInspectingNative: [],
shutdown: [],
traceUpdates: [Set<NativeType>],
|}> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export default function setupHighlighter(
window.addEventListener('pointerdown', onPointerDown, true);
window.addEventListener('pointerover', onPointerOver, true);
window.addEventListener('pointerup', onPointerUp, true);
} else {
agent.emit('startInspectingNative');
}
}

Expand All @@ -74,6 +76,8 @@ export default function setupHighlighter(
window.removeEventListener('pointerdown', onPointerDown, true);
window.removeEventListener('pointerover', onPointerOver, true);
window.removeEventListener('pointerup', onPointerUp, true);
} else {
agent.emit('stopInspectingNative');
}
}

Expand Down