From c3488d8f4596532a7424240370628f397e5bc026 Mon Sep 17 00:00:00 2001 From: arlo Date: Thu, 4 Jan 2024 21:51:25 +0800 Subject: [PATCH] fix: compatible with vue-query --- packages/devtools-kit/src/api/plugin.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/devtools-kit/src/api/plugin.ts b/packages/devtools-kit/src/api/plugin.ts index 219de75df..2506db09e 100644 --- a/packages/devtools-kit/src/api/plugin.ts +++ b/packages/devtools-kit/src/api/plugin.ts @@ -14,6 +14,15 @@ export async function registerPlugin(options: { app: VueAppInstance, api: DevToo const { app, api } = options const plugins = devtoolsState.pluginBuffer.filter(([plugin]) => plugin.app === app) plugins.forEach(async ([plugin, setupFn]) => { + if (plugin.packageName === 'vue-query') { + /** + * Skip it for now because plugin api doesn't support vue-query devtools plugin: + * https://github.com/TanStack/query/blob/main/packages/vue-query/src/devtools/devtools.ts + * @TODO: Need to discuss if we should be full compatible with the old devtools plugin api. + */ + return + } + const appRecord = await getAppRecord(plugin.app) // edge case for router plugin if (plugin.packageName === 'vue-router') { @@ -25,7 +34,6 @@ export async function registerPlugin(options: { app: VueAppInstance, api: DevToo })) } } - setupFn(api) })