]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(types): avoid exposing lru-cache types in generated dts
authorEvan You <yyx990803@gmail.com>
Mon, 6 Nov 2023 09:35:50 +0000 (17:35 +0800)
committerEvan You <yyx990803@gmail.com>
Mon, 6 Nov 2023 09:36:02 +0000 (17:36 +0800)
close #9521

packages/compiler-sfc/src/index.ts

index 76b4900d46d6e037d8147b2dca61027255c98833..c63e302e0c338220f1b0276bf990198f206a7f38 100644 (file)
@@ -1,13 +1,17 @@
 export const version = __VERSION__
 
 // API
-export { parse, parseCache } from './parse'
+export { parse } from './parse'
 export { compileTemplate } from './compileTemplate'
 export { compileStyle, compileStyleAsync } from './compileStyle'
 export { compileScript } from './compileScript'
 export { rewriteDefault, rewriteDefaultAST } from './rewriteDefault'
 export { resolveTypeElements, inferRuntimeType } from './script/resolveType'
 
+import { SFCParseResult, parseCache as _parseCache } from './parse'
+// #9521 export parseCache as a simple map to avoid exposing LRU types
+export const parseCache = _parseCache as Map<string, SFCParseResult>
+
 // TODO remove in 3.4
 export {
   shouldTransform as shouldTransformRef,