Skip to content

Commit a45cef0

Browse files
mydeaclaude
andcommitted
feat(ember)!: Update to v2 addon format
Squashed from PR #19229 (getsentry/sentry-javascript). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2e52ead commit a45cef0

166 files changed

Lines changed: 4884 additions & 6130 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dev-packages/e2e-tests/test-applications/ember-classic/app/app.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ import Resolver from 'ember-resolver';
66
import config from './config/environment';
77

88
Sentry.init({
9+
dsn: config.sentryDsn,
910
traceLifecycle: 'static',
11+
tracesSampleRate: 1,
1012
replaysSessionSampleRate: 1,
1113
replaysOnErrorSampleRate: 1,
14+
tracePropagationTargets: ['localhost', 'doesntexist.example'],
1215
tunnel: `http://localhost:3031/`, // proxy server
1316
});
1417

dev-packages/e2e-tests/test-applications/ember-classic/app/config/environment.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ declare const config: {
1111
podModulePrefix: string;
1212
locationType: 'history' | 'hash' | 'none' | 'auto';
1313
rootURL: string;
14+
sentryDsn: string;
1415
APP: Record<string, unknown>;
1516
};
1617

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type ApplicationInstance from '@ember/application/instance';
2+
import { instrumentAppInstancePerformance } from '@sentry/ember';
3+
4+
export function initialize(appInstance: ApplicationInstance): void {
5+
instrumentAppInstancePerformance(appInstance, {
6+
minimumRunloopQueueDuration: 0,
7+
minimumComponentRenderDuration: 0,
8+
});
9+
}
10+
11+
export default {
12+
initialize,
13+
};

dev-packages/e2e-tests/test-applications/ember-classic/config/environment.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,7 @@ module.exports = function (environment) {
1919
},
2020
};
2121

22-
ENV['@sentry/ember'] = {
23-
sentry: {
24-
tracesSampleRate: 1,
25-
dsn: process.env.E2E_TEST_DSN,
26-
tracePropagationTargets: ['localhost', 'doesntexist.example'],
27-
browserTracingOptions: {
28-
_experiments: {
29-
// This lead to some flaky tests, as that is sometimes logged
30-
enableLongTask: false,
31-
},
32-
},
33-
},
34-
ignoreEmberOnErrorWarning: true,
35-
minimumRunloopQueueDuration: 0,
36-
minimumComponentRenderDuration: 0,
37-
};
22+
ENV.sentryDsn = process.env.E2E_TEST_DSN;
3823

