@sentry/ember 7.93.0 → 7.95.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
@@ -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 { SDK_VERSION } from '@sentry/browser';
8
+ import { applySdkMetadata } from '@sentry/core';
9
9
  import { GLOBAL_OBJ } from '@sentry/utils';
10
10
  import Ember from 'ember';
11
11
 
@@ -18,7 +18,10 @@ function _getSentryInitConfig(): EmberSentryConfig['sentry'] {
18
18
  return _global.__sentryEmberConfig;
19
19
  }
20
20
 
21
- export function InitSentryForEmber(_runtimeConfig?: BrowserOptions): void {
21
+ /**
22
+ * Initialize the Sentry SDK for Ember.
23
+ */
24
+ export function init(_runtimeConfig?: BrowserOptions): void {
22
25
  const environmentConfig = getOwnConfig<OwnConfig>().sentryConfig;
23
26
 
24
27
  assert('Missing configuration.', environmentConfig);
@@ -33,17 +36,7 @@ export function InitSentryForEmber(_runtimeConfig?: BrowserOptions): void {
33
36
  Object.assign(environmentConfig.sentry, _runtimeConfig || {});
34
37
  const initConfig = Object.assign({}, environmentConfig.sentry);
35
38
 
36
- initConfig._metadata = initConfig._metadata || {};
37
- initConfig._metadata.sdk = {
38
- name: 'sentry.javascript.ember',
39
- packages: [
40
- {
41
- name: 'npm:@sentry/ember',
42
- version: SDK_VERSION,
43
- },
44
- ],
45
- version: SDK_VERSION,
46
- };
39
+ applySdkMetadata(initConfig, 'ember');
47
40
 
48
41
  // Persist Sentry init options so they are identical when performance initializers call init again.
49
42
  const sentryInitConfig = _getSentryInitConfig();
@@ -74,7 +67,7 @@ export function InitSentryForEmber(_runtimeConfig?: BrowserOptions): void {
74
67
  */
75
68
  export const getActiveTransaction = (): Transaction | undefined => {
76
69
  // eslint-disable-next-line deprecation/deprecation
77
- return Sentry.getCurrentHub().getScope().getTransaction();
70
+ return Sentry.getCurrentScope().getTransaction();
78
71
  };
79
72
 
80
73
  type RouteConstructor = new (...args: ConstructorParameters<typeof Route>) => Route;
@@ -135,5 +128,7 @@ export const instrumentRoutePerformance = <T extends RouteConstructor>(BaseRoute
135
128
 
136
129
  export * from '@sentry/browser';
137
130
 
138
- // init is now the preferred way to call initialization for this addon.
139
- export const init = InitSentryForEmber;
131
+ /**
132
+ * @deprecated Use `Sentry.init()` instead.
133
+ */
134
+ export const InitSentryForEmber = init;
@@ -437,19 +437,19 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance)
437
437
  });
438
438
 
439
439
  if (macroCondition(isTesting())) {
440
- const client = Sentry.getCurrentHub().getClient();
440
+ const client = Sentry.getClient();
441
441
 
442
442
  if (
443
443
  client &&
444
- (client as BrowserClient).getIntegrationById &&
445
- (client as BrowserClient).getIntegrationById('BrowserTracing')
444
+ (client as BrowserClient).getIntegrationByName &&
445
+ (client as BrowserClient).getIntegrationByName('BrowserTracing')
446
446
  ) {
447
447
  // Initializers are called more than once in tests, causing the integrations to not be setup correctly.
448
448
  return;
449
449
  }
450
450
  }
451
451
 
452
- const client = Sentry.getCurrentHub().getClient();
452
+ const client = Sentry.getClient();
453
453
  if (client && client.addIntegration) {
454
454
  client.addIntegration(browserTracing);
455
455
  }
package/index.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  import type Route from '@ember/routing/route';
2
2
  import type { BrowserOptions } from '@sentry/browser';
3
3
  import type { Transaction } from '@sentry/types';
4
- export declare function InitSentryForEmber(_runtimeConfig?: BrowserOptions): void;
4
+ /**
5
+ * Initialize the Sentry SDK for Ember.
6
+ */
7
+ export declare function init(_runtimeConfig?: BrowserOptions): void;
5
8
  /**
6
9
  * Grabs active transaction off scope.
7
10
  *
@@ -11,4 +14,7 @@ export declare const getActiveTransaction: () => Transaction | undefined;
11
14
  type RouteConstructor = new (...args: ConstructorParameters<typeof Route>) => Route;
12
15
  export declare const instrumentRoutePerformance: <T extends RouteConstructor>(BaseRoute: T) => T;
13
16
  export * from '@sentry/browser';
14
- export declare const init: typeof InitSentryForEmber;
17
+ /**
18
+ * @deprecated Use `Sentry.init()` instead.
19
+ */
20
+ export declare const InitSentryForEmber: typeof init;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/ember",
3
- "version": "7.93.0",
3
+ "version": "7.95.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.93.0",
36
- "@sentry/core": "7.93.0",
37
- "@sentry/types": "7.93.0",
38
- "@sentry/utils": "7.93.0",
35
+ "@sentry/browser": "7.95.0",
36
+ "@sentry/core": "7.95.0",
37
+ "@sentry/types": "7.95.0",
38
+ "@sentry/utils": "7.95.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",