@sentry/ember 7.106.1 → 7.107.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.
@@ -6,20 +6,21 @@ import type RouterService from '@ember/routing/router-service';
6
6
  import { _backburner, run, scheduleOnce } from '@ember/runloop';
7
7
  import type { EmberRunQueues } from '@ember/runloop/-private/types';
8
8
  import { getOwnConfig, isTesting, macroCondition } from '@embroider/macros';
9
- import type { ExtendedBackburner } from '@sentry/ember/runloop';
10
- import type { Span } from '@sentry/types';
11
- import { GLOBAL_OBJ, browserPerformanceTimeOrigin, timestampInSeconds } from '@sentry/utils';
12
-
13
- import type { BrowserClient } from '@sentry/browser';
9
+ import type {
10
+ BrowserClient,
11
+ startBrowserTracingNavigationSpan as startBrowserTracingNavigationSpanType,
12
+ startBrowserTracingPageLoadSpan as startBrowserTracingPageLoadSpanType,
13
+ } from '@sentry/browser';
14
14
  import {
15
15
  SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
16
16
  SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
17
17
  getActiveSpan,
18
18
  getClient,
19
- startBrowserTracingNavigationSpan,
20
- startBrowserTracingPageLoadSpan,
21
19
  startInactiveSpan,
22
20
  } from '@sentry/browser';
21
+ import type { ExtendedBackburner } from '@sentry/ember/runloop';
22
+ import type { Span } from '@sentry/types';
23
+ import { GLOBAL_OBJ, browserPerformanceTimeOrigin, timestampInSeconds } from '@sentry/utils';
23
24
  import type { EmberRouterMain, EmberSentryConfig, GlobalConfig, OwnConfig } from '../types';
24
25
 
25
26
  function getSentryConfig(): EmberSentryConfig {
@@ -99,6 +100,8 @@ export function _instrumentEmberRouter(
99
100
  routerService: RouterService,
100
101
  routerMain: EmberRouterMain,
101
102
  config: EmberSentryConfig,
103
+ startBrowserTracingPageLoadSpan: typeof startBrowserTracingPageLoadSpanType,
104
+ startBrowserTracingNavigationSpan: typeof startBrowserTracingNavigationSpanType,
102
105
  ): void {
103
106
  const { disableRunloopPerformance } = config;
104
107
  const location = routerMain.location;
@@ -424,7 +427,8 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance)
424
427
  // Maintaining backwards compatibility with config.browserTracingOptions, but passing it with Sentry options is preferred.
425
428
  const browserTracingOptions = config.browserTracingOptions || config.sentry.browserTracingOptions || {};
426
429
 
427
- const { browserTracingIntegration } = await import('@sentry/browser');
430
+ const { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan } =
431
+ await import('@sentry/browser');
428
432
 
429
433
  const idleTimeout = config.transitionTimeout || 5000;
430
434
 
@@ -444,7 +448,7 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance)
444
448
  }
445
449
 
446
450
  // We _always_ call this, as it triggers the page load & navigation spans
447
- _instrumentNavigation(appInstance, config);
451
+ _instrumentNavigation(appInstance, config, startBrowserTracingPageLoadSpan, startBrowserTracingNavigationSpan);
448
452
 
449
453
  // Skip instrumenting the stuff below again in tests, as these are not reset between tests
450
454
  if (isAlreadyInitialized) {
@@ -456,7 +460,12 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance)
456
460
  _instrumentInitialLoad(config);
457
461
  }
458
462
 
459
- function _instrumentNavigation(appInstance: ApplicationInstance, config: EmberSentryConfig): void {
463
+ function _instrumentNavigation(
464
+ appInstance: ApplicationInstance,
465
+ config: EmberSentryConfig,
466
+ startBrowserTracingPageLoadSpan: typeof startBrowserTracingPageLoadSpanType,
467
+ startBrowserTracingNavigationSpan: typeof startBrowserTracingNavigationSpanType,
468
+ ): void {
460
469
  // eslint-disable-next-line ember/no-private-routing-service
461
470
  const routerMain = appInstance.lookup('router:main') as EmberRouterMain;
462
471
  let routerService = appInstance.lookup('service:router') as RouterService & {
@@ -478,7 +487,13 @@ function _instrumentNavigation(appInstance: ApplicationInstance, config: EmberSe
478
487
  }
479
488
 
480
489
  routerService._hasMountedSentryPerformanceRouting = true;
481
- _instrumentEmberRouter(routerService, routerMain, config);
490
+ _instrumentEmberRouter(
491
+ routerService,
492
+ routerMain,
493
+ config,
494
+ startBrowserTracingPageLoadSpan,
495
+ startBrowserTracingNavigationSpan,
496
+ );
482
497
  }
483
498
 
484
499
  export default {
@@ -1,8 +1,9 @@
1
1
  import type ApplicationInstance from '@ember/application/instance';
2
2
  import type RouterService from '@ember/routing/router-service';
3
+ import type { startBrowserTracingNavigationSpan as startBrowserTracingNavigationSpanType, startBrowserTracingPageLoadSpan as startBrowserTracingPageLoadSpanType } from '@sentry/browser';
3
4
  import type { EmberRouterMain, EmberSentryConfig } from '../types';
4
5
  export declare function initialize(appInstance: ApplicationInstance): void;
5
- export declare function _instrumentEmberRouter(routerService: RouterService, routerMain: EmberRouterMain, config: EmberSentryConfig): void;
6
+ export declare function _instrumentEmberRouter(routerService: RouterService, routerMain: EmberRouterMain, config: EmberSentryConfig, startBrowserTracingPageLoadSpan: typeof startBrowserTracingPageLoadSpanType, startBrowserTracingNavigationSpan: typeof startBrowserTracingNavigationSpanType): void;
6
7
  export declare function instrumentForPerformance(appInstance: ApplicationInstance): Promise<void>;
7
8
  declare const _default: {
8
9
  initialize: typeof initialize;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/ember",
3
- "version": "7.106.1",
3
+ "version": "7.107.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",
@@ -32,10 +32,10 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@embroider/macros": "^1.9.0",
35
- "@sentry/browser": "7.106.1",
36
- "@sentry/core": "7.106.1",
37
- "@sentry/types": "7.106.1",
38
- "@sentry/utils": "7.106.1",
35
+ "@sentry/browser": "7.107.0",
36
+ "@sentry/core": "7.107.0",
37
+ "@sentry/types": "7.107.0",
38
+ "@sentry/utils": "7.107.0",
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",