Skip to content

Commit 2c09292

Browse files
authored
feat(v8): Remove deprecated integration methods on client (#11134)
Removes `getIntegrationById` and `getIntegration` methods on client. Doesn't touch anything on the hub because we want to shim those methods.
1 parent d26b25d commit 2c09292

File tree

15 files changed

+22
-60
lines changed

15 files changed

+22
-60
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ jobs:
611611
name: Playwright (${{ matrix.bundle }}${{ matrix.shard && format(' {0}/{1}', matrix.shard, matrix.shards) || ''}}) Tests
612612
needs: [job_get_metadata, job_build]
613613
if: needs.job_get_metadata.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
614-
runs-on: ubuntu-20.04
614+
runs-on: ubuntu-20.04-large-js
615615
timeout-minutes: 25
616616
strategy:
617617
fail-fast: false

MIGRATION.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ Removed top-level exports: `tracingOrigins`, `MetricsAggregator`, `metricsAggreg
355355
`Sentry.configureScope`, `Span`, `spanStatusfromHttpCode`, `makeMain`, `lastEventId`, `pushScope`, `popScope`,
356356
`addGlobalEventProcessor`, `timestampWithMs`, `addExtensionMethods`
357357

358+
Remove util exports: `timestampWithMs`
359+
358360
- [Deprecation of `Hub` and `getCurrentHub()`](./MIGRATION.md#deprecate-hub)
359361
- [Removal of class-based integrations](./MIGRATION.md#removal-of-class-based-integrations)
360362
- [`tracingOrigins` option replaced with `tracePropagationTargets`](./MIGRATION.md#tracingorigins-has-been-replaced-by-tracepropagationtargets)

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);

dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseBody/test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ sentryTest('captures non-text response body', async ({ getLocalTestPath, page, b
254254
]);
255255
});
256256

257-
sentryTest('does not capture response body when URL does not match', async ({ getLocalTestPath, page }) => {
257+
// This test is flaky
258+
// See: https://github.com/getsentry/sentry-javascript/issues/11136
259+
sentryTest.skip('does not capture response body when URL does not match', async ({ getLocalTestPath, page }) => {
258260
if (shouldSkipReplayTest()) {
259261
sentryTest.skip();
260262
}

dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseHeaders/test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ sentryTest('captures response headers', async ({ getLocalTestPath, page }) => {
157157
]);
158158
});
159159

160-
sentryTest('does not capture response headers if URL does not match', async ({ getLocalTestPath, page }) => {
160+
// This test is flaky so it's skipped for now
161+
// See https://github.com/getsentry/sentry-javascript/issues/11139
162+
sentryTest.skip('does not capture response headers if URL does not match', async ({ getLocalTestPath, page }) => {
161163
if (shouldSkipReplayTest()) {
162164
sentryTest.skip();
163165
}

dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseSize/test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ sentryTest('captures response size without Content-Length header', async ({ getL
188188
]);
189189
});
190190

191-
sentryTest('captures response size from non-text response body', async ({ getLocalTestPath, page }) => {
191+
// This test is flaky so it's skipped for now
192+
// See https://github.com/getsentry/sentry-javascript/issues/11137
193+
sentryTest.skip('captures response size from non-text response body', async ({ getLocalTestPath, page }) => {
192194
if (shouldSkipReplayTest()) {
193195
sentryTest.skip();
194196
}

dev-packages/browser-integration-tests/suites/tracing/metrics/handlers-lcp/test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../.
77

88
const bundle = process.env.PW_BUNDLE || '';
99

10-
sentryTest(
10+
// This test is flaky so it's skipped for now
11+
// See https://github.com/getsentry/sentry-javascript/issues/11138
12+
sentryTest.skip(
1113
'should capture metrics for LCP instrumentation handlers',
1214
async ({ browserName, getLocalTestPath, page }) => {
1315
// This uses a utility that is not exported in CDN bundles

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/core/test/lib/base.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ jest.mock('@sentry/utils', () => {
4242
truncate(str: string): string {
4343
return str;
4444
},
45-
timestampWithMs(): number {
46-
return 2020;
47-
},
4845
dateTimestampInSeconds(): number {
4946
return 2020;
5047
},

0 commit comments

Comments
 (0)