Skip to content

Commit

Permalink
fix(compat): don't warn deprecation if compat config is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
noootwo committed Nov 20, 2024
1 parent a20a4cb commit 4e7ca53
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/runtime-core/src/compat/compatConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,8 @@ export function warnDeprecation(

instance = instance || getCurrentInstance()

// check user config
const config = getCompatConfigForKey(key, instance)
if (config === 'suppress-warning') {
// check if compat is enabled
if (!isCompatEnabled(key, instance, true)) {
return
}

Expand Down Expand Up @@ -484,12 +483,6 @@ export function warnDeprecation(
typeof message === 'function' ? message(...args) : message
}${link ? `\n Details: ${link}` : ``}`,
)
if (!isCompatEnabled(key, instance, true)) {
console.error(
`^ The above deprecation's compat behavior is disabled and will likely ` +
`lead to runtime errors.`,
)
}
}

export type CompatConfig = Partial<
Expand Down

0 comments on commit 4e7ca53

Please sign in to comment.