Skip to content

Commit 12babda

Browse files
committed
feat(v8/node): Remove deprecated anr methods
1 parent ca6010b commit 12babda

File tree

15 files changed

+9
-104
lines changed

15 files changed

+9
-104
lines changed

dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const DEPENDENTS: Dependent[] = [
6060
{
6161
package: '@sentry/serverless',
6262
exports: Object.keys(SentryServerless),
63-
ignoreExports: ['cron', 'hapiErrorPlugin', 'enableAnrDetection'],
63+
ignoreExports: ['cron', 'hapiErrorPlugin'],
6464
},
6565
{
6666
package: '@sentry/sveltekit',

dev-packages/node-integration-tests/suites/anr/basic-session.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Sentry.init({
1111
dsn: 'https://[email protected]/1337',
1212
release: '1.0',
1313
debug: true,
14-
integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true, anrThreshold: 100 })],
14+
integrations: [Sentry.anrIntegration({ captureStackTrace: true, anrThreshold: 100 })],
1515
});
1616

1717
function longWork() {

dev-packages/node-integration-tests/suites/anr/basic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Sentry.init({
1212
release: '1.0',
1313
debug: true,
1414
autoSessionTracking: false,
15-
integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true, anrThreshold: 100 })],
15+
integrations: [Sentry.anrIntegration({ captureStackTrace: true, anrThreshold: 100 })],
1616
});
1717

1818
function longWork() {

dev-packages/node-integration-tests/suites/anr/basic.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Sentry.init({
1212
release: '1.0',
1313
debug: true,
1414
autoSessionTracking: false,
15-
integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true, anrThreshold: 100 })],
15+
integrations: [Sentry.anrIntegration({ captureStackTrace: true, anrThreshold: 100 })],
1616
});
1717

1818
function longWork() {

dev-packages/node-integration-tests/suites/anr/forked.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Sentry.init({
1212
release: '1.0',
1313
debug: true,
1414
autoSessionTracking: false,
15-
integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true, anrThreshold: 100 })],
15+
integrations: [Sentry.anrIntegration({ captureStackTrace: true, anrThreshold: 100 })],
1616
});
1717

1818
function longWork() {

dev-packages/node-integration-tests/suites/anr/legacy.js

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

dev-packages/node-integration-tests/suites/anr/should-exit-forced.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function configureSentry() {
66
release: '1.0',
77
debug: true,
88
autoSessionTracking: false,
9-
integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true })],
9+
integrations: [Sentry.anrIntegration({ captureStackTrace: true })],
1010
});
1111
}
1212

dev-packages/node-integration-tests/suites/anr/should-exit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function configureSentry() {
66
release: '1.0',
77
debug: true,
88
autoSessionTracking: false,
9-
integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true })],
9+
integrations: [Sentry.anrIntegration({ captureStackTrace: true })],
1010
});
1111
}
1212

dev-packages/node-integration-tests/suites/anr/test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ conditionalTest({ min: 16 })('should report ANR when event loop blocked', () =>
5656
cleanupChildProcesses();
5757
});
5858

59-
// TODO (v8): Remove this old API and this test
60-
test('Legacy API', done => {
61-
createRunner(__dirname, 'legacy.js').expect({ event: EXPECTED_ANR_EVENT }).start(done);
62-
});
63-
6459
test('CJS', done => {
6560
createRunner(__dirname, 'basic.js').expect({ event: EXPECTED_ANR_EVENT }).start(done);
6661
});

packages/bun/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ export {
9292
// eslint-disable-next-line deprecation/deprecation
9393
deepReadDirSync,
9494
// eslint-disable-next-line deprecation/deprecation
95-
enableAnrDetection,
96-
// eslint-disable-next-line deprecation/deprecation
9795
getModuleFromFilename,
9896
DEFAULT_USER_INCLUDES,
9997
autoDiscoverNodePerformanceMonitoringIntegrations,

packages/node/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ import { createGetModuleFromFilename } from './module';
112112
export const getModuleFromFilename = createGetModuleFromFilename();
113113
export { createGetModuleFromFilename };
114114

115-
// eslint-disable-next-line deprecation/deprecation
116-
export { enableAnrDetection } from './integrations/anr/legacy';
117-
118115
import { Integrations as CoreIntegrations } from '@sentry/core';
119116

120117
import * as Handlers from './handlers';

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

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// TODO (v8): This import can be removed once we only support Node with global URL
22
import { URL } from 'url';
3-
import { convertIntegrationFnToClass, defineIntegration, getCurrentScope } from '@sentry/core';
4-
import type { Client, Contexts, Event, EventHint, Integration, IntegrationClass, IntegrationFn } from '@sentry/types';
3+
import { defineIntegration, getCurrentScope } from '@sentry/core';
4+
import type { Contexts, Event, EventHint, IntegrationFn } from '@sentry/types';
55
import { dynamicRequire, logger } from '@sentry/utils';
66
import type { Worker, WorkerOptions } from 'worker_threads';
77
import type { NodeClient } from '../../client';
@@ -70,23 +70,6 @@ const _anrIntegration = ((options: Partial<AnrIntegrationOptions> = {}) => {
7070

7171
export const anrIntegration = defineIntegration(_anrIntegration);
7272

73-
/**
74-
* Starts a thread to detect App Not Responding (ANR) events
75-
*
76-
* ANR detection requires Node 16.17.0 or later
77-
*
78-
* @deprecated Use `anrIntegration()` instead.
79-
*/
80-
// eslint-disable-next-line deprecation/deprecation
81-
export const Anr = convertIntegrationFnToClass(INTEGRATION_NAME, anrIntegration) as IntegrationClass<
82-
Integration & { setup: (client: NodeClient) => void }
83-
> & {
84-
new (options?: Partial<AnrIntegrationOptions>): Integration & { setup(client: Client): void };
85-
};
86-
87-
// eslint-disable-next-line deprecation/deprecation
88-
export type Anr = typeof Anr;
89-
9073
/**
9174
* Starts the ANR worker thread
9275
*/

packages/node/src/integrations/anr/legacy.ts

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

packages/remix/src/index.server.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ export {
102102
createGetModuleFromFilename,
103103
hapiErrorPlugin,
104104
runWithAsyncContext,
105-
// eslint-disable-next-line deprecation/deprecation
106-
enableAnrDetection,
107105
} from '@sentry/node';
108106

109107
// Keeping the `*` exports for backwards compatibility and types

packages/sveltekit/src/server/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ export {
9797
hapiErrorPlugin,
9898
metrics,
9999
runWithAsyncContext,
100-
// eslint-disable-next-line deprecation/deprecation
101-
enableAnrDetection,
102100
} from '@sentry/node';
103101

104102
// We can still leave this for the carrier init and type exports

0 commit comments

Comments
 (0)