diff --git a/packages/browser/src/integrations/breadcrumbs.ts b/packages/browser/src/integrations/breadcrumbs.ts index 0fb305767414..efef3f8057cd 100644 --- a/packages/browser/src/integrations/breadcrumbs.ts +++ b/packages/browser/src/integrations/breadcrumbs.ts @@ -70,8 +70,6 @@ const _breadcrumbsIntegration = ((options: Partial = {}) => return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function setup(client) { if (_options.console) { addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client)); diff --git a/packages/browser/src/integrations/dedupe.ts b/packages/browser/src/integrations/dedupe.ts index f4ace6011b19..1e12b5c5a92c 100644 --- a/packages/browser/src/integrations/dedupe.ts +++ b/packages/browser/src/integrations/dedupe.ts @@ -11,8 +11,6 @@ const _dedupeIntegration = (() => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function processEvent(currentEvent) { // We want to ignore any non-error type events, e.g. transactions or replays // These should never be deduped, and also not be compared against as _previousEvent. diff --git a/packages/browser/src/integrations/httpcontext.ts b/packages/browser/src/integrations/httpcontext.ts index 1a5e95f2eee3..5fa59dd3585d 100644 --- a/packages/browser/src/integrations/httpcontext.ts +++ b/packages/browser/src/integrations/httpcontext.ts @@ -8,8 +8,6 @@ const INTEGRATION_NAME = 'HttpContext'; const _httpContextIntegration = (() => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function preprocessEvent(event) { // if none of the information we want exists, don't bother if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) { diff --git a/packages/browser/src/integrations/linkederrors.ts b/packages/browser/src/integrations/linkederrors.ts index b03855303c58..8d15b2055048 100644 --- a/packages/browser/src/integrations/linkederrors.ts +++ b/packages/browser/src/integrations/linkederrors.ts @@ -19,8 +19,6 @@ const _linkedErrorsIntegration = ((options: LinkedErrorsOptions = {}) => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function preprocessEvent(event, hint, client) { const options = client.getOptions(); diff --git a/packages/browser/src/profiling/integration.ts b/packages/browser/src/profiling/integration.ts index 1c076e09b17d..f9b924d9102c 100644 --- a/packages/browser/src/profiling/integration.ts +++ b/packages/browser/src/profiling/integration.ts @@ -22,7 +22,6 @@ const _browserProfilingIntegration = (() => { return { name: INTEGRATION_NAME, // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function setup(client) { const scope = getCurrentScope(); diff --git a/packages/core/src/integration.ts b/packages/core/src/integration.ts index 1e0273d72f2b..ccf1f86cff18 100644 --- a/packages/core/src/integration.ts +++ b/packages/core/src/integration.ts @@ -129,7 +129,7 @@ export function setupIntegration(client: Client, integration: Integration, integ integrationIndex[integration.name] = integration; // `setupOnce` is only called the first time - if (installedIntegrations.indexOf(integration.name) === -1) { + if (installedIntegrations.indexOf(integration.name) === -1 && typeof integration.setupOnce === 'function') { // eslint-disable-next-line deprecation/deprecation integration.setupOnce(addGlobalEventProcessor, getCurrentHub); installedIntegrations.push(integration.name); diff --git a/packages/core/src/integrations/inboundfilters.ts b/packages/core/src/integrations/inboundfilters.ts index 6ed891c253fa..dff1130cb708 100644 --- a/packages/core/src/integrations/inboundfilters.ts +++ b/packages/core/src/integrations/inboundfilters.ts @@ -33,8 +33,6 @@ const INTEGRATION_NAME = 'InboundFilters'; const _inboundFiltersIntegration = ((options: Partial = {}) => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function processEvent(event, _hint, client) { const clientOptions = client.getOptions(); const mergedOptions = _mergeOptions(options, clientOptions); diff --git a/packages/core/src/integrations/linkederrors.ts b/packages/core/src/integrations/linkederrors.ts index e753ca2ccd75..b23eaf4272b0 100644 --- a/packages/core/src/integrations/linkederrors.ts +++ b/packages/core/src/integrations/linkederrors.ts @@ -18,8 +18,6 @@ const _linkedErrorsIntegration = ((options: LinkedErrorsOptions = {}) => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function preprocessEvent(event, hint, client) { const options = client.getOptions(); diff --git a/packages/core/src/integrations/metadata.ts b/packages/core/src/integrations/metadata.ts index 3d5b89e07d2e..99fc4834b060 100644 --- a/packages/core/src/integrations/metadata.ts +++ b/packages/core/src/integrations/metadata.ts @@ -9,8 +9,6 @@ const INTEGRATION_NAME = 'ModuleMetadata'; const _moduleMetadataIntegration = (() => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function setup(client) { // We need to strip metadata from stack frames before sending them to Sentry since these are client side only. client.on('beforeEnvelope', envelope => { diff --git a/packages/core/src/integrations/requestdata.ts b/packages/core/src/integrations/requestdata.ts index 1835fda4ec4a..002673cdc13f 100644 --- a/packages/core/src/integrations/requestdata.ts +++ b/packages/core/src/integrations/requestdata.ts @@ -75,8 +75,6 @@ const _requestDataIntegration = ((options: RequestDataIntegrationOptions = {}) = return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function processEvent(event, _hint, client) { // Note: In the long run, most of the logic here should probably move into the request data utility functions. For // the moment it lives here, though, until https://github.com/getsentry/sentry-javascript/issues/5718 is addressed. diff --git a/packages/deno/src/integrations/context.ts b/packages/deno/src/integrations/context.ts index f844b80be6c8..ca0735c4e0ab 100644 --- a/packages/deno/src/integrations/context.ts +++ b/packages/deno/src/integrations/context.ts @@ -55,8 +55,6 @@ async function addDenoRuntimeContext(event: Event): Promise { const _denoContextIntegration = (() => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function processEvent(event) { return addDenoRuntimeContext(event); }, diff --git a/packages/deno/src/integrations/contextlines.ts b/packages/deno/src/integrations/contextlines.ts index fc51e4ad2d57..4b43c6bc34c2 100644 --- a/packages/deno/src/integrations/contextlines.ts +++ b/packages/deno/src/integrations/contextlines.ts @@ -52,8 +52,6 @@ const _contextLinesIntegration = ((options: ContextLinesOptions = {}) => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function processEvent(event) { return addSourceContext(event, contextLines); }, diff --git a/packages/deno/src/integrations/globalhandlers.ts b/packages/deno/src/integrations/globalhandlers.ts index 2c562a7aa0f9..6498f2e2ffb5 100644 --- a/packages/deno/src/integrations/globalhandlers.ts +++ b/packages/deno/src/integrations/globalhandlers.ts @@ -31,8 +31,6 @@ const _globalHandlersIntegration = ((options?: GlobalHandlersIntegrations) => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function setup(client) { if (_options.error) { installGlobalErrorHandler(client); diff --git a/packages/deno/src/integrations/normalizepaths.ts b/packages/deno/src/integrations/normalizepaths.ts index a9b8f3dbb0e3..d5304e9e62dd 100644 --- a/packages/deno/src/integrations/normalizepaths.ts +++ b/packages/deno/src/integrations/normalizepaths.ts @@ -70,8 +70,6 @@ const _normalizePathsIntegration = (() => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function processEvent(event) { // This error.stack hopefully contains paths that traverse the app cwd const error = new Error(); diff --git a/packages/integrations/src/captureconsole.ts b/packages/integrations/src/captureconsole.ts index 43419dcd32bd..2593ec8de7f2 100644 --- a/packages/integrations/src/captureconsole.ts +++ b/packages/integrations/src/captureconsole.ts @@ -20,8 +20,6 @@ const _captureConsoleIntegration = ((options: CaptureConsoleOptions = {}) => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function setup(client) { if (!('console' in GLOBAL_OBJ)) { return; diff --git a/packages/integrations/src/contextlines.ts b/packages/integrations/src/contextlines.ts index 62c1b2728f1a..8e77ea6f8a08 100644 --- a/packages/integrations/src/contextlines.ts +++ b/packages/integrations/src/contextlines.ts @@ -23,8 +23,6 @@ const _contextLinesIntegration = ((options: ContextLinesOptions = {}) => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function processEvent(event) { return addSourceContext(event, contextLines); }, diff --git a/packages/integrations/src/debug.ts b/packages/integrations/src/debug.ts index 1c1911cd03d8..559041b40d36 100644 --- a/packages/integrations/src/debug.ts +++ b/packages/integrations/src/debug.ts @@ -24,8 +24,6 @@ const _debugIntegration = ((options: DebugOptions = {}) => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function setup(client) { client.on('beforeSendEvent', (event: Event, hint?: EventHint) => { if (_options.debugger) { diff --git a/packages/integrations/src/dedupe.ts b/packages/integrations/src/dedupe.ts index 63db131127c9..5aeafd42e97e 100644 --- a/packages/integrations/src/dedupe.ts +++ b/packages/integrations/src/dedupe.ts @@ -11,8 +11,6 @@ const _dedupeIntegration = (() => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function processEvent(currentEvent) { // We want to ignore any non-error type events, e.g. transactions or replays // These should never be deduped, and also not be compared against as _previousEvent. diff --git a/packages/integrations/src/extraerrordata.ts b/packages/integrations/src/extraerrordata.ts index 21cc91008b7f..fc0c9c05fe58 100644 --- a/packages/integrations/src/extraerrordata.ts +++ b/packages/integrations/src/extraerrordata.ts @@ -27,8 +27,6 @@ const _extraErrorDataIntegration = ((options: Partial = { const { depth = 3, captureErrorCause = true } = options; return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function processEvent(event, hint) { return _enhanceEventWithErrorData(event, hint, depth, captureErrorCause); }, diff --git a/packages/integrations/src/httpclient.ts b/packages/integrations/src/httpclient.ts index 276aadaf9baa..1c93a232104b 100644 --- a/packages/integrations/src/httpclient.ts +++ b/packages/integrations/src/httpclient.ts @@ -47,8 +47,6 @@ const _httpClientIntegration = ((options: Partial = {}) => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function setup(client): void { _wrapFetch(client, _options); _wrapXHR(client, _options); diff --git a/packages/integrations/src/rewriteframes.ts b/packages/integrations/src/rewriteframes.ts index 12183a3192ae..d32252ef15d8 100644 --- a/packages/integrations/src/rewriteframes.ts +++ b/packages/integrations/src/rewriteframes.ts @@ -71,8 +71,6 @@ const _rewriteFramesIntegration = ((options: RewriteFramesOptions = {}) => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function processEvent(originalEvent) { let processedEvent = originalEvent; diff --git a/packages/integrations/src/sessiontiming.ts b/packages/integrations/src/sessiontiming.ts index 2c79dd5cd69a..41af19bed15c 100644 --- a/packages/integrations/src/sessiontiming.ts +++ b/packages/integrations/src/sessiontiming.ts @@ -8,8 +8,6 @@ const _sessionTimingIntegration = (() => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function processEvent(event) { const now = Date.now(); diff --git a/packages/integrations/test/reportingobserver.test.ts b/packages/integrations/test/reportingobserver.test.ts index 8c8088770973..a8766e7cd58c 100644 --- a/packages/integrations/test/reportingobserver.test.ts +++ b/packages/integrations/test/reportingobserver.test.ts @@ -50,7 +50,7 @@ describe('ReportingObserver', () => { const reportingObserver = reportingObserverIntegration(); expect(() => { - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); }).not.toThrow(); expect(mockReportingObserverConstructor).not.toHaveBeenCalled(); @@ -59,7 +59,7 @@ describe('ReportingObserver', () => { it('should use default report types', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); expect(mockReportingObserverConstructor).toHaveBeenCalledTimes(1); @@ -71,7 +71,7 @@ describe('ReportingObserver', () => { it('should use user-provided report types', () => { const reportingObserver = reportingObserverIntegration({ types: ['crash'] }); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); expect(mockReportingObserverConstructor).toHaveBeenCalledTimes(1); @@ -83,7 +83,7 @@ describe('ReportingObserver', () => { it('should use `buffered` option', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); expect(mockReportingObserverConstructor).toHaveBeenCalledTimes(1); @@ -95,7 +95,7 @@ describe('ReportingObserver', () => { it('should call `observe` function', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); expect(mockObserve).toHaveBeenCalledTimes(1); @@ -105,7 +105,7 @@ describe('ReportingObserver', () => { describe('handler', () => { it('should abort gracefully and not do anything when integration is not installed', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); // without calling setup, the integration is not registered const handler = mockReportingObserverConstructor.mock.calls[0][0]; @@ -119,7 +119,7 @@ describe('ReportingObserver', () => { it('should capture messages', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); const handler = mockReportingObserverConstructor.mock.calls[0][0]; @@ -133,7 +133,7 @@ describe('ReportingObserver', () => { it('should set extra including the url of a report', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); const handler = mockReportingObserverConstructor.mock.calls[0][0]; @@ -148,7 +148,7 @@ describe('ReportingObserver', () => { it('should set extra including the report body if available', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); const handler = mockReportingObserverConstructor.mock.calls[0][0]; @@ -163,7 +163,7 @@ describe('ReportingObserver', () => { it('should not set extra report body extra when no body is set', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); const handler = mockReportingObserverConstructor.mock.calls[0][0]; @@ -174,7 +174,7 @@ describe('ReportingObserver', () => { it('should capture report details from body on crash report', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); const handler = mockReportingObserverConstructor.mock.calls[0][0]; @@ -192,7 +192,7 @@ describe('ReportingObserver', () => { it('should capture report message from body on deprecation report', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); const handler = mockReportingObserverConstructor.mock.calls[0][0]; @@ -209,7 +209,7 @@ describe('ReportingObserver', () => { it('should capture report message from body on intervention report', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); const handler = mockReportingObserverConstructor.mock.calls[0][0]; @@ -226,7 +226,7 @@ describe('ReportingObserver', () => { it('should use fallback message when no body is available', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); const handler = mockReportingObserverConstructor.mock.calls[0][0]; @@ -242,7 +242,7 @@ describe('ReportingObserver', () => { it('should use fallback message when no body details are available for crash report', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); const handler = mockReportingObserverConstructor.mock.calls[0][0]; @@ -255,7 +255,7 @@ describe('ReportingObserver', () => { it('should use fallback message when no body message is available for deprecation report', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); const handler = mockReportingObserverConstructor.mock.calls[0][0]; @@ -272,7 +272,7 @@ describe('ReportingObserver', () => { it('should use fallback message when no body message is available for intervention report', () => { const reportingObserver = reportingObserverIntegration(); - reportingObserver.setupOnce(); + reportingObserver.setupOnce!(); reportingObserver.setup?.(mockClient); const handler = mockReportingObserverConstructor.mock.calls[0][0]; diff --git a/packages/node/src/integrations/anr/index.ts b/packages/node/src/integrations/anr/index.ts index 7da63fdc50bd..bfb81557fd75 100644 --- a/packages/node/src/integrations/anr/index.ts +++ b/packages/node/src/integrations/anr/index.ts @@ -55,8 +55,6 @@ const INTEGRATION_NAME = 'Anr'; const _anrIntegration = ((options: Partial = {}) => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function setup(client: NodeClient) { if (NODE_VERSION.major < 16 || (NODE_VERSION.major === 16 && NODE_VERSION.minor < 17)) { throw new Error('ANR detection requires Node 16.17.0 or later'); diff --git a/packages/node/src/integrations/console.ts b/packages/node/src/integrations/console.ts index aacf3447ea2a..5a185b8fcee1 100644 --- a/packages/node/src/integrations/console.ts +++ b/packages/node/src/integrations/console.ts @@ -8,8 +8,6 @@ const INTEGRATION_NAME = 'Console'; const _consoleIntegration = (() => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function setup(client) { addConsoleInstrumentationHandler(({ args, level }) => { if (getClient() !== client) { diff --git a/packages/node/src/integrations/context.ts b/packages/node/src/integrations/context.ts index db712f4ea95d..fa5184204bf2 100644 --- a/packages/node/src/integrations/context.ts +++ b/packages/node/src/integrations/context.ts @@ -102,8 +102,6 @@ const _nodeContextIntegration = ((options: ContextOptions = {}) => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function processEvent(event) { return addContext(event); }, diff --git a/packages/node/src/integrations/contextlines.ts b/packages/node/src/integrations/contextlines.ts index 5e98c7cbb813..2f292a5606dc 100644 --- a/packages/node/src/integrations/contextlines.ts +++ b/packages/node/src/integrations/contextlines.ts @@ -40,8 +40,6 @@ const _contextLinesIntegration = ((options: ContextLinesOptions = {}) => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function processEvent(event) { return addSourceContext(event, contextLines); }, diff --git a/packages/node/src/integrations/local-variables/local-variables-async.ts b/packages/node/src/integrations/local-variables/local-variables-async.ts index b5f015b2b7db..0d04f1f0b6e1 100644 --- a/packages/node/src/integrations/local-variables/local-variables-async.ts +++ b/packages/node/src/integrations/local-variables/local-variables-async.ts @@ -220,8 +220,6 @@ const _localVariablesAsyncIntegration = ((options: LocalVariablesIntegrationOpti return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function setup(client: NodeClient) { const clientOptions = client.getOptions(); diff --git a/packages/node/src/integrations/modules.ts b/packages/node/src/integrations/modules.ts index 008376670724..1f9aff7303e3 100644 --- a/packages/node/src/integrations/modules.ts +++ b/packages/node/src/integrations/modules.ts @@ -79,8 +79,6 @@ function _getModules(): { [key: string]: string } { const _modulesIntegration = (() => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function processEvent(event) { event.modules = { ...event.modules, diff --git a/packages/node/src/integrations/onuncaughtexception.ts b/packages/node/src/integrations/onuncaughtexception.ts index 0eb79833ddbf..68be68a6d6cc 100644 --- a/packages/node/src/integrations/onuncaughtexception.ts +++ b/packages/node/src/integrations/onuncaughtexception.ts @@ -48,8 +48,6 @@ const _onUncaughtExceptionIntegration = ((options: Partial = { return { name: INTEGRATION_NAME, - // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function setup(client) { if (typeof process === 'object' && process.env && process.env.NODE_ENV !== 'development') { logger.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?"); diff --git a/packages/replay-canvas/src/canvas.ts b/packages/replay-canvas/src/canvas.ts index 04f91af7d578..5e3f5ab1b7bd 100644 --- a/packages/replay-canvas/src/canvas.ts +++ b/packages/replay-canvas/src/canvas.ts @@ -66,8 +66,6 @@ export const _replayCanvasIntegration = ((options: Partial return { name: INTEGRATION_NAME, - // eslint-disable-next-line @typescript-eslint/no-empty-function - setupOnce() {}, getOptions(): ReplayCanvasIntegrationOptions { const { quality, enableManualSnapshot } = _canvasOptions; diff --git a/packages/types/src/integration.ts b/packages/types/src/integration.ts index 3c3b44eb0ed8..543238ccc07b 100644 --- a/packages/types/src/integration.ts +++ b/packages/types/src/integration.ts @@ -24,10 +24,8 @@ export interface IntegrationFnResult { /** * This hook is only called once, even if multiple clients are created. * It does not receives any arguments, and should only use for e.g. global monkey patching and similar things. - * - * NOTE: In v8, this will become optional. */ - setupOnce(): void; + setupOnce?(): void; /** * Set up an integration for the given client. @@ -74,10 +72,8 @@ export interface Integration { /** * This hook is only called once, even if multiple clients are created. * It does not receives any arguments, and should only use for e.g. global monkey patching and similar things. - * - * NOTE: In v8, this will become optional, and not receive any arguments anymore. */ - setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void; + setupOnce?(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void; /** * Set up an integration for the given client. diff --git a/packages/vercel-edge/src/integrations/wintercg-fetch.ts b/packages/vercel-edge/src/integrations/wintercg-fetch.ts index 507a34aedab4..436e7f6f9b2d 100644 --- a/packages/vercel-edge/src/integrations/wintercg-fetch.ts +++ b/packages/vercel-edge/src/integrations/wintercg-fetch.ts @@ -87,8 +87,6 @@ const _winterCGFetch = ((options: Partial = {}) => { return { name: INTEGRATION_NAME, - // TODO v8: Remove this again - // eslint-disable-next-line @typescript-eslint/no-empty-function setupOnce() { addFetchInstrumentationHandler(handlerData => { const client = getClient(); diff --git a/packages/vercel-edge/test/wintercg-fetch.test.ts b/packages/vercel-edge/test/wintercg-fetch.test.ts index 2121f037e479..f9e1c3ca8aed 100644 --- a/packages/vercel-edge/test/wintercg-fetch.test.ts +++ b/packages/vercel-edge/test/wintercg-fetch.test.ts @@ -43,7 +43,7 @@ describe('WinterCGFetch instrumentation', () => { addFetchInstrumentationHandlerSpy.mockImplementationOnce(() => undefined); const integration = winterCGFetchIntegration(); - integration.setupOnce(); + integration.setupOnce!(); integration.setup!(client); const [fetchInstrumentationHandlerCallback] = addFetchInstrumentationHandlerSpy.mock.calls[0]; @@ -77,7 +77,7 @@ describe('WinterCGFetch instrumentation', () => { addFetchInstrumentationHandlerSpy.mockImplementationOnce(() => undefined); const integration = winterCGFetchIntegration(); - integration.setupOnce(); + integration.setupOnce!(); // integration.setup!(client) is not called! const [fetchInstrumentationHandlerCallback] = addFetchInstrumentationHandlerSpy.mock.calls[0]; @@ -97,7 +97,7 @@ describe('WinterCGFetch instrumentation', () => { addFetchInstrumentationHandlerSpy.mockImplementationOnce(() => undefined); const integration = winterCGFetchIntegration(); - integration.setupOnce(); + integration.setupOnce!(); integration.setup!(client); const [fetchInstrumentationHandlerCallback] = addFetchInstrumentationHandlerSpy.mock.calls[0]; @@ -121,7 +121,7 @@ describe('WinterCGFetch instrumentation', () => { return url === 'http://only-acceptable-url.com/'; }, }); - integration.setupOnce(); + integration.setupOnce!(); integration.setup!(client); const [fetchInstrumentationHandlerCallback] = addFetchInstrumentationHandlerSpy.mock.calls[0]; @@ -145,7 +145,7 @@ describe('WinterCGFetch instrumentation', () => { addFetchInstrumentationHandlerSpy.mockImplementationOnce(() => undefined); const integration = winterCGFetchIntegration(); - integration.setupOnce(); + integration.setupOnce!(); integration.setup!(client); const [fetchInstrumentationHandlerCallback] = addFetchInstrumentationHandlerSpy.mock.calls[0]; @@ -182,7 +182,7 @@ describe('WinterCGFetch instrumentation', () => { addFetchInstrumentationHandlerSpy.mockImplementationOnce(() => undefined); const integration = winterCGFetchIntegration({ breadcrumbs: false }); - integration.setupOnce(); + integration.setupOnce!(); integration.setup!(client); const [fetchInstrumentationHandlerCallback] = addFetchInstrumentationHandlerSpy.mock.calls[0]; diff --git a/packages/vue/src/integration.ts b/packages/vue/src/integration.ts index 4bd99e3d6c8c..bd528f276ab3 100644 --- a/packages/vue/src/integration.ts +++ b/packages/vue/src/integration.ts @@ -25,7 +25,6 @@ const _vueIntegration = ((integrationOptions: Partial = {}) => { return { name: INTEGRATION_NAME, // TODO v8: Remove this - setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function setup(client) { _setupIntegration(client, integrationOptions); },