chore: remove warnRecursiveComputed (#13128)

This commit is contained in:
edison 2025-04-11 14:36:38 +08:00 committed by GitHub
parent 5cf205e355
commit ff31f50b87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 22 deletions

View File

@ -119,12 +119,6 @@ export class ComputedRefImpl<T = any> implements Dependency, Subscriber {
// dev only
onTrigger?: (event: DebuggerEvent) => void
/**
* Dev only
* @internal
*/
_warnRecursive?: boolean
constructor(
public fn: ComputedGetter<T>,
private readonly setter: ComputedSetter<T> | undefined,

View File

@ -1,17 +1,10 @@
import { type ComputedRefImpl, computed as _computed } from '@vue/reactivity'
import { getCurrentInstance, isInSSRComponentSetup } from './component'
import { computed as _computed } from '@vue/reactivity'
import { isInSSRComponentSetup } from './component'
export const computed: typeof _computed = (
getterOrOptions: any,
debugOptions?: any,
) => {
// @ts-expect-error
const c = _computed(getterOrOptions, debugOptions, isInSSRComponentSetup)
if (__DEV__) {
const i = getCurrentInstance()
if (i && i.appContext.config.warnRecursiveComputed) {
;(c as unknown as ComputedRefImpl<any>)._warnRecursive = true
}
}
return c as any
return _computed(getterOrOptions, debugOptions, isInSSRComponentSetup) as any
}

View File

@ -149,12 +149,6 @@ export interface AppConfig {
*/
isCustomElement?: (tag: string) => boolean
/**
* TODO document for 3.5
* Enable warnings for computed getters that recursively trigger itself.
*/
warnRecursiveComputed?: boolean
/**
* Whether to throw unhandled errors in production.
* Default is `false` to avoid crashing on any error (and only logs it)