Skip to content

Commit 85ac26f

Browse files
authored
feat(v8/deno): Remove deprecations from deno SDK (#10972)
1 parent 7b8874e commit 85ac26f

File tree

11 files changed

+286
-110
lines changed

11 files changed

+286
-110
lines changed

packages/deno/src/index.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ export type { AddRequestDataToEventOptions } from '@sentry/utils';
2121
export type { DenoOptions } from './types';
2222

2323
export {
24-
// eslint-disable-next-line deprecation/deprecation
25-
addGlobalEventProcessor,
2624
addEventProcessor,
2725
addBreadcrumb,
2826
captureException,
@@ -32,22 +30,14 @@ export {
3230
createTransport,
3331
continueTrace,
3432
flush,
35-
// eslint-disable-next-line deprecation/deprecation
36-
getActiveTransaction,
37-
// eslint-disable-next-line deprecation/deprecation
38-
getCurrentHub,
3933
getClient,
4034
isInitialized,
4135
getCurrentScope,
4236
getGlobalScope,
4337
getIsolationScope,
4438
Hub,
45-
// eslint-disable-next-line deprecation/deprecation
46-
makeMain,
4739
setCurrentClient,
4840
Scope,
49-
// eslint-disable-next-line deprecation/deprecation
50-
startTransaction,
5141
SDK_VERSION,
5242
setContext,
5343
setExtra,
@@ -99,10 +89,3 @@ export { normalizePathsIntegration } from './integrations/normalizepaths';
9989
export { contextLinesIntegration } from './integrations/contextlines';
10090
export { denoCronIntegration } from './integrations/deno-cron';
10191
export { breadcrumbsIntegration } from './integrations/breadcrumbs';
102-
103-
import * as DenoIntegrations from './integrations';
104-
105-
/** @deprecated Import the integration function directly, e.g. `inboundFiltersIntegration()` instead of `new Integrations.InboundFilter(). */
106-
export const Integrations = {
107-
...DenoIntegrations,
108-
};

packages/deno/src/integrations/breadcrumbs.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ interface BreadcrumbsOptions {
1717

1818
const INTEGRATION_NAME = 'Breadcrumbs';
1919

20+
/**
21+
* Note: This `breadcrumbsIntegration` is almost the same as the one from @sentry/browser.
22+
* The Deno-version does not support browser-specific APIs like dom, xhr and history.
23+
*/
2024
const _breadcrumbsIntegration = ((options: Partial<BreadcrumbsOptions> = {}) => {
2125
const _options = {
2226
console: true,
@@ -42,8 +46,17 @@ const _breadcrumbsIntegration = ((options: Partial<BreadcrumbsOptions> = {}) =>
4246
}) satisfies IntegrationFn;
4347

4448
/**
45-
* This breadcrumbsIntegration is almost the same as the one from @sentry/browser.
46-
* The Deno-version does not support browser-specific APIs like dom, xhr and history.
49+
* Adds a breadcrumbs for console, fetch, and sentry events.
50+
*
51+
* Enabled by default in the Deno SDK.
52+
*
53+
* ```js
54+
* Sentry.init({
55+
* integrations: [
56+
* Sentry.breadcrumbsIntegration(),
57+
* ],
58+
* })
59+
* ```
4760
*/
4861
export const breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration);
4962

packages/deno/src/integrations/context.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { convertIntegrationFnToClass, defineIntegration } from '@sentry/core';
2-
import type { Event, Integration, IntegrationClass, IntegrationFn } from '@sentry/types';
1+
import { defineIntegration } from '@sentry/core';
2+
import type { Event, IntegrationFn } from '@sentry/types';
33

44
const INTEGRATION_NAME = 'DenoContext';
55

@@ -61,16 +61,17 @@ const _denoContextIntegration = (() => {
6161
};
6262
}) satisfies IntegrationFn;
6363

64-
export const denoContextIntegration = defineIntegration(_denoContextIntegration);
65-
6664
/**
67-
* Adds Deno context to events.
68-
* @deprecated Use `denoContextintegration()` instead.
65+
* Adds Deno related context to events. This includes contexts about app, device, os, v8, and TypeScript.
66+
*
67+
* Enabled by default in the Deno SDK.
68+
*
69+
* ```js
70+
* Sentry.init({
71+
* integrations: [
72+
* Sentry.denoContextIntegration(),
73+
* ],
74+
* })
75+
* ```
6976
*/
70-
// eslint-disable-next-line deprecation/deprecation
71-
export const DenoContext = convertIntegrationFnToClass(INTEGRATION_NAME, denoContextIntegration) as IntegrationClass<
72-
Integration & { processEvent: (event: Event) => Promise<Event> }
73-
>;
74-
75-
// eslint-disable-next-line deprecation/deprecation
76-
export type DenoContext = typeof DenoContext;
77+
export const denoContextIntegration = defineIntegration(_denoContextIntegration);

packages/deno/src/integrations/contextlines.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { convertIntegrationFnToClass, defineIntegration } from '@sentry/core';
2-
import type { Event, Integration, IntegrationClass, IntegrationFn, StackFrame } from '@sentry/types';
1+
import { defineIntegration } from '@sentry/core';
2+
import type { Event, IntegrationFn, StackFrame } from '@sentry/types';
33
import { LRUMap, addContextToFrame } from '@sentry/utils';
44

55
const INTEGRATION_NAME = 'ContextLines';
@@ -58,19 +58,20 @@ const _contextLinesIntegration = ((options: ContextLinesOptions = {}) => {
5858
};
5959
}) satisfies IntegrationFn;
6060

61-
export const contextLinesIntegration = defineIntegration(_contextLinesIntegration);
62-
6361
/**
64-
* Add node modules / packages to the event.
65-
* @deprecated Use `contextLinesIntegration()` instead.
62+
* Adds source context to event stacktraces.
63+
*
64+
* Enabled by default in the Deno SDK.
65+
*
66+
* ```js
67+
* Sentry.init({
68+
* integrations: [
69+
* Sentry.contextLinesIntegration(),
70+
* ],
71+
* })
72+
* ```
6673
*/
67-
// eslint-disable-next-line deprecation/deprecation
68-
export const ContextLines = convertIntegrationFnToClass(INTEGRATION_NAME, contextLinesIntegration) as IntegrationClass<
69-
Integration & { processEvent: (event: Event) => Promise<Event> }
70-
>;
71-
72-
// eslint-disable-next-line deprecation/deprecation
73-
export type ContextLines = typeof ContextLines;
74+
export const contextLinesIntegration = defineIntegration(_contextLinesIntegration);
7475

7576
/** Processes an event and adds context lines */
7677
async function addSourceContext(event: Event, contextLines: number): Promise<Event> {

packages/deno/src/integrations/deno-cron.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { convertIntegrationFnToClass, defineIntegration, getClient, withMonitor } from '@sentry/core';
2-
import type { Client, Integration, IntegrationClass, IntegrationFn } from '@sentry/types';
1+
import { defineIntegration, getClient, withMonitor } from '@sentry/core';
2+
import type { Client, IntegrationFn } from '@sentry/types';
33
import { parseScheduleToString } from './deno-cron-format';
44

55
type CronOptions = { backoffSchedule?: number[]; signal?: AbortSignal };
@@ -60,16 +60,17 @@ const _denoCronIntegration = (() => {
6060
};
6161
}) satisfies IntegrationFn;
6262

63-
export const denoCronIntegration = defineIntegration(_denoCronIntegration);
64-
6563
/**
6664
* Instruments Deno.cron to automatically capture cron check-ins.
67-
* @deprecated Use `denoCronIntegration()` instead.
65+
*
66+
* Enabled by default in the Deno SDK.
67+
*
68+
* ```js
69+
* Sentry.init({
70+
* integrations: [
71+
* Sentry.denoCronIntegration(),
72+
* ],
73+
* })
74+
* ```
6875
*/
69-
// eslint-disable-next-line deprecation/deprecation
70-
export const DenoCron = convertIntegrationFnToClass(INTEGRATION_NAME, denoCronIntegration) as IntegrationClass<
71-
Integration & { setup: (client: Client) => void }
72-
>;
73-
74-
// eslint-disable-next-line deprecation/deprecation
75-
export type DenoCron = typeof DenoCron;
76+
export const denoCronIntegration = defineIntegration(_denoCronIntegration);

packages/deno/src/integrations/globalhandlers.ts

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
import type { ServerRuntimeClient } from '@sentry/core';
22
import { defineIntegration } from '@sentry/core';
3-
import { convertIntegrationFnToClass } from '@sentry/core';
43
import { captureEvent } from '@sentry/core';
54
import { getClient } from '@sentry/core';
65
import { flush } from '@sentry/core';
7-
import type {
8-
Client,
9-
Event,
10-
Integration,
11-
IntegrationClass,
12-
IntegrationFn,
13-
Primitive,
14-
StackParser,
15-
} from '@sentry/types';
6+
import type { Client, Event, IntegrationFn, Primitive, StackParser } from '@sentry/types';
167
import { eventFromUnknownInput, isPrimitive } from '@sentry/utils';
178

189
type GlobalHandlersIntegrationsOptionKeys = 'error' | 'unhandledrejection';
@@ -42,20 +33,20 @@ const _globalHandlersIntegration = ((options?: GlobalHandlersIntegrations) => {
4233
};
4334
}) satisfies IntegrationFn;
4435

45-
export const globalHandlersIntegration = defineIntegration(_globalHandlersIntegration);
46-
4736
/**
48-
* Global handlers.
49-
* @deprecated Use `globalHandlersIntegration()` instead.
37+
* Instruments global `error` and `unhandledrejection` listeners in Deno.
38+
*
39+
* Enabled by default in the Deno SDK.
40+
*
41+
* ```js
42+
* Sentry.init({
43+
* integrations: [
44+
* Sentry.globalHandlersIntegration(),
45+
* ],
46+
* })
47+
* ```
5048
*/
51-
// eslint-disable-next-line deprecation/deprecation
52-
export const GlobalHandlers = convertIntegrationFnToClass(
53-
INTEGRATION_NAME,
54-
globalHandlersIntegration,
55-
) as IntegrationClass<Integration & { setup: (client: Client) => void }>;
56-
57-
// eslint-disable-next-line deprecation/deprecation
58-
export type GlobalHandlers = typeof GlobalHandlers;
49+
export const globalHandlersIntegration = defineIntegration(_globalHandlersIntegration);
5950

6051
function installGlobalErrorHandler(client: Client): void {
6152
globalThis.addEventListener('error', data => {

packages/deno/src/integrations/index.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/deno/src/integrations/normalizepaths.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { convertIntegrationFnToClass, defineIntegration } from '@sentry/core';
2-
import type { Event, Integration, IntegrationClass, IntegrationFn } from '@sentry/types';
1+
import { defineIntegration } from '@sentry/core';
2+
import type { IntegrationFn } from '@sentry/types';
33
import { createStackParser, dirname, nodeStackLineParser } from '@sentry/utils';
44

55
const INTEGRATION_NAME = 'NormalizePaths';
@@ -96,17 +96,17 @@ const _normalizePathsIntegration = (() => {
9696
};
9797
}) satisfies IntegrationFn;
9898

99-
export const normalizePathsIntegration = defineIntegration(_normalizePathsIntegration);
100-
10199
/**
102100
* Normalises paths to the app root directory.
103-
* @deprecated Use `normalizePathsIntegration()` instead.
101+
*
102+
* Enabled by default in the Deno SDK.
103+
*
104+
* ```js
105+
* Sentry.init({
106+
* integrations: [
107+
* Sentry.normalizePathsIntegration(),
108+
* ],
109+
* })
110+
* ```
104111
*/
105-
// eslint-disable-next-line deprecation/deprecation
106-
export const NormalizePaths = convertIntegrationFnToClass(
107-
INTEGRATION_NAME,
108-
normalizePathsIntegration,
109-
) as IntegrationClass<Integration & { processEvent: (event: Event) => Event }>;
110-
111-
// eslint-disable-next-line deprecation/deprecation
112-
export type NormalizePaths = typeof NormalizePaths;
112+
export const normalizePathsIntegration = defineIntegration(_normalizePathsIntegration);

0 commit comments

Comments
 (0)