Skip to content

Commit 41380f3

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Deprecate XHRInterceptor and WebSocketInterceptor APIs (#54869)
Summary: Pull Request resolved: #54869 These APIs are unused within React Native since #54868, and we now implement the `Network` CDP domain in core (React Native DevTools and other CDP clients). These APIs are private under the Strict TypeScript API, however have some open source usages in Reactotron and Rozenite, which is why we aren't removing these immediately. We intend to remove these APIs in future, but with no immediate planned timeline. Changelog: [General][Deprecated] - Deprecate `XHRInterceptor` and `WebSocketInterceptor` APIs. Developer tools should use the CDP `Network` domain instead. Reviewed By: vzaidman, javache Differential Revision: D89051528 fbshipit-source-id: d0c0f87f2663d92fa08be20cc674ab4345a104d6
1 parent 72097f0 commit 41380f3

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

packages/react-native/Libraries/WebSocket/WebSocketInterceptor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ let isInterceptorEnabled = false;
3333

3434
/**
3535
* A network interceptor which monkey-patches RCTWebSocketModule methods
36-
* to gather all websocket network requests/responses, in order to show
37-
* their information in the React Native inspector development tool.
36+
* to gather all websocket network events.
37+
*
38+
* @deprecated Since React Native 0.84
3839
*/
39-
4040
const WebSocketInterceptor = {
4141
/**
4242
* Invoked when RCTWebSocketModule.close(...) is called.

packages/react-native/src/private/devsupport/devmenu/elementinspector/XHRInterceptor.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ let isInterceptorEnabled = false;
6464

6565
/**
6666
* A network interceptor which monkey-patches XMLHttpRequest methods
67-
* to gather all network requests/responses, in order to show their
68-
* information in the React Native inspector development tool.
67+
* to gather all network requests/responses.
6968
* This supports interception with XMLHttpRequest API, including Fetch API
7069
* and any other third party libraries that depend on XMLHttpRequest.
70+
*
71+
* @deprecated Since React Native 0.84
7172
*/
7273
const XHRInterceptor = {
7374
/**

0 commit comments

Comments
 (0)