const val = baseGetter()
if (
isArray(val) &&
- softAssertCompatEnabled(DeprecationTypes.WATCH_ARRAY)
+ softAssertCompatEnabled(DeprecationTypes.WATCH_ARRAY, instance)
) {
traverse(val)
}
hasChanged(newValue, oldValue) ||
(__COMPAT__ &&
isArray(newValue) &&
- isCompatEnabled(DeprecationTypes.WATCH_ARRAY))
+ isCompatEnabled(DeprecationTypes.WATCH_ARRAY, instance))
) {
// cleanup before running cb again
if (cleanup) {
-import { hasOwn, isArray } from '@vue/shared/src'
+import { hasOwn, isArray } from '@vue/shared'
import {
ComponentInternalInstance,
ComponentOptions,
createHydrationFns?: typeof createHydrationFunctions
): any {
const isHookEventCompatEnabled =
- __COMPAT__ && isCompatEnabled(DeprecationTypes.INSTANCE_EVENT_HOOKS)
+ __COMPAT__ && isCompatEnabled(DeprecationTypes.INSTANCE_EVENT_HOOKS, null)
// compile-time feature flags check
if (__ESM_BUNDLER__ && !__TEST__) {
// legacy transition class compat
const legacyClassEnabled =
__COMPAT__ &&
- compatUtils.isCompatEnabled(DeprecationTypes.TRANSITION_CLASSES)
+ compatUtils.isCompatEnabled(DeprecationTypes.TRANSITION_CLASSES, null)
let legacyEnterFromClass: string
let legacyAppearFromClass: string
let legacyLeaveFromClass: string
__COMPAT__ &&
!rawProps.tag &&
compatUtils.softAssertCompatEnabled(
- DeprecationTypes.TRANSITION_GROUP_ROOT
+ DeprecationTypes.TRANSITION_GROUP_ROOT,
+ instance.parent
)
) {
tag = 'span'
getCurrentInstance,
DeprecationTypes,
LegacyConfig,
- compatUtils
+ compatUtils,
+ ComponentInternalInstance
} from '@vue/runtime-core'
import { hyphenate, isArray } from '@vue/shared'
*/
export const withKeys = (fn: Function, modifiers: string[]) => {
let globalKeyCodes: LegacyConfig['keyCodes']
+ let instance: ComponentInternalInstance | null = null
if (__COMPAT__) {
- if (compatUtils.isCompatEnabled(DeprecationTypes.CONFIG_KEY_CODES)) {
- const instance = getCurrentInstance()
+ instance = getCurrentInstance()
+ if (
+ compatUtils.isCompatEnabled(DeprecationTypes.CONFIG_KEY_CODES, instance)
+ ) {
if (instance) {
globalKeyCodes = ((instance.appContext.config as any) as LegacyConfig)
.keyCodes
}
}
if (__DEV__ && modifiers.some(m => /^\d+$/.test(m))) {
- compatUtils.warnDeprecation(DeprecationTypes.V_ON_KEYCODE_MODIFIER)
+ compatUtils.warnDeprecation(
+ DeprecationTypes.V_ON_KEYCODE_MODIFIER,
+ instance
+ )
}
}
if (__COMPAT__) {
const keyCode = String(event.keyCode)
if (
- compatUtils.isCompatEnabled(DeprecationTypes.V_ON_KEYCODE_MODIFIER) &&
+ compatUtils.isCompatEnabled(
+ DeprecationTypes.V_ON_KEYCODE_MODIFIER,
+ instance
+ ) &&
modifiers.some(mod => mod == keyCode)
) {
return fn(event)
for (let i = 0; i < container.attributes.length; i++) {
const attr = container.attributes[i]
if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
- compatUtils.warnDeprecation(DeprecationTypes.GLOBAL_MOUNT_CONTAINER)
+ compatUtils.warnDeprecation(
+ DeprecationTypes.GLOBAL_MOUNT_CONTAINER,
+ null
+ )
break
}
}
v2CocercedValue &&
compatUtils.softAssertCompatEnabled(
DeprecationTypes.ATTR_ENUMERATED_COERSION,
+ null,
key,
value,
v2CocercedValue
} else if (
value === false &&
!isSpecialBooleanAttr(key) &&
- compatUtils.softAssertCompatEnabled(DeprecationTypes.ATTR_FALSE_VALUE, key)
+ compatUtils.softAssertCompatEnabled(
+ DeprecationTypes.ATTR_FALSE_VALUE,
+ null,
+ key
+ )
) {
el.removeAttribute(key)
return true