Skip to content

Commit dba35c8

Browse files
committed
Use @embroider/macros instead of runInDebug for @sentry/ember
This ensures that the debug code is actually stripped from production builds.
1 parent 4a11356 commit dba35c8

File tree

3 files changed

+220
-43
lines changed

3 files changed

+220
-43
lines changed

packages/ember/addon/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as Sentry from '@sentry/browser';
22
import { addGlobalEventProcessor, SDK_VERSION, BrowserOptions } from '@sentry/browser';
33
import environmentConfig from 'ember-get-config';
4-
4+
import { macroCondition, isDevelopingApp } from '@embroider/macros';
55
import { next } from '@ember/runloop';
6-
import { assert, warn, runInDebug } from '@ember/debug';
6+
import { assert, warn } from '@ember/debug';
77
import Ember from 'ember';
88
import { timestampWithMs } from '@sentry/utils';
99

@@ -22,7 +22,7 @@ export function InitSentryForEmber(_runtimeConfig: BrowserOptions | undefined) {
2222

2323
Sentry.init(initConfig);
2424

25-
runInDebug(() => {
25+
if (macroCondition(isDevelopingApp())) {
2626
if (config.ignoreEmberOnErrorWarning) {
2727
return;
2828
}
@@ -35,7 +35,7 @@ export function InitSentryForEmber(_runtimeConfig: BrowserOptions | undefined) {
3535
},
3636
);
3737
});
38-
});
38+
}
3939
}
4040

4141
export const getActiveTransaction = () => {

packages/ember/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"pack": "npm pack"
3232
},
3333
"dependencies": {
34+
"@embroider/macros": ">= 0.25.0",
3435
"@sentry/browser": "5.24.2",
3536
"@sentry/tracing": "5.24.2",
3637
"@sentry/types": "5.24.2",

0 commit comments

Comments
 (0)