Skip to content

Commit 7d3a3bf

Browse files
timfishlobsterkatie
authored andcommitted
[v7] feat(node): Remove deprecated frameContextLines (#4884)
This PR removes the previously deprecated `frameContextLines` from `NodeOptions`.
1 parent 780512b commit 7d3a3bf

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

Diff for: packages/node/src/integrations/contextlines.ts

-13
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import { getCurrentHub } from '@sentry/core';
21
import { Event, EventProcessor, Integration, StackFrame } from '@sentry/types';
32
import { addContextToFrame } from '@sentry/utils';
43
import { readFile } from 'fs';
54
import { LRUMap } from 'lru_map';
65

7-
import { NodeClient } from '../client';
8-
96
const FILE_CONTENT_CACHE = new LRUMap<string, string | null>(100);
107
const DEFAULT_LINES_OF_CONTEXT = 7;
118

@@ -53,16 +50,6 @@ export class ContextLines implements Integration {
5350

5451
/** Get's the number of context lines to add */
5552
private get _contextLines(): number {
56-
// This is only here to copy frameContextLines from init options if it hasn't
57-
// been set via this integrations constructor.
58-
//
59-
// TODO: Remove on next major!
60-
if (this._options.frameContextLines === undefined) {
61-
const initOptions = getCurrentHub().getClient<NodeClient>()?.getOptions();
62-
// eslint-disable-next-line deprecation/deprecation
63-
this._options.frameContextLines = initOptions?.frameContextLines;
64-
}
65-
6653
return this._options.frameContextLines !== undefined ? this._options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;
6754
}
6855

Diff for: packages/node/src/types.ts

-15
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,6 @@ export interface NodeOptions extends Options {
2020
/** HTTPS proxy certificates path */
2121
caCerts?: string;
2222

23-
/**
24-
* Sets the number of context lines for each frame when loading a file.
25-
*
26-
* @deprecated Context lines configuration has moved to the `ContextLines` integration, and can be used like this:
27-
*
28-
* ```
29-
* init({
30-
* dsn: '__DSN__',
31-
* integrations: [new ContextLines({ frameContextLines: 10 })]
32-
* })
33-
* ```
34-
*
35-
* */
36-
frameContextLines?: number;
37-
3823
/** Callback that is executed when a fatal global error occurs. */
3924
onFatalError?(error: Error): void;
4025
}

0 commit comments

Comments
 (0)