Skip to content

Commit a57bfc7

Browse files
authored
ref(core)!: Remove supportsNativeFetch export (#23719)
Removes this export from core. It was only used by `HttpClient` integration to guard adding the fetch instrumentation, which should not be necessary (we do not do this for other places).
1 parent 57815f2 commit a57bfc7

3 files changed

Lines changed: 0 additions & 7 deletions

File tree

‎packages/browser/src/integrations/httpclient.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
getClient,
1111
GLOBAL_OBJ,
1212
isSentryRequestUrl,
13-
supportsNativeFetch,
1413
} from '@sentry/core/browser';
1514
import type { SentryWrappedXMLHttpRequest } from '@sentry/browser-utils';
1615
import { addXhrInstrumentationHandler, SENTRY_XHR_DATA_KEY } from '@sentry/browser-utils';
@@ -282,10 +281,6 @@ function _isInGivenStatusRanges(
282281
* Wraps `fetch` function to capture request and response data
283282
*/
284283
function _wrapFetch(client: Client, options: HttpClientOptions): void {
285-
if (!supportsNativeFetch()) {
286-
return;
287-
}
288-
289284
addFetchInstrumentationHandler(handlerData => {
290285
if (getClient() !== client) {
291286
return;

‎packages/browser/test/integrations/httpclient.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ describe('httpClientIntegration', () => {
2626
const client = new BrowserClient(getDefaultBrowserClientOptions(options));
2727

2828
vi.spyOn(SentryCore, 'getClient').mockReturnValue(client);
29-
vi.spyOn(SentryCore, 'supportsNativeFetch').mockReturnValue(true);
3029
const addFetchSpy = vi
3130
.spyOn(SentryCore, 'addFetchInstrumentationHandler')
3231
.mockImplementation(() => () => undefined);

‎packages/core/src/browser-exports.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ export {
1313

1414
export { startIdleSpan } from './tracing/idleSpan';
1515

16-
export { supportsNativeFetch } from './utils/supports';
1716
export type { XhrBreadcrumbData, XhrBreadcrumbHint } from './types/breadcrumb';
1817
export type { BrowserClientReplayOptions } from './types/browseroptions';

0 commit comments

Comments
 (0)