Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compat): don't warn deprecation if compat config is disabled #12446

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading