]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: remove warnRecursiveComputed (#13128)
authoredison <daiwei521@126.com>
Fri, 11 Apr 2025 06:36:38 +0000 (14:36 +0800)
committerGitHub <noreply@github.com>
Fri, 11 Apr 2025 06:36:38 +0000 (23:36 -0700)
packages/reactivity/src/computed.ts
packages/runtime-core/src/apiComputed.ts
packages/runtime-core/src/apiCreateApp.ts

index 70670d81ec26b4367b1d0b802483837ef308804a..ad518f3c5e6cc3cab956f99853719a1cba92c9da 100644 (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,
index 2ebb2d4e63a40796b7757e833078f8a8009542cf..39ec10a15f4eb0a9bab2bb2ee516595f259ef0b4 100644 (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
 }
index 748de866f75ebfa50847da47af39cd15f07ada5c..08a6dda2a5f2e4c887b5e83d270e61c100fac02e 100644 (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)