wip: refactor deprecations into a single file

This commit is contained in:
Evan You
2021-04-12 18:47:50 -04:00
parent af9e6999e1
commit 115372dd5b
19 changed files with 497 additions and 480 deletions

View File

@@ -34,8 +34,8 @@ import { isEmitListener } from './componentEmits'
import { InternalObjectKey } from './vnode'
import { AppContext } from './apiCreateApp'
import { createPropsDefaultThis } from './compat/props'
import { isCompatEnabled } from './compat/compatConfig'
import { DeprecationTypes } from './compat/deprecations'
import { isCompatEnabled, softAssertCompatEnabled } from './compat/compatConfig'
import { DeprecationTypes } from './compat/compatConfig'
export type ComponentPropsOptions<P = Data> =
| ComponentObjectPropsOptions<P>
@@ -296,6 +296,15 @@ function setFullProps(
if (isReservedProp(key)) {
continue
}
if (__COMPAT__ && key.startsWith('onHook:')) {
softAssertCompatEnabled(
DeprecationTypes.INSTANCE_EVENT_HOOKS,
instance,
key.slice(2).toLowerCase()
)
}
const value = rawProps[key]
// prop option names are camelized during normalization, so to support
// kebab -> camel conversion here we need to camelize the key.