Skip to content

chore: remove warnRecursiveComputed #13128

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

Merged
merged 1 commit into from
Apr 11, 2025
Merged
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
6 changes: 0 additions & 6 deletions packages/reactivity/src/computed.ts
Original file line number Diff line number Diff line change
@@ -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,
13 changes: 3 additions & 10 deletions packages/runtime-core/src/apiComputed.ts
Original file line number Diff line number Diff line change
@@ -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
}
6 changes: 0 additions & 6 deletions packages/runtime-core/src/apiCreateApp.ts
Original file line number Diff line number Diff line change
@@ -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)