Skip to content

Commit 9fc40f2

Browse files
committed
PR cleanup
1 parent fdc7597 commit 9fc40f2

6 files changed

Lines changed: 8 additions & 15 deletions

File tree

packages/ember/addon/instance-initializers/sentry-performance.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable max-lines */
21
import type ApplicationInstance from '@ember/application/instance';
32
import { instrumentForPerformance, getSentryConfig } from '../utils/performance';
43

packages/ember/addon/utils/browserTracingIntegration.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { BrowserClient } from '@sentry/browser';
21
import {
32
browserTracingIntegration as originalBrowserTracingIntegration,
43
startBrowserTracingNavigationSpan,
@@ -51,7 +50,7 @@ export function browserTracingIntegration(options: EmberBrowserTracingIntegratio
5150

5251
return {
5352
...integration,
54-
afterAllSetup(client: BrowserClient) {
53+
afterAllSetup(client) {
5554
integration.afterAllSetup(client);
5655

5756
// Run this in the next tick to ensure the ember router etc. is properly initialized

packages/ember/addon/utils/instrumentEmberAppInstanceForPerformance.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@ import type ApplicationInstance from '@ember/application/instance';
22
import type Transition from '@ember/routing/-private/transition';
33
import type RouterService from '@ember/routing/router-service';
44
import type {
5-
BrowserClient,
65
startBrowserTracingNavigationSpan as startBrowserTracingNavigationSpanType,
76
startBrowserTracingPageLoadSpan as startBrowserTracingPageLoadSpanType,
87
} from '@sentry/browser';
98
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, startInactiveSpan } from '@sentry/browser';
10-
import type { Span } from '@sentry/core';
9+
import type { Client, Span } from '@sentry/core';
1110
import type { EmberRouterMain } from '../types';
1211
import { getBackburner } from './performance';
1312

1413
export function instrumentEmberAppInstanceForPerformance(
15-
client: BrowserClient,
14+
client: Client,
1615
appInstance: ApplicationInstance,
1716
config: { disableRunloopPerformance?: boolean; instrumentPageLoad?: boolean; instrumentNavigation?: boolean },
1817
startBrowserTracingPageLoadSpan: typeof startBrowserTracingPageLoadSpanType,
@@ -76,7 +75,7 @@ export function _getLocationURL(location: EmberRouterMain['location']): string {
7675
}
7776

7877
function _instrumentEmberRouter(
79-
client: BrowserClient,
78+
client: Client,
8079
routerService: RouterService,
8180
routerMain: EmberRouterMain,
8281
config: { disableRunloopPerformance?: boolean; instrumentPageLoad?: boolean; instrumentNavigation?: boolean },

packages/ember/addon/utils/performance.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
/* eslint-disable max-lines */
21
import type ApplicationInstance from '@ember/application/instance';
32
import { _backburner, run } from '@ember/runloop';
43
import { getOwnConfig, importSync, isTesting, macroCondition } from '@embroider/macros';
5-
import type { BrowserClient } from '@sentry/browser';
64
import { getClient } from '@sentry/browser';
75
import { addIntegration, GLOBAL_OBJ } from '@sentry/core';
86
import type { ExtendedBackburner } from '@sentry/ember/runloop';
@@ -71,7 +69,7 @@ export function instrumentForPerformance(appInstance: ApplicationInstance): void
7169
...emberSpecificConfig,
7270
});
7371

74-
const client = getClient<BrowserClient>();
72+
const client = getClient();
7573
const isAlreadyInitialized = macroCondition(isTesting()) ? client?.getIntegrationByName('BrowserTracing') : false;
7674
addIntegration(browserTracing);
7775

packages/ember/tests/acceptance/sentry-replay-test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { visit } from '@ember/test-helpers';
2-
import type { BrowserClient, replayIntegration } from '@sentry/ember';
2+
import type { replayIntegration } from '@sentry/ember';
33
import * as Sentry from '@sentry/ember';
44
import { setupApplicationTest } from 'ember-qunit';
55
import { module, test } from 'qunit';
@@ -12,8 +12,7 @@ module('Acceptance | Sentry Session Replay', function (hooks) {
1212
test('Test replay', async function (assert) {
1313
await visit('/replay');
1414

15-
const integration =
16-
Sentry.getClient<BrowserClient>()?.getIntegrationByName<ReturnType<typeof replayIntegration>>('Replay');
15+
const integration = Sentry.getClient()?.getIntegrationByName<ReturnType<typeof replayIntegration>>('Replay');
1716
assert.ok(integration);
1817

1918
const replay = integration!['_replay'];

packages/ember/tests/dummy/app/routes/replay.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import Route from '@ember/routing/route';
2-
import type { BrowserClient } from '@sentry/ember';
32
import * as Sentry from '@sentry/ember';
43

54
export default class ReplayRoute extends Route {
65
public async beforeModel(): Promise<void> {
76
const { replayIntegration } = Sentry;
8-
const client = Sentry.getClient<BrowserClient>();
7+
const client = Sentry.getClient();
98
if (client && !client.getIntegrationByName('Replay')) {
109
client.addIntegration(replayIntegration());
1110
}

0 commit comments

Comments
 (0)