Skip to content

Commit

Permalink
Delete Libraries/JSInspector (#49019)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #49019

Removes the `JSInspector` class and its dependencies.

- This was related to the legacy `ReactCommon/inspector/` subsystem (D4021490) — which added a compat layer from JavaScriptCore to CDP for an earlier version of Chrome debugging.
- The JS components of this system (`JSInspector.js`, `NetworkAgent.js`) were added in D4021516.

`ReactCommon/inspector/` has since been deleted and these components are no longer load bearing.

- We intend to replace this logic (at least, the archaic `XHRInterceptor` behaviour, which worked at one point) with native debugger `Network` domain support in our C++ layer.

**Changes**

- Remove all modules under `Libraries/JSInspector/`.
- Remove all `XHRInterceptor` call sites.
- Remove the `JSInspector.registerAgent()` mount point in `setUpDeveloperTools.js`.
- Exclude `Libraries/Core/setUp*` from `public-api-test` (these are side-effect setup files with no exported API).

Changelog:
[General][Breaking] - Remove legacy Libraries/JSInspector modules

Reviewed By: christophpurrer

Differential Revision: D68780147

fbshipit-source-id: 3d11cc89886a91055e6b69ac6f0609c288965801
  • Loading branch information
huntie authored and facebook-github-bot committed Jan 30, 2025
1 parent accde40 commit 9ba4dd8
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 590 deletions.
4 changes: 0 additions & 4 deletions packages/react-native/Libraries/Core/setUpDeveloperTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ declare var console: {[string]: $FlowFixMe};
* You can use this module directly, or just require InitializeCore.
*/
if (__DEV__) {
// Set up inspector
const JSInspector = require('../JSInspector/JSInspector');
JSInspector.registerAgent(require('../JSInspector/NetworkAgent').default);

// Note we can't check if console is "native" because it would appear "native" in JSC and Hermes.
// We also can't check any properties that don't exist in the Chrome worker environment.
// So we check a navigator property that's set to a particular value ("Netscape") in all real browsers.
Expand Down
27 changes: 0 additions & 27 deletions packages/react-native/Libraries/JSInspector/InspectorAgent.js

This file was deleted.

33 changes: 0 additions & 33 deletions packages/react-native/Libraries/JSInspector/JSInspector.js

This file was deleted.

296 changes: 0 additions & 296 deletions packages/react-native/Libraries/JSInspector/NetworkAgent.js

This file was deleted.

Loading

0 comments on commit 9ba4dd8

Please sign in to comment.