Skip to content

Commit cc0599f

Browse files
authored
ref(v8): Remove deprecated methods on scope (#11366)
Removing the last deprecated things from the scope!
1 parent ba9a0f4 commit cc0599f

File tree

3 files changed

+1
-47
lines changed

3 files changed

+1
-47
lines changed

packages/core/src/scope.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,6 @@ export class Scope implements ScopeInterface {
112112
this._propagationContext = generatePropagationContext();
113113
}
114114

115-
/**
116-
* Inherit values from the parent scope.
117-
* @deprecated Use `scope.clone()` and `new Scope()` instead.
118-
*/
119-
public static clone(scope?: Scope): Scope {
120-
return scope ? scope.clone() : new Scope();
121-
}
122-
123115
/**
124116
* @inheritDoc
125117
*/
@@ -469,16 +461,6 @@ export class Scope implements ScopeInterface {
469461
return this;
470462
}
471463

472-
/**
473-
* @inheritDoc
474-
* @deprecated Use `getScopeData()` instead.
475-
*/
476-
public getAttachments(): Attachment[] {
477-
const data = this.getScopeData();
478-
479-
return data.attachments;
480-
}
481-
482464
/**
483465
* @inheritDoc
484466
*/

packages/core/test/lib/scope.test.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Attachment, Breadcrumb, Client, Event, RequestSessionStatus } from '@sentry/types';
1+
import type { Breadcrumb, Client, Event, RequestSessionStatus } from '@sentry/types';
22
import {
33
applyScopeDataToEvent,
44
getCurrentScope,
@@ -543,29 +543,6 @@ describe('Scope', () => {
543543
});
544544
});
545545

546-
describe('getAttachments', () => {
547-
/* eslint-disable deprecation/deprecation */
548-
it('works without any data', async () => {
549-
const scope = new Scope();
550-
551-
const actual = scope.getAttachments();
552-
expect(actual).toEqual([]);
553-
});
554-
555-
it('works with attachments', async () => {
556-
const attachment1 = { filename: '1' } as Attachment;
557-
const attachment2 = { filename: '2' } as Attachment;
558-
559-
const scope = new Scope();
560-
scope.addAttachment(attachment1);
561-
scope.addAttachment(attachment2);
562-
563-
const actual = scope.getAttachments();
564-
expect(actual).toEqual([attachment1, attachment2]);
565-
});
566-
/* eslint-enable deprecation/deprecation */
567-
});
568-
569546
describe('setClient() and getClient()', () => {
570547
it('allows storing and retrieving client objects', () => {
571548
const fakeClient = {} as Client;

packages/types/src/scope.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,6 @@ export interface Scope {
206206
*/
207207
addAttachment(attachment: Attachment): this;
208208

209-
/**
210-
* Returns an array of attachments on the scope
211-
*/
212-
getAttachments(): Attachment[];
213-
214209
/**
215210
* Clears attachments from the scope
216211
*/

0 commit comments

Comments
 (0)