Skip to content

Commit 4dcd6de

Browse files
mydeaclaude
andcommitted
feat(ember)!: Update to v2 addon format
Squashed and rebased continuation of PR #19229 (original author @aklkv) onto current develop. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a45cef0 commit 4dcd6de

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

dev-packages/e2e-tests/test-applications/ember-strict-resolver/src/instance-initializers/sentry-performance.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import type ApplicationInstance from '@ember/application/instance';
22
import * as Sentry from '@sentry/ember';
33

44
export function initialize(appInstance: ApplicationInstance): void {
5-
Sentry.instrumentAppInstancePerformance(appInstance);
5+
Sentry.instrumentAppInstancePerformance(appInstance, {
6+
minimumRunloopQueueDuration: 0,
7+
minimumComponentRenderDuration: 0,
8+
});
69
}
710

811
export default {

packages/ember/src/utils/browserTracingIntegration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ export function browserTracingIntegration(options: EmberBrowserTracingIntegratio
4242

4343
const globalsPerformanceConfig = {
4444
disableRunloopPerformance: options.disableRunloopPerformance ?? false,
45-
minimumRunloopQueueDuration: options.minimumRunloopQueueDuration ?? 0,
45+
minimumRunloopQueueDuration: options.minimumRunloopQueueDuration,
4646
disableInstrumentComponents: options.disableInstrumentComponents ?? false,
47-
minimumComponentRenderDuration: options.minimumComponentRenderDuration ?? 0,
47+
minimumComponentRenderDuration: options.minimumComponentRenderDuration,
4848
enableComponentDefinitions: options.enableComponentDefinitions ?? false,
4949
disableInitialLoadInstrumentation: options.disableInitialLoadInstrumentation ?? false,
5050
};

packages/ember/src/utils/instrumentEmberAppInstanceForPerformance.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ export function instrumentEmberAppInstanceForPerformance(
3737
const { disableRunloopPerformance, instrumentPageLoad, instrumentNavigation } = config;
3838
const routerService = getRouterService(appInstance);
3939

40-
if (routerService._hasMountedSentryPerformanceRouting) {
41-
// Routing listens to route changes on the main router, and should not be initialized multiple times per page.
42-
return;
43-
}
4440
if (!routerService.recognize) {
4541
// Router is missing critical functionality to limit cardinality of the transaction names.
4642
return;
@@ -170,12 +166,9 @@ export function instrumentEmberAppInstanceForPerformance(
170166
});
171167
}
172168

173-
function getRouterService(
174-
appInstance: ApplicationInstance,
175-
): RouterService & { _hasMountedSentryPerformanceRouting?: boolean } {
169+
function getRouterService(appInstance: ApplicationInstance): RouterService {
176170
const routerService = appInstance.lookup('service:router') as RouterService & {
177171
externalRouter?: RouterService;
178-
_hasMountedSentryPerformanceRouting?: boolean;
179172
};
180173

181174
if (routerService.externalRouter) {

0 commit comments

Comments
 (0)