Skip to content

[v7] Remove deprecated frameContextLines #4884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions packages/node/src/integrations/contextlines.ts
Original file line number Diff line number Diff line change
@@ -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<string, string | null>(100);
const DEFAULT_LINES_OF_CONTEXT = 7;

Expand Down Expand Up @@ -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<NodeClient>()?.getOptions();
// eslint-disable-next-line deprecation/deprecation
this._options.frameContextLines = initOptions?.frameContextLines;
}

return this._options.frameContextLines !== undefined ? this._options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;
}

Expand Down
15 changes: 0 additions & 15 deletions packages/node/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}