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' ;
33import { GLOBAL_OBJ , arrayify , consoleSandbox } from '@sentry/utils' ;
44
55import { DEFAULT_HOOKS } from './constants' ;
6+ import { DEBUG_BUILD } from './debug-build' ;
67import { attachErrorHandler } from './errorhandler' ;
78import { createTracingMixins } from './tracing' ;
89import type { Options , Vue , VueOptions } from './types' ;
@@ -33,17 +34,6 @@ const _vueIntegration = ((integrationOptions: Partial<VueOptions> = {}) => {
3334
3435export const vueIntegration = defineIntegration ( _vueIntegration ) ;
3536
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-
4737function _setupIntegration ( client : Client , integrationOptions : Partial < VueOptions > ) : void {
4838 const options : Options = { ...DEFAULT_CONFIG , ...client . getOptions ( ) , ...integrationOptions } ;
4939 if ( ! options . Vue && ! options . app ) {
@@ -67,23 +57,25 @@ Update your \`Sentry.init\` call with an appropriate config option:
6757}
6858
6959const 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+ } ;
7668 } ;
77- } ;
7869
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+ }
8779 }
8880
8981 attachErrorHandler ( app , options ) ;
0 commit comments