From 7d3a3bfa2cf9de1289d42fa10ce565c7a8e6885a Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Thu, 7 Apr 2022 16:01:27 +0100 Subject: [PATCH] [v7] feat(node): Remove deprecated `frameContextLines` (#4884) This PR removes the previously deprecated `frameContextLines` from `NodeOptions`. --- packages/node/src/integrations/contextlines.ts | 13 ------------- packages/node/src/types.ts | 15 --------------- 2 files changed, 28 deletions(-) diff --git a/packages/node/src/integrations/contextlines.ts b/packages/node/src/integrations/contextlines.ts index e18768b2fe3d..cad196342f28 100644 --- a/packages/node/src/integrations/contextlines.ts +++ b/packages/node/src/integrations/contextlines.ts @@ -1,11 +1,8 @@ -import { getCurrentHub } from '@sentry/core'; import { Event, EventProcessor, Integration, StackFrame } from '@sentry/types'; import { addContextToFrame } from '@sentry/utils'; import { readFile } from 'fs'; import { LRUMap } from 'lru_map'; -import { NodeClient } from '../client'; - const FILE_CONTENT_CACHE = new LRUMap(100); const DEFAULT_LINES_OF_CONTEXT = 7; @@ -53,16 +50,6 @@ export class ContextLines implements Integration { /** Get's the number of context lines to add */ private get _contextLines(): number { - // This is only here to copy frameContextLines from init options if it hasn't - // been set via this integrations constructor. - // - // TODO: Remove on next major! - if (this._options.frameContextLines === undefined) { - const initOptions = getCurrentHub().getClient()?.getOptions(); - // eslint-disable-next-line deprecation/deprecation - this._options.frameContextLines = initOptions?.frameContextLines; - } - return this._options.frameContextLines !== undefined ? this._options.frameContextLines : DEFAULT_LINES_OF_CONTEXT; } diff --git a/packages/node/src/types.ts b/packages/node/src/types.ts index 6c6651bc7b88..055006a47e9e 100644 --- a/packages/node/src/types.ts +++ b/packages/node/src/types.ts @@ -20,21 +20,6 @@ export interface NodeOptions extends Options { /** HTTPS proxy certificates path */ caCerts?: string; - /** - * Sets the number of context lines for each frame when loading a file. - * - * @deprecated Context lines configuration has moved to the `ContextLines` integration, and can be used like this: - * - * ``` - * init({ - * dsn: '__DSN__', - * integrations: [new ContextLines({ frameContextLines: 10 })] - * }) - * ``` - * - * */ - frameContextLines?: number; - /** Callback that is executed when a fatal global error occurs. */ onFatalError?(error: Error): void; }