Skip to content

feat(v8/ember): Remove deprecated exports #10535

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 2 commits into from
Feb 7, 2024
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
11 changes: 0 additions & 11 deletions packages/ember/addon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, applySdkMetadata } from '@sentry/core
import { GLOBAL_OBJ } from '@sentry/utils';
import Ember from 'ember';

import type { Transaction } from '@sentry/types';
import type { EmberSentryConfig, GlobalConfig, OwnConfig } from './types';

function _getSentryInitConfig(): EmberSentryConfig['sentry'] {
Expand Down Expand Up @@ -60,16 +59,6 @@ export function init(_runtimeConfig?: BrowserOptions): void {
}
}

/**
* Grabs active transaction off scope.
*
* @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.
*/
export const getActiveTransaction = (): Transaction | undefined => {
// eslint-disable-next-line deprecation/deprecation
return Sentry.getCurrentScope().getTransaction();
};

type RouteConstructor = new (...args: ConstructorParameters<typeof Route>) => Route;

export const instrumentRoutePerformance = <T extends RouteConstructor>(BaseRoute: T): T => {
Expand Down
11 changes: 2 additions & 9 deletions packages/ember/addon/instance-initializers/sentry-performance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,7 @@ export function _instrumentEmberRouter(
return;
}

if (
url &&
browserTracingOptions.startTransactionOnPageLoad !== false &&
browserTracingOptions.instrumentPageLoad !== false
) {
if (url && browserTracingOptions.instrumentPageLoad !== false) {
const routeInfo = routerService.recognize(url);
Sentry.startBrowserTracingPageLoadSpan(client, {
name: `route:${routeInfo.name}`,
Expand All @@ -136,10 +132,7 @@ export function _instrumentEmberRouter(
getBackburner().off('end', finishActiveTransaction);
};

if (
browserTracingOptions.startTransactionOnLocationChange === false &&
browserTracingOptions.instrumentNavigation === false
) {
if (browserTracingOptions.instrumentNavigation === false) {
return;
}

Expand Down
6 changes: 2 additions & 4 deletions packages/ember/addon/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { BrowserOptions, BrowserTracing, browserTracingIntegration } from '@sentry/browser';
import type { BrowserOptions, browserTracingIntegration } from '@sentry/browser';
import type { Transaction, TransactionContext } from '@sentry/types';

type BrowserTracingOptions = Parameters<typeof browserTracingIntegration>[0] &
// eslint-disable-next-line deprecation/deprecation
ConstructorParameters<typeof BrowserTracing>[0];
type BrowserTracingOptions = Parameters<typeof browserTracingIntegration>[0];

export type EmberSentryConfig = {
sentry: BrowserOptions & { browserTracingOptions?: BrowserTracingOptions };
Expand Down
7 changes: 3 additions & 4 deletions packages/ember/tests/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,12 @@ export function assertSentryTransactions(
return !op?.startsWith('ui.ember.runloop.') && !op?.startsWith('ui.long-task');
})
.map(s => {
// eslint-disable-next-line deprecation/deprecation
return `${s.op} | ${spanToJSON(s).description}`;
const spanJson = spanToJSON(s);
return `${spanJson.op} | ${spanJson.description}`;
});

assert.true(
// eslint-disable-next-line deprecation/deprecation
spans.some(span => span.op?.startsWith('ui.ember.runloop.')),
spans.some(span => spanToJSON(span).op?.startsWith('ui.ember.runloop.')),
'it captures runloop spans',
);
assert.deepEqual(filteredSpans, options.spans, 'Has correct spans');
Expand Down