@@ -570,9 +570,9 @@ type GlobalInstanceSetter = ((
570570 instance : ComponentInternalInstance | null
571571) => void ) & { version ?: string }
572572
573- let globalCurrentInstanceSetters : GlobalInstanceSetter [ ]
574573let internalSetCurrentInstance : GlobalInstanceSetter
575- let hasWarnedDuplicatedVue = false
574+ let globalCurrentInstanceSetters : GlobalInstanceSetter [ ]
575+ let settersKey = '__VUE_INSTANCE_SETTERS__'
576576
577577/**
578578 * The following makes getCurrentInstance() usage across multiple copies of Vue
@@ -587,33 +587,12 @@ let hasWarnedDuplicatedVue = false
587587 * found during browser execution.
588588 */
589589if ( __SSR__ ) {
590- const settersKey = '__VUE_INSTANCE_SETTERS__'
591590 if ( ! ( globalCurrentInstanceSetters = getGlobalThis ( ) [ settersKey ] ) ) {
592591 globalCurrentInstanceSetters = getGlobalThis ( ) [ settersKey ] = [ ]
593592 }
594593 globalCurrentInstanceSetters . push ( i => ( currentInstance = i ) )
595-
596- if ( __DEV__ ) {
597- globalCurrentInstanceSetters [
598- globalCurrentInstanceSetters . length - 1
599- ] . version = __VERSION__
600- }
601-
602594 internalSetCurrentInstance = instance => {
603595 if ( globalCurrentInstanceSetters . length > 1 ) {
604- // eslint-disable-next-line no-restricted-globals
605- if ( __DEV__ && ! hasWarnedDuplicatedVue && typeof window !== 'undefined' ) {
606- warn (
607- `Mixed usage of duplicated Vue runtimes detected: ${ globalCurrentInstanceSetters
608- . map ( fn => fn . version )
609- . join ( ', ' ) } .\n` +
610- `This likely means there are multiple versions of Vue ` +
611- `duplicated in your dependency tree, and could lead to errors. ` +
612- `To avoid this warning, ensure that the all imports of Vue are resolving to ` +
613- `the same location on disk.`
614- )
615- hasWarnedDuplicatedVue = true
616- }
617596 globalCurrentInstanceSetters . forEach ( s => s ( instance ) )
618597 } else {
619598 globalCurrentInstanceSetters [ 0 ] ( instance )
0 commit comments