]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(devtools): allow setting devtools hook after createApp 13580/head
authordaiwei <daiwei521@126.com>
Mon, 7 Jul 2025 03:26:41 +0000 (11:26 +0800)
committerdaiwei <daiwei521@126.com>
Mon, 7 Jul 2025 03:26:41 +0000 (11:26 +0800)
the commit https://github.com/vuejs/core/commit/76e8d2c4d0c23534509b62f638bcdb8e7853af07 breaks test-utils, it setDevtoolsHook after createApp

more info https://github.com/vuejs/ecosystem-ci/actions/runs/16105836789/job/45441160502

packages/runtime-core/src/devtools.ts

index cf7b1973c427f881eba22a3ef43e522a67273608..8b300f6955b3fdd67f717e52ace26b07c7655f60 100644 (file)
@@ -49,11 +49,7 @@ function emit(event: string, ...args: any[]) {
   }
 }
 
-let queued = false
 export function setDevtoolsHook(hook: DevtoolsHook, target: any): void {
-  if (devtoolsNotInstalled || queued) {
-    return
-  }
   devtools = hook
   if (devtools) {
     devtools.enabled = true
@@ -70,7 +66,6 @@ export function setDevtoolsHook(hook: DevtoolsHook, target: any): void {
     // eslint-disable-next-line no-restricted-syntax
     !window.navigator?.userAgent?.includes('jsdom')
   ) {
-    queued = true
     const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
       target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [])
     replay.push((newHook: DevtoolsHook) => {