1
- import { convertIntegrationFnToClass , defineIntegration , hasTracingEnabled } from '@sentry/core' ;
2
- import type { Client , Integration , IntegrationClass , IntegrationFn } from '@sentry/types' ;
1
+ import { defineIntegration , hasTracingEnabled } from '@sentry/core' ;
2
+ import type { Client , IntegrationFn } from '@sentry/types' ;
3
3
import { GLOBAL_OBJ , arrayify , consoleSandbox } from '@sentry/utils' ;
4
4
5
5
import { DEFAULT_HOOKS } from './constants' ;
6
+ import { DEBUG_BUILD } from './debug-build' ;
6
7
import { attachErrorHandler } from './errorhandler' ;
7
8
import { createTracingMixins } from './tracing' ;
8
9
import type { Options , Vue , VueOptions } from './types' ;
@@ -33,17 +34,6 @@ const _vueIntegration = ((integrationOptions: Partial<VueOptions> = {}) => {
33
34
34
35
export const vueIntegration = defineIntegration ( _vueIntegration ) ;
35
36
36
- /**
37
- * Initialize Vue error & performance tracking.
38
- *
39
- * @deprecated Use `vueIntegration()` instead.
40
- */
41
- // eslint-disable-next-line deprecation/deprecation
42
- export const VueIntegration = convertIntegrationFnToClass (
43
- INTEGRATION_NAME ,
44
- vueIntegration ,
45
- ) as IntegrationClass < Integration > ;
46
-
47
37
function _setupIntegration ( client : Client , integrationOptions : Partial < VueOptions > ) : void {
48
38
const options : Options = { ...DEFAULT_CONFIG , ...client . getOptions ( ) , ...integrationOptions } ;
49
39
if ( ! options . Vue && ! options . app ) {
@@ -67,23 +57,25 @@ Update your \`Sentry.init\` call with an appropriate config option:
67
57
}
68
58
69
59
const vueInit = ( app : Vue , options : Options ) : void => {
70
- // Check app is not mounted yet - should be mounted _after_ init()!
71
- // This is _somewhat_ private, but in the case that this doesn't exist we simply ignore it
72
- // See: https://github.com/vuejs/core/blob/eb2a83283caa9de0a45881d860a3cbd9d0bdd279/packages/runtime-core/src/component.ts#L394
73
- const appWithInstance = app as Vue & {
74
- _instance ?: {
75
- isMounted ?: boolean ;
60
+ if ( DEBUG_BUILD ) {
61
+ // Check app is not mounted yet - should be mounted _after_ init()!
62
+ // This is _somewhat_ private, but in the case that this doesn't exist we simply ignore it
63
+ // See: https://github.com/vuejs/core/blob/eb2a83283caa9de0a45881d860a3cbd9d0bdd279/packages/runtime-core/src/component.ts#L394
64
+ const appWithInstance = app as Vue & {
65
+ _instance ?: {
66
+ isMounted ?: boolean ;
67
+ } ;
76
68
} ;
77
- } ;
78
69
79
- const isMounted = appWithInstance . _instance && appWithInstance . _instance . isMounted ;
80
- if ( isMounted === true ) {
81
- consoleSandbox ( ( ) => {
82
- // eslint-disable-next-line no-console
83
- console . warn (
84
- '[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`.' ,
85
- ) ;
86
- } ) ;
70
+ const isMounted = appWithInstance . _instance && appWithInstance . _instance . isMounted ;
71
+ if ( isMounted === true ) {
72
+ consoleSandbox ( ( ) => {
73
+ // eslint-disable-next-line no-console
74
+ console . warn (
75
+ '[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`.' ,
76
+ ) ;
77
+ } ) ;
78
+ }
87
79
}
88
80
89
81
attachErrorHandler ( app , options ) ;
0 commit comments