Skip to content

Commit a116e73

Browse files
committed
rename undici to nativeNodeFetchIntegration & add migration docs
1 parent b368ab4 commit a116e73

File tree

6 files changed

+49
-38
lines changed

6 files changed

+49
-38
lines changed

MIGRATION.md

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,34 +34,45 @@ integrations from the `Integrations.XXX` hash, is deprecated in favor of using t
3434

3535
The following list shows how integrations should be migrated:
3636

37-
| Old | New | Packages |
38-
| ------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------- |
39-
| `new InboundFilters()` | `inboundFiltersIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
40-
| `new FunctionToString()` | `functionToStringIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
41-
| `new LinkedErrors()` | `linkedErrorsIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
42-
| `new ModuleMetadata()` | `moduleMetadataIntegration()` | `@sentry/core`, `@sentry/browser` |
43-
| `new RequestData()` | `requestDataIntegration()` | `@sentry/core`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
44-
| `new Wasm() ` | `wasmIntegration()` | `@sentry/wasm` |
45-
| `new Replay()` | `replayIntegration()` | `@sentry/browser` |
46-
| `new ReplayCanvas()` | `replayCanvasIntegration()` | `@sentry/browser` |
47-
| `new Feedback()` | `feedbackIntegration()` | `@sentry/browser` |
48-
| `new CaptureConsole()` | `captureConsoleIntegration()` | `@sentry/integrations` |
49-
| `new Debug()` | `debugIntegration()` | `@sentry/integrations` |
50-
| `new Dedupe()` | `dedupeIntegration()` | `@sentry/browser`, `@sentry/integrations`, `@sentry/deno` |
51-
| `new ExtraErrorData()` | `extraErrorDataIntegration()` | `@sentry/integrations` |
52-
| `new ReportingObserver()` | `reportingObserverIntegration()` | `@sentry/integrations` |
53-
| `new RewriteFrames()` | `rewriteFramesIntegration()` | `@sentry/integrations` |
54-
| `new SessionTiming()` | `sessionTimingIntegration()` | `@sentry/integrations` |
55-
| `new HttpClient()` | `httpClientIntegration()` | `@sentry/integrations` |
56-
| `new ContextLines()` | `contextLinesIntegration()` | `@sentry/browser`, `@sentry/deno` |
57-
| `new Breadcrumbs()` | `breadcrumbsIntegration()` | `@sentry/browser`, `@sentry/deno` |
58-
| `new GlobalHandlers()` | `globalHandlersIntegration()` | `@sentry/browser` , `@sentry/deno` |
59-
| `new HttpContext()` | `httpContextIntegration()` | `@sentry/browser` |
60-
| `new TryCatch()` | `browserApiErrorsIntegration()` | `@sentry/browser`, `@sentry/deno` |
61-
| `new VueIntegration()` | `vueIntegration()` | `@sentry/vue` |
62-
| `new DenoContext()` | `denoContextIntegration()` | `@sentry/deno` |
63-
| `new DenoCron()` | `denoCronIntegration()` | `@sentry/deno` |
64-
| `new NormalizePaths()` | `normalizePathsIntegration()` | `@sentry/deno` |
37+
| Old | New | Packages |
38+
| ---------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------- |
39+
| `new InboundFilters()` | `inboundFiltersIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
40+
| `new FunctionToString()` | `functionToStringIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
41+
| `new LinkedErrors()` | `linkedErrorsIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
42+
| `new ModuleMetadata()` | `moduleMetadataIntegration()` | `@sentry/core`, `@sentry/browser` |
43+
| `new RequestData()` | `requestDataIntegration()` | `@sentry/core`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
44+
| `new Wasm() ` | `wasmIntegration()` | `@sentry/wasm` |
45+
| `new Replay()` | `replayIntegration()` | `@sentry/browser` |
46+
| `new ReplayCanvas()` | `replayCanvasIntegration()` | `@sentry/browser` |
47+
| `new Feedback()` | `feedbackIntegration()` | `@sentry/browser` |
48+
| `new CaptureConsole()` | `captureConsoleIntegration()` | `@sentry/integrations` |
49+
| `new Debug()` | `debugIntegration()` | `@sentry/integrations` |
50+
| `new Dedupe()` | `dedupeIntegration()` | `@sentry/browser`, `@sentry/integrations`, `@sentry/deno` |
51+
| `new ExtraErrorData()` | `extraErrorDataIntegration()` | `@sentry/integrations` |
52+
| `new ReportingObserver()` | `reportingObserverIntegration()` | `@sentry/integrations` |
53+
| `new RewriteFrames()` | `rewriteFramesIntegration()` | `@sentry/integrations` |
54+
| `new SessionTiming()` | `sessionTimingIntegration()` | `@sentry/integrations` |
55+
| `new HttpClient()` | `httpClientIntegration()` | `@sentry/integrations` |
56+
| `new ContextLines()` | `contextLinesIntegration()` | `@sentry/browser`, `@sentry/node`, `@sentry/deno` |
57+
| `new Breadcrumbs()` | `breadcrumbsIntegration()` | `@sentry/browser`, `@sentry/deno` |
58+
| `new GlobalHandlers()` | `globalHandlersIntegration()` | `@sentry/browser` , `@sentry/deno` |
59+
| `new HttpContext()` | `httpContextIntegration()` | `@sentry/browser` |
60+
| `new TryCatch()` | `browserApiErrorsIntegration()` | `@sentry/browser`, `@sentry/deno` |
61+
| `new VueIntegration()` | `vueIntegration()` | `@sentry/vue` |
62+
| `new DenoContext()` | `denoContextIntegration()` | `@sentry/deno` |
63+
| `new DenoCron()` | `denoCronIntegration()` | `@sentry/deno` |
64+
| `new NormalizePaths()` | `normalizePathsIntegration()` | `@sentry/deno` |
65+
| `new Console()` | `consoleIntegration()` | `@sentry/node` |
66+
| `new Context()` | `nodeContextIntegration()` | `@sentry/node` |
67+
| `new Modules()` | `modulesIntegration()` | `@sentry/node` |
68+
| `new OnUncaughtException()` | `onUncaughtExceptionIntegration()` | `@sentry/node` |
69+
| `new OnUnhandledRejection()` | `onUnhandledRejectionIntegration()` | `@sentry/node` |
70+
| `new LocalVariables()` | `localVariablesIntegration()` | `@sentry/node` |
71+
| `new Spotlight()` | `spotlightIntergation()` | `@sentry/node` |
72+
| `new Anr()` | `anrIntergation()` | `@sentry/node` |
73+
| `new Hapi()` | `hapiIntegration()` | `@sentry/node` |
74+
| `new Undici()` | `nativeNodeFetchIntegration()` | `@sentry/node` |
75+
| `new Http()` | `httpIntegration()` | `@sentry/node` |
6576

