refactor: adjust component options merge cache strategy

BREAKING CHANGE: optionMergeStrategies functions no longer receive
the component instance as the 3rd argument. The argument was technically
internal in Vue 2 and only used for generating warnings, and should not
be needed in userland code. This removal enables much more efficient
caching of option merging.
This commit is contained in:
Evan You
2021-06-02 10:37:50 -04:00
parent 44996d1a0a
commit 1e35a860b9
4 changed files with 86 additions and 43 deletions

View File

@@ -33,7 +33,8 @@ import {
OptionTypesType,
OptionTypesKeys,
resolveMergedOptions,
shouldCacheAccess
shouldCacheAccess,
MergedComponentOptionsOverride
} from './componentOptions'
import { EmitsOptions, EmitFn } from './componentEmits'
import { Slots } from './componentSlots'
@@ -188,7 +189,7 @@ export type ComponentPublicInstance<
$parent: ComponentPublicInstance | null
$emit: EmitFn<E>
$el: any
$options: Options
$options: Options & MergedComponentOptionsOverride
$forceUpdate: ReactiveEffect
$nextTick: typeof nextTick
$watch(