@sentry/ember 8.0.0-beta.4 → 8.0.0-beta.5

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
@@ -5,7 +5,7 @@ import { getOwnConfig, isDevelopingApp, macroCondition } from '@embroider/macros
5
5
  import { startSpan } from '@sentry/browser';
6
6
  import type { BrowserOptions } from '@sentry/browser';
7
7
  import * as Sentry from '@sentry/browser';
8
- import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, applySdkMetadata } from '@sentry/core';
8
+ import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, applySdkMetadata } from '@sentry/core';
9
9
  import { GLOBAL_OBJ } from '@sentry/utils';
10
10
  import Ember from 'ember';
11
11
 
@@ -75,9 +75,11 @@ export const instrumentRoutePerformance = <T extends RouteConstructor>(BaseRoute
75
75
  {
76
76
  attributes: {
77
77
  [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source,
78
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.ember',
78
79
  },
79
80
  op,
80
81
  name,
82
+ onlyIfParent: true,
81
83
  },
82
84
  () => {
83
85
  return fn(...args);
@@ -145,6 +145,12 @@ export function _instrumentEmberRouter(
145
145
 
146
146
  routerService.on('routeWillChange', (transition: Transition) => {
147
147
  const { fromRoute, toRoute } = getTransitionInformation(transition, routerService);
148
+
149
+ // We want to ignore loading && error routes
150
+ if (transitionIsIntermediate(transition)) {
151
+ return;
152
+ }
153
+
148
154
  activeRootSpan?.end();
149
155
 
150
156
  activeRootSpan = startBrowserTracingNavigationSpan(client, {
@@ -167,8 +173,8 @@ export function _instrumentEmberRouter(
167
173
  });
168
174
  });
169
175
 
170
- routerService.on('routeDidChange', () => {
171
- if (!transitionSpan || !activeRootSpan) {
176
+ routerService.on('routeDidChange', transition => {
177
+ if (!transitionSpan || !activeRootSpan || transitionIsIntermediate(transition)) {
172
178
  return;
173
179
  }
174
180
  transitionSpan.end();
@@ -492,3 +498,18 @@ function _instrumentNavigation(
492
498
  export default {
493
499
  initialize,
494
500
  };
501
+
502
+ function transitionIsIntermediate(transition: Transition): boolean {
503
+ // We want to use ignore, as this may actually be defined on new versions
504
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
505
+ // @ts-ignore This actually exists on newer versions
506
+ const isIntermediate: boolean | undefined = transition.isIntermediate;
507
+
508
+ if (typeof isIntermediate === 'boolean') {
509
+ return isIntermediate;
510
+ }
511
+
512
+ // For versions without this, we look if the route is a `.loading` or `.error` route
513
+ // This is not perfect and may false-positive in some cases, but it's the best we can do
514
+ return transition.to?.localName === 'loading' || transition.to?.localName === 'error';
515
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/ember",
3
- "version": "8.0.0-beta.4",
3
+ "version": "8.0.0-beta.5",
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",
@@ -32,10 +32,10 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@embroider/macros": "^1.9.0",
35
- "@sentry/browser": "8.0.0-beta.4",
36
- "@sentry/core": "8.0.0-beta.4",
37
- "@sentry/types": "8.0.0-beta.4",
38
- "@sentry/utils": "8.0.0-beta.4",
35
+ "@sentry/browser": "8.0.0-beta.5",
36
+ "@sentry/core": "8.0.0-beta.5",
37
+ "@sentry/types": "8.0.0-beta.5",
38
+ "@sentry/utils": "8.0.0-beta.5",
39
39
  "ember-auto-import": "^1.12.1 || ^2.4.3",
40
40
  "ember-cli-babel": "^7.26.11",
41
41
  "ember-cli-htmlbars": "^6.1.1",