6677
## Deprecate `hub.bindClient()` and `makeMain()`
6778

packages/bun/src/sdk.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import {
1111
httpIntegration,
1212
init as initNode,
1313
modulesIntegration,
14+
nativeNodeFetchintegration,
1415
nodeContextIntegration,
15-
undiciIntegration,
1616
} from '@sentry/node';
1717
import type { Integration, Options } from '@sentry/types';
1818

@@ -31,7 +31,7 @@ export const defaultIntegrations = [
3131
// Native Wrappers
3232
consoleIntegration(),
3333
httpIntegration(),
34-
undiciIntegration(),
34+
nativeNodeFetchintegration(),
3535
// Global Handlers # TODO (waiting for https://github.com/oven-sh/bun/issues/5091)
3636
// new NodeIntegrations.OnUncaughtException(),
3737
// new NodeIntegrations.OnUnhandledRejection(),

packages/node/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export { spotlightIntegration } from './integrations/spotlight';
139139
export { anrIntegration } from './integrations/anr';
140140
export { hapiIntegration } from './integrations/hapi';
141141
// eslint-disable-next-line deprecation/deprecation
142-
export { Undici, undiciIntegration } from './integrations/undici';
142+
export { Undici, nativeNodeFetchintegration } from './integrations/undici';
143143
// eslint-disable-next-line deprecation/deprecation
144144
export { Http, httpIntegration } from './integrations/http';
145145

packages/node/src/integrations/undici/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ export enum ChannelName {
3737
RequestError = 'undici:request:error',
3838
}
3939

40-
const _undiciIntegration = ((options?: UndiciOptions) => {
40+
const _nativeNodeFetchintegration = ((options?: UndiciOptions) => {
4141
// eslint-disable-next-line deprecation/deprecation
4242
return new Undici(options) as unknown as IntegrationFnResult;
4343
}) satisfies IntegrationFn;
4444

45-
export const undiciIntegration = defineIntegration(_undiciIntegration);
45+
export const nativeNodeFetchintegration = defineIntegration(_nativeNodeFetchintegration);
4646

4747
export interface UndiciOptions {
4848
/**
@@ -78,7 +78,7 @@ export interface UndiciOptions {
7878
*
7979
* Requires Node 16.17.0 or higher.
8080
*
81-
* @deprecated Use `undiciIntegration()` instead.
81+
* @deprecated Use `nativeNodeFetchintegration()` instead.
8282
*/
8383
export class Undici implements Integration {
8484
/**

packages/node/src/sdk.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { modulesIntegration } from './integrations/modules';
3333
import { onUncaughtExceptionIntegration } from './integrations/onuncaughtexception';
3434
import { onUnhandledRejectionIntegration } from './integrations/onunhandledrejection';
3535
import { spotlightIntegration } from './integrations/spotlight';
36-
import { undiciIntegration } from './integrations/undici';
36+
import { nativeNodeFetchintegration } from './integrations/undici';
3737
import { createGetModuleFromFilename } from './module';
3838
import { makeNodeTransport } from './transports';
3939
import type { NodeClientOptions, NodeOptions } from './types';
@@ -48,7 +48,7 @@ export const defaultIntegrations = [
4848
// Native Wrappers
4949
consoleIntegration(),
5050
httpIntegration(),
51-
undiciIntegration(),
51+
nativeNodeFetchintegration(),
5252
// Global Handlers
5353
onUncaughtExceptionIntegration(),
5454
onUnhandledRejectionIntegration(),

packages/node/test/integrations/undici.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { fetch as FetchType } from 'undici';
66

77
import { NodeClient } from '../../src/client';
88
import type { UndiciOptions } from '../../src/integrations/undici';
9-
import { undiciIntegration } from '../../src/integrations/undici';
9+
import { nativeNodeFetchintegration } from '../../src/integrations/undici';
1010
import { getDefaultNodeClientOptions } from '../helper/node-client-options';
1111
import { conditionalTest } from '../utils';
1212

@@ -30,7 +30,7 @@ beforeAll(async () => {
3030
const DEFAULT_OPTIONS = getDefaultNodeClientOptions({
3131
dsn: SENTRY_DSN,
3232
tracesSampler: () => true,
33-
integrations: [undiciIntegration()],
33+
integrations: [nativeNodeFetchintegration()],
3434
});
3535

3636
beforeEach(() => {

0 commit comments

Comments
 (0)