@@ -20,6 +20,8 @@ import { devtoolsInitApp, devtoolsUnmountApp } from './devtools'
20
20
import { isFunction , NO , isObject } from '@vue/shared'
21
21
import { version } from '.'
22
22
import { installAppCompatProperties } from './compat/global'
23
+ import { NormalizedPropsOptions } from './componentProps'
24
+ import { ObjectEmitsOptions } from './componentEmits'
23
25
24
26
export interface App < HostElement = any > {
25
27
version : string
@@ -101,13 +103,19 @@ export interface AppContext {
101
103
* Cache for merged/normalized component options
102
104
* Each app instance has its own cache because app-level global mixins and
103
105
* optionMergeStrategies can affect merge behavior.
106
+ * @internal
104
107
*/
105
- cache : WeakMap < ComponentOptions , MergedComponentOptions >
108
+ optionsCache : WeakMap < ComponentOptions , MergedComponentOptions >
106
109
/**
107
- * Flag for de-optimizing props normalization
110
+ * Cache for normalized props options
108
111
* @internal
109
112
*/
110
- deopt ?: boolean
113
+ propsCache : WeakMap < ConcreteComponent , NormalizedPropsOptions >
114
+ /**
115
+ * Cache for normalized emits options
116
+ * @internal
117
+ */
118
+ emitsCache : WeakMap < ConcreteComponent , ObjectEmitsOptions | null >
111
119
/**
112
120
* HMR only
113
121
* @internal
@@ -144,7 +152,9 @@ export function createAppContext(): AppContext {
144
152
components : { } ,
145
153
directives : { } ,
146
154
provides : Object . create ( null ) ,
147
- cache : new WeakMap ( )
155
+ optionsCache : new WeakMap ( ) ,
156
+ propsCache : new WeakMap ( ) ,
157
+ emitsCache : new WeakMap ( )
148
158
}
149
159
}
150
160
@@ -213,11 +223,6 @@ export function createAppAPI<HostElement>(
213
223
if ( __FEATURE_OPTIONS_API__ ) {
214
224
if ( ! context . mixins . includes ( mixin ) ) {
215
225
context . mixins . push ( mixin )
216
- // global mixin with props/emits de-optimizes props/emits
217
- // normalization caching.
218
- if ( mixin . props || mixin . emits ) {
219
- context . deopt = true
220
- }
221
226
} else if ( __DEV__ ) {
222
227
warn (
223
228
'Mixin has already been applied to target app' +
0 commit comments