From 739d78beaa91bb2a52ea9ae2f72770c55871af0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Tue, 26 Nov 2024 22:48:56 +0800 Subject: [PATCH] fix: skip checking private properties of typeParameters ref: https://github.com/vitejs/vite-plugin-vue/commit/e4f5fffa4a9d4f08668b93cad6a410ccad543541 --- src/core/handleHotUpdate.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/handleHotUpdate.ts b/src/core/handleHotUpdate.ts index fb911177..645e7cc8 100644 --- a/src/core/handleHotUpdate.ts +++ b/src/core/handleHotUpdate.ts @@ -254,7 +254,6 @@ function isEqualAst(prev?: t.Statement[], next?: t.Statement[]): boolean { return prev === next } - // deep equal, but ignore start/end/loc/range/leadingComments/trailingComments/innerComments if (prev.length !== next.length) { return false } @@ -262,6 +261,7 @@ function isEqualAst(prev?: t.Statement[], next?: t.Statement[]): boolean { for (const [i, prevNode] of prev.entries()) { const nextNode = next[i] if ( + // deep equal, but ignore start/end/loc/range/leadingComments/trailingComments/innerComments !deepEqual(prevNode, nextNode, [ 'start', 'end', @@ -270,6 +270,12 @@ function isEqualAst(prev?: t.Statement[], next?: t.Statement[]): boolean { 'leadingComments', 'trailingComments', 'innerComments', + // https://github.com/vuejs/core/issues/11923 + // avoid comparing the following properties of typeParameters + // as it may be imported from 3rd lib and complex to compare + '_ownerScope', + '_resolvedReference', + '_resolvedElements', ]) ) { return false