3924
if (environment === 'development') {
4025
// ENV.APP.LOG_RESOLVER = true;

dev-packages/e2e-tests/test-applications/ember-classic/tests/errors.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test('sends an error', async ({ page }) => {
3131

3232
test('assigns the correct transaction value after a navigation', async ({ page }) => {
3333
const pageloadTxnPromise = waitForTransaction('ember-classic', async transactionEvent => {
34-
return !!transactionEvent?.transaction && transactionEvent.contexts?.trace?.op === 'pageload';
34+
return !!transactionEvent.transaction && transactionEvent.contexts?.trace?.op === 'pageload';
3535
});
3636

3737
const errorPromise = waitForError('ember-classic', async errorEvent => {

dev-packages/e2e-tests/test-applications/ember-classic/tests/performance.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { waitForTransaction } from '@sentry-internal/test-utils';
33

44
test('sends a pageload transaction with a parameterized URL', async ({ page }) => {
55
const transactionPromise = waitForTransaction('ember-classic', async transactionEvent => {
6-
return !!transactionEvent?.transaction && transactionEvent.contexts?.trace?.op === 'pageload';
6+
return !!transactionEvent.transaction && transactionEvent.contexts?.trace?.op === 'pageload';
77
});
88

99
await page.goto(`/`);
@@ -33,11 +33,11 @@ test('sends a pageload transaction with a parameterized URL', async ({ page }) =
3333

3434
test('sends a navigation transaction with a parameterized URL', async ({ page }) => {
3535
const pageloadTxnPromise = waitForTransaction('ember-classic', async transactionEvent => {
36-
return !!transactionEvent?.transaction && transactionEvent.contexts?.trace?.op === 'pageload';
36+
return !!transactionEvent.transaction && transactionEvent.contexts?.trace?.op === 'pageload';
3737
});
3838

3939
const navigationTxnPromise = waitForTransaction('ember-classic', async transactionEvent => {
40-
return !!transactionEvent?.transaction && transactionEvent.contexts?.trace?.op === 'navigation';
40+
return !!transactionEvent.transaction && transactionEvent.contexts?.trace?.op === 'navigation';
4141
});
4242

4343
await page.goto(`/`);
@@ -68,11 +68,11 @@ test('sends a navigation transaction with a parameterized URL', async ({ page })
6868

6969
test('sends a navigation transaction even if the pageload span is still active', async ({ page }) => {
7070
const pageloadTxnPromise = waitForTransaction('ember-classic', async transactionEvent => {
71-
return !!transactionEvent?.transaction && transactionEvent.contexts?.trace?.op === 'pageload';
71+
return !!transactionEvent.transaction && transactionEvent.contexts?.trace?.op === 'pageload';
7272
});
7373

7474
const navigationTxnPromise = waitForTransaction('ember-classic', async transactionEvent => {
75-
return !!transactionEvent?.transaction && transactionEvent.contexts?.trace?.op === 'navigation';
75+
return !!transactionEvent.transaction && transactionEvent.contexts?.trace?.op === 'navigation';
7676
});
7777

7878
await page.goto(`/`);
@@ -127,11 +127,11 @@ test('sends a navigation transaction even if the pageload span is still active',
127127

128128
test('captures correct spans for navigation', async ({ page }) => {
129129
const pageloadTxnPromise = waitForTransaction('ember-classic', async transactionEvent => {
130-
return !!transactionEvent?.transaction && transactionEvent.contexts?.trace?.op === 'pageload';
130+
return !!transactionEvent.transaction && transactionEvent.contexts?.trace?.op === 'pageload';
131131
});
132132

133133
const navigationTxnPromise = waitForTransaction('ember-classic', async transactionEvent => {
134-
return !!transactionEvent?.transaction && transactionEvent.contexts?.trace?.op === 'navigation';
134+
return !!transactionEvent.transaction && transactionEvent.contexts?.trace?.op === 'navigation';
135135
});
136136

137137
await page.goto(`/tracing`);

dev-packages/e2e-tests/test-applications/ember-embroider/app/app.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ import loadInitializers from 'ember-load-initializers';
55
import Resolver from 'ember-resolver';
66

77
Sentry.init({
8+
dsn: config.sentryDsn,
89
traceLifecycle: 'static',
10+
tracesSampleRate: 1,
911
replaysSessionSampleRate: 1,
1012
replaysOnErrorSampleRate: 1,
13+
tracePropagationTargets: ['localhost', 'doesntexist.example'],
1114
tunnel: `http://localhost:3031/`, // proxy server
1215
});
1316
export default class App extends Application {

dev-packages/e2e-tests/test-applications/ember-embroider/app/config/environment.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ declare const config: {
1111
podModulePrefix: string;
1212
locationType: 'history' | 'hash' | 'none' | 'auto';
1313
rootURL: string;
14+
sentryDsn: string;
1415
APP: Record<string, unknown>;
1516
};
1617

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type ApplicationInstance from '@ember/application/instance';
2+
import { instrumentAppInstancePerformance } from '@sentry/ember';
3+
4+
export function initialize(appInstance: ApplicationInstance): void {
5+
instrumentAppInstancePerformance(appInstance, {
6+
minimumRunloopQueueDuration: 0,
7+
minimumComponentRenderDuration: 0,
8+
});
9+
}
10+
11+
export default {
12+
initialize,
13+
};

dev-packages/e2e-tests/test-applications/ember-embroider/config/environment.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,7 @@ module.exports = function (environment) {
1919
},
2020
};
2121

22-
ENV['@sentry/ember'] = {
23-
sentry: {
24-
tracesSampleRate: 1,
25-
dsn: process.env.E2E_TEST_DSN,
26-
tracePropagationTargets: ['localhost', 'doesntexist.example'],
27-
browserTracingOptions: {
28-
_experiments: {
29-
// This lead to some flaky tests, as that is sometimes logged
30-
enableLongTask: false,
31-
},
32-
},
33-
},
34-
ignoreEmberOnErrorWarning: true,
35-
minimumRunloopQueueDuration: 0,
36-
minimumComponentRenderDuration: 0,
37-
};
22+
ENV.sentryDsn = process.env.E2E_TEST_DSN;
3823

3924
if (environment === 'development') {
4025
// ENV.APP.LOG_RESOLVER = true;

0 commit comments

Comments
 (0)