Skip to content

Commit 026622a

Browse files
committed
feat(v8): Remove deprecated integration methods on client
1 parent b0e1db0 commit 026622a

File tree

6 files changed

+7
-37
lines changed

6 files changed

+7
-37
lines changed

dev-packages/browser-integration-tests/suites/replay/canvas/manualSnapshot/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ sentryTest('can manually snapshot canvas', async ({ getLocalTestUrl, page, brows
3131
expect(incrementalSnapshots).toEqual([]);
3232

3333
await page.evaluate(() => {
34-
(window as any).Sentry.getClient().getIntegrationById('ReplayCanvas').snapshot();
34+
(window as any).Sentry.getClient().getIntegrationByName('ReplayCanvas').snapshot();
3535
});
3636

3737
const { incrementalSnapshots: incrementalSnapshotsManual } = getReplayRecordingContent(await reqPromise3);

packages/core/src/baseclient.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import type {
1515
EventProcessor,
1616
FeedbackEvent,
1717
Integration,
18-
IntegrationClass,
1918
Outcome,
2019
ParameterizedString,
2120
SdkMetadata,
@@ -317,16 +316,6 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
317316
}
318317
}
319318

320-
/**
321-
* Gets an installed integration by its `id`.
322-
*
323-
* @returns The installed integration or `undefined` if no integration with that `id` was installed.
324-
* @deprecated Use `getIntegrationByName()` instead.
325-
*/
326-
public getIntegrationById(integrationId: string): Integration | undefined {
327-
return this.getIntegrationByName(integrationId);
328-
}
329-
330319
/**
331320
* Gets an installed integration by its name.
332321
*
@@ -336,19 +325,6 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
336325
return this._integrations[integrationName] as T | undefined;
337326
}
338327

339-
/**
340-
* Returns the client's instance of the given integration class, it any.
341-
* @deprecated Use `getIntegrationByName()` instead.
342-
*/
343-
public getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null {
344-
try {
345-
return (this._integrations[integration.id] as T) || null;
346-
} catch (_oO) {
347-
DEBUG_BUILD && logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);
348-
return null;
349-
}
350-
}
351-
352328
/**
353329
* @inheritDoc
354330
*/

packages/core/src/hub.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,7 @@ export class Hub implements HubInterface {
428428
const client = this.getClient();
429429
if (!client) return null;
430430
try {
431-
// eslint-disable-next-line deprecation/deprecation
432-
return client.getIntegration(integration);
431+
return client.getIntegrationByName<T>(integration.id) || null;
433432
} catch (_oO) {
434433
DEBUG_BUILD && logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);
435434
return null;

packages/node-experimental/src/sdk/hub.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ export function getCurrentHub(): Hub {
6262
setContext,
6363

6464
getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null {
65-
// eslint-disable-next-line deprecation/deprecation
66-
return getClient().getIntegration(integration);
65+
return getClient().getIntegrationByName<T>(integration.id) || null;
6766
},
6867

6968
startSession,

packages/node/src/integrations/undici/index.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ export class Undici implements Integration {
170170
}
171171

172172
private _onRequestCreate = (message: unknown): void => {
173-
// eslint-disable-next-line deprecation/deprecation
174-
if (!getClient()?.getIntegration(Undici)) {
173+
if (!getClient()?.getIntegrationByName('Undici')) {
175174
return;
176175
}
177176

@@ -229,8 +228,7 @@ export class Undici implements Integration {
229228
};
230229

231230
private _onRequestEnd = (message: unknown): void => {
232-
// eslint-disable-next-line deprecation/deprecation
233-
if (!getClient()?.getIntegration(Undici)) {
231+
if (!getClient()?.getIntegrationByName('Undici')) {
234232
return;
235233
}
236234

@@ -269,8 +267,7 @@ export class Undici implements Integration {
269267
};
270268

271269
private _onRequestError = (message: unknown): void => {
272-
// eslint-disable-next-line deprecation/deprecation
273-
if (!getClient()?.getIntegration(Undici)) {
270+
if (!getClient()?.getIntegrationByName('Undici')) {
274271
return;
275272
}
276273

packages/opentelemetry/src/custom/getCurrentHub.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ export function getCurrentHub(): Hub {
6262
setContext,
6363

6464
getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null {
65-
// eslint-disable-next-line deprecation/deprecation
66-
return getClient()?.getIntegration(integration) || null;
65+
return getClient()?.getIntegrationByName<T>(integration) || null;
6766
},
6867

6968
startSession,

0 commit comments

Comments
 (0)