Skip to content

Commit ff31f50

Browse files
authored
chore: remove warnRecursiveComputed (#13128)
1 parent 5cf205e commit ff31f50

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

Diff for: packages/reactivity/src/computed.ts

-6
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,6 @@ export class ComputedRefImpl<T = any> implements Dependency, Subscriber {
119119
// dev only
120120
onTrigger?: (event: DebuggerEvent) => void
121121

122-
/**
123-
* Dev only
124-
* @internal
125-
*/
126-
_warnRecursive?: boolean
127-
128122
constructor(
129123
public fn: ComputedGetter<T>,
130124
private readonly setter: ComputedSetter<T> | undefined,

Diff for: packages/runtime-core/src/apiComputed.ts

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
import { type ComputedRefImpl, computed as _computed } from '@vue/reactivity'
2-
import { getCurrentInstance, isInSSRComponentSetup } from './component'
1+
import { computed as _computed } from '@vue/reactivity'
2+
import { isInSSRComponentSetup } from './component'
33

44
export const computed: typeof _computed = (
55
getterOrOptions: any,
66
debugOptions?: any,
77
) => {
88
// @ts-expect-error
9-
const c = _computed(getterOrOptions, debugOptions, isInSSRComponentSetup)
10-
if (__DEV__) {
11-
const i = getCurrentInstance()
12-
if (i && i.appContext.config.warnRecursiveComputed) {
13-
;(c as unknown as ComputedRefImpl<any>)._warnRecursive = true
14-
}
15-
}
16-
return c as any
9+
return _computed(getterOrOptions, debugOptions, isInSSRComponentSetup) as any
1710
}

Diff for: packages/runtime-core/src/apiCreateApp.ts

-6
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,6 @@ export interface AppConfig {
149149
*/
150150
isCustomElement?: (tag: string) => boolean
151151

152-
/**
153-
* TODO document for 3.5
154-
* Enable warnings for computed getters that recursively trigger itself.
155-
*/
156-
warnRecursiveComputed?: boolean
157-
158152
/**
159153
* Whether to throw unhandled errors in production.
160154
* Default is `false` to avoid crashing on any error (and only logs it)

0 commit comments

Comments
 (0)