Skip to content

Commit 389779c

Browse files
huntiefacebook-github-bot
authored andcommitted
Move XHRInterceptor to src/private/inspector/ (#49023)
Summary: Pull Request resolved: #49023 Changelog: [General][Breaking] - Move `XHRInterceptor` API to `src/private/` Reviewed By: christophpurrer Differential Revision: D68781897 fbshipit-source-id: af52f65b0f64da68a78babf326a1a9b8a1fc1d96
1 parent 0bde08f commit 389779c

File tree

3 files changed

+2
-47
lines changed

3 files changed

+2
-47
lines changed

packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6528,51 +6528,6 @@ exports[`public API should not change unintentionally Libraries/Network/RCTNetwo
65286528
"
65296529
`;
65306530

6531-
exports[`public API should not change unintentionally Libraries/Network/XHRInterceptor.js 1`] = `
6532-
"type XHRInterceptorOpenCallback = (
6533-
method: string,
6534-
url: string,
6535-
request: XMLHttpRequest
6536-
) => void;
6537-
type XHRInterceptorSendCallback = (
6538-
data: string,
6539-
request: XMLHttpRequest
6540-
) => void;
6541-
type XHRInterceptorRequestHeaderCallback = (
6542-
header: string,
6543-
value: string,
6544-
request: XMLHttpRequest
6545-
) => void;
6546-
type XHRInterceptorHeaderReceivedCallback = (
6547-
responseContentType: string | void,
6548-
responseSize: number | void,
6549-
allHeaders: string,
6550-
request: XMLHttpRequest
6551-
) => void;
6552-
type XHRInterceptorResponseCallback = (
6553-
status: number,
6554-
timeout: number,
6555-
response: string,
6556-
responseURL: string,
6557-
responseType: string,
6558-
request: XMLHttpRequest
6559-
) => void;
6560-
declare const XHRInterceptor: {
6561-
setOpenCallback(callback: XHRInterceptorOpenCallback): void,
6562-
setSendCallback(callback: XHRInterceptorSendCallback): void,
6563-
setHeaderReceivedCallback(
6564-
callback: XHRInterceptorHeaderReceivedCallback
6565-
): void,
6566-
setResponseCallback(callback: XHRInterceptorResponseCallback): void,
6567-
setRequestHeaderCallback(callback: XHRInterceptorRequestHeaderCallback): void,
6568-
isInterceptorEnabled(): boolean,
6569-
enableInterception(): void,
6570-
disableInterception(): void,
6571-
};
6572-
declare module.exports: XHRInterceptor;
6573-
"
6574-
`;
6575-
65766531
exports[`public API should not change unintentionally Libraries/Network/XMLHttpRequest.js 1`] = `
65776532
"export type NativeResponseType = \\"base64\\" | \\"blob\\" | \\"text\\";
65786533
export type ResponseType =

packages/react-native/src/private/inspector/NetworkOverlay.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ const TouchableHighlight =
1919
require('../../../Libraries/Components/Touchable/TouchableHighlight').default;
2020
const View = require('../../../Libraries/Components/View/View').default;
2121
const FlatList = require('../../../Libraries/Lists/FlatList').default;
22-
const XHRInterceptor = require('../../../Libraries/Network/XHRInterceptor');
2322
const StyleSheet = require('../../../Libraries/StyleSheet/StyleSheet');
2423
const Text = require('../../../Libraries/Text/Text').default;
2524
const WebSocketInterceptor =
2625
require('../../../Libraries/WebSocket/WebSocketInterceptor').default;
26+
const XHRInterceptor = require('./XHRInterceptor');
2727

2828
const LISTVIEW_CELL_HEIGHT = 15;
2929

packages/react-native/Libraries/Network/XHRInterceptor.js renamed to packages/react-native/src/private/inspector/XHRInterceptor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
'use strict';
1212

13-
const XMLHttpRequest = require('./XMLHttpRequest');
13+
const XMLHttpRequest = require('../../../Libraries/Network/XMLHttpRequest');
1414
// $FlowFixMe[method-unbinding]
1515
const originalXHROpen = XMLHttpRequest.prototype.open;
1616
// $FlowFixMe[method-unbinding]

0 commit comments

Comments
 (0)