@@ -570,9 +570,9 @@ type GlobalInstanceSetter = ((
570
570
instance : ComponentInternalInstance | null
571
571
) => void ) & { version ?: string }
572
572
573
- let globalCurrentInstanceSetters : GlobalInstanceSetter [ ]
574
573
let internalSetCurrentInstance : GlobalInstanceSetter
575
- let hasWarnedDuplicatedVue = false
574
+ let globalCurrentInstanceSetters : GlobalInstanceSetter [ ]
575
+ let settersKey = '__VUE_INSTANCE_SETTERS__'
576
576
577
577
/**
578
578
* The following makes getCurrentInstance() usage across multiple copies of Vue
@@ -587,33 +587,12 @@ let hasWarnedDuplicatedVue = false
587
587
* found during browser execution.
588
588
*/
589
589
if ( __SSR__ ) {
590
- const settersKey = '__VUE_INSTANCE_SETTERS__'
591
590
if ( ! ( globalCurrentInstanceSetters = getGlobalThis ( ) [ settersKey ] ) ) {
592
591
globalCurrentInstanceSetters = getGlobalThis ( ) [ settersKey ] = [ ]
593
592
}
594
593
globalCurrentInstanceSetters . push ( i => ( currentInstance = i ) )
595
-
596
- if ( __DEV__ ) {
597
- globalCurrentInstanceSetters [
598
- globalCurrentInstanceSetters . length - 1
599
- ] . version = __VERSION__
600
- }
601
-
602
594
internalSetCurrentInstance = instance => {
603
595
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
- }
617
596
globalCurrentInstanceSetters . forEach ( s => s ( instance ) )
618
597
} else {
619
598
globalCurrentInstanceSetters [ 0 ] ( instance )
0 commit comments