@sentry/ember 7.14.2 → 7.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/addon/index.ts CHANGED
@@ -4,12 +4,11 @@ import { macroCondition, isDevelopingApp, getOwnConfig } from '@embroider/macros
4
4
  import { next } from '@ember/runloop';
5
5
  import { assert, warn } from '@ember/debug';
6
6
  import Ember from 'ember';
7
- import { timestampWithMs } from '@sentry/utils';
7
+ import { timestampWithMs, GLOBAL_OBJ } from '@sentry/utils';
8
8
  import { GlobalConfig, OwnConfig } from './types';
9
- import { getGlobalObject } from '@sentry/utils';
10
9
 
11
10
  function _getSentryInitConfig() {
12
- const _global = getGlobalObject<GlobalConfig>();
11
+ const _global = GLOBAL_OBJ as typeof GLOBAL_OBJ & GlobalConfig;
13
12
  _global.__sentryEmberConfig = _global.__sentryEmberConfig ?? {};
14
13
  return _global.__sentryEmberConfig;
15
14
  }
@@ -6,12 +6,12 @@ import { ExtendedBackburner } from '@sentry/ember/runloop';
6
6
  import { Span, Transaction, Integration } from '@sentry/types';
7
7
  import { EmberRunQueues } from '@ember/runloop/-private/types';
8
8
  import { getActiveTransaction } from '..';
9
- import { browserPerformanceTimeOrigin, getGlobalObject, timestampWithMs } from '@sentry/utils';
9
+ import { browserPerformanceTimeOrigin, GLOBAL_OBJ, timestampWithMs } from '@sentry/utils';
10
10
  import { macroCondition, isTesting, getOwnConfig } from '@embroider/macros';
11
11
  import { EmberSentryConfig, GlobalConfig, OwnConfig } from '../types';
12
12
 
13
13
  function getSentryConfig() {
14
- const _global = getGlobalObject<GlobalConfig>();
14
+ const _global = GLOBAL_OBJ as typeof GLOBAL_OBJ & GlobalConfig;
15
15
  _global.__sentryEmberConfig = _global.__sentryEmberConfig ?? {};
16
16
  const environmentConfig = getOwnConfig<OwnConfig>().sentryConfig;
17
17
  if (!environmentConfig.sentry) {
@@ -372,7 +372,20 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance)
372
372
  new tracing.Integrations.BrowserTracing({
373
373
  routingInstrumentation: (customStartTransaction, startTransactionOnPageLoad) => {
374
374
  const routerMain = appInstance.lookup('router:main');
375
- const routerService = appInstance.lookup('service:router');
375
+ let routerService = appInstance.lookup('service:router');
376
+ if (routerService.externalRouter) {
377
+ // Using ember-engines-router-service in an engine.
378
+ routerService = routerService.externalRouter;
379
+ }
380
+ if (routerService._hasMountedSentryPerformanceRouting) {
381
+ // Routing listens to route changes on the main router, and should not be initialized multiple times per page.
382
+ return;
383
+ }
384
+ if (!routerService.recognize) {
385
+ // Router is missing critical functionality to limit cardinality of the transaction names.
386
+ return;
387
+ }
388
+ routerService._hasMountedSentryPerformanceRouting = true;
376
389
  _instrumentEmberRouter(routerService, routerMain, config, customStartTransaction, startTransactionOnPageLoad);
377
390
  },
378
391
  idleTimeout,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/ember",
3
- "version": "7.14.2",
3
+ "version": "7.16.0",
4
4
  "description": "Official Sentry SDK for Ember.js",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/ember",
@@ -30,10 +30,10 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@embroider/macros": "1.8.3",
33
- "@sentry/browser": "7.14.2",
34
- "@sentry/tracing": "7.14.2",
35
- "@sentry/types": "7.14.2",
36
- "@sentry/utils": "7.14.2",
33
+ "@sentry/browser": "7.16.0",
34
+ "@sentry/tracing": "7.16.0",
35
+ "@sentry/types": "7.16.0",
36
+ "@sentry/utils": "7.16.0",
37
37
  "ember-auto-import": "~1.12.1 || ~2.2.0",
38
38
  "ember-cli-babel": "~7.26.6",
39
39
  "ember-cli-htmlbars": "^6.0.1",