@vue/compiler-sfc 3.6.0-beta.11 → 3.6.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-sfc v3.6.0-beta.11
2
+ * @vue/compiler-sfc v3.6.0-beta.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -197,33 +197,33 @@ function genNormalScriptCssVarsCode(cssVars, bindings, id, isProd, defaultVar) {
197
197
  return `\nimport { ${CSS_VARS_HELPER} as _${CSS_VARS_HELPER} } from 'vue'\nconst __injectCSSVars__ = () => {\n${genCssVarsCode(cssVars, bindings, id, isProd)}}\nconst __setup__ = ${defaultVar}.setup\n${defaultVar}.setup = __setup__\n ? (props, ctx) => { __injectCSSVars__();return __setup__(props, ctx) }\n : __injectCSSVars__\n`;
198
198
  }
199
199
  //#endregion
200
- //#region \0@oxc-project+runtime@0.128.0/helpers/checkPrivateRedeclaration.js
200
+ //#region \0@oxc-project+runtime@0.129.0/helpers/checkPrivateRedeclaration.js
201
201
  function _checkPrivateRedeclaration(e, t) {
202
202
  if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
203
203
  }
204
204
  //#endregion
205
- //#region \0@oxc-project+runtime@0.128.0/helpers/classPrivateMethodInitSpec.js
205
+ //#region \0@oxc-project+runtime@0.129.0/helpers/classPrivateMethodInitSpec.js
206
206
  function _classPrivateMethodInitSpec(e, a) {
207
207
  _checkPrivateRedeclaration(e, a), a.add(e);
208
208
  }
209
209
  //#endregion
210
- //#region \0@oxc-project+runtime@0.128.0/helpers/classPrivateFieldInitSpec.js
210
+ //#region \0@oxc-project+runtime@0.129.0/helpers/classPrivateFieldInitSpec.js
211
211
  function _classPrivateFieldInitSpec(e, t, a) {
212
212
  _checkPrivateRedeclaration(e, t), t.set(e, a);
213
213
  }
214
214
  //#endregion
215
- //#region \0@oxc-project+runtime@0.128.0/helpers/assertClassBrand.js
215
+ //#region \0@oxc-project+runtime@0.129.0/helpers/assertClassBrand.js
216
216
  function _assertClassBrand(e, t, n) {
217
217
  if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
218
218
  throw new TypeError("Private element is not present on this object");
219
219
  }
220
220
  //#endregion
221
- //#region \0@oxc-project+runtime@0.128.0/helpers/classPrivateFieldGet2.js
221
+ //#region \0@oxc-project+runtime@0.129.0/helpers/classPrivateFieldGet2.js
222
222
  function _classPrivateFieldGet2(s, a) {
223
223
  return s.get(_assertClassBrand(s, a));
224
224
  }
225
225
  //#endregion
226
- //#region \0@oxc-project+runtime@0.128.0/helpers/classPrivateFieldSet2.js
226
+ //#region \0@oxc-project+runtime@0.129.0/helpers/classPrivateFieldSet2.js
227
227
  function _classPrivateFieldSet2(s, a, r) {
228
228
  return s.set(_assertClassBrand(s, a), r), r;
229
229
  }
@@ -13892,25 +13892,28 @@ function loadTSConfig(configPath, ts, fs, visited = /* @__PURE__ */ new Set()) {
13892
13892
  return res;
13893
13893
  }
13894
13894
  const fileToScopeCache = createCache();
13895
+ const fileToGlobalScopeCache = createCache();
13895
13896
  /**
13896
13897
  * @private
13897
13898
  */
13898
13899
  function invalidateTypeCache(filename) {
13899
13900
  filename = normalizePath(filename);
13900
13901
  fileToScopeCache.delete(filename);
13902
+ fileToGlobalScopeCache.delete(filename);
13901
13903
  tsConfigCache.delete(filename);
13902
13904
  const affectedConfig = tsConfigRefMap.get(filename);
13903
13905
  if (affectedConfig) tsConfigCache.delete(affectedConfig);
13904
13906
  }
13905
13907
  function fileToScope(ctx, filename, asGlobal = false) {
13906
- const cached = fileToScopeCache.get(filename);
13908
+ const cache = asGlobal ? fileToGlobalScopeCache : fileToScopeCache;
13909
+ const cached = cache.get(filename);
13907
13910
  if (cached) return cached;
13908
13911
  const fs = resolveFS(ctx);
13909
13912
  const source = fs.readFile(filename) || "";
13910
13913
  const body = parseFile(filename, source, fs, ctx.options.babelParserPlugins);
13911
13914
  const scope = new TypeScope(filename, source, 0, recordImports(body));
13912
13915
  recordTypes(ctx, body, scope, asGlobal);
13913
- fileToScopeCache.set(filename, scope);
13916
+ cache.set(filename, scope);
13914
13917
  return scope;
13915
13918
  }
13916
13919
  function parseFile(filename, content, fs, parserPlugins) {
@@ -15282,7 +15285,7 @@ function compileScript(sfc, options) {
15282
15285
  if (emitsDecl) runtimeOptions += `\n emits: ${emitsDecl},`;
15283
15286
  if (vapor && !ssr && sfc.template && !sfc.template.src) {
15284
15287
  var _options$templateOpti2;
15285
- runtimeOptions += `\n __multiRoot: ${isMultiRoot(sfc.template.ast, (_options$templateOpti2 = options.templateOptions) === null || _options$templateOpti2 === void 0 ? void 0 : _options$templateOpti2.compilerOptions)},`;
15288
+ if (isMultiRoot(sfc.template.ast, (_options$templateOpti2 = options.templateOptions) === null || _options$templateOpti2 === void 0 ? void 0 : _options$templateOpti2.compilerOptions)) runtimeOptions += `\n __multiRoot: true,`;
15286
15289
  }
15287
15290
  let definedOptions = "";
15288
15291
  if (ctx.optionsRuntimeDecl) definedOptions = scriptSetup.content.slice(ctx.optionsRuntimeDecl.start, ctx.optionsRuntimeDecl.end).trim();
@@ -15440,7 +15443,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
15440
15443
  }
15441
15444
  //#endregion
15442
15445
  //#region packages/compiler-sfc/src/index.ts
15443
- const version = "3.6.0-beta.11";
15446
+ const version = "3.6.0-beta.13";
15444
15447
  const parseCache = parseCache$1;
15445
15448
  const errorMessages = {
15446
15449
  ..._vue_compiler_dom.errorMessages,
@@ -1,4 +1,4 @@
1
- import * as _babel_types0 from "@babel/types";
1
+ import * as _$_babel_types0 from "@babel/types";
2
2
  import { CallExpression as CallExpression$1, Expression as Expression$1, Node as Node$1, ObjectPattern, Program as Program$1, Statement as Statement$1, TSCallSignatureDeclaration, TSFunctionType, TSMethodSignature, TSModuleDeclaration, TSPropertySignature, TSType } from "@babel/types";
3
3
  import { BaseCodegenResult, BindingMetadata, BindingMetadata as BindingMetadata$1, CompilerError, CompilerError as CompilerError$1, CompilerOptions as CompilerOptions$1, CompilerOptions as CompilerOptions$2, ParserOptions, RawSourceMap, RootNode, SourceLocation, extractIdentifiers, generateCodeFrame, isInDestructureAssignment, isStaticProperty, walkIdentifiers } from "@vue/compiler-core";
4
4
  import { ParserPlugin, parse as babelParse } from "@babel/parser";
@@ -185,8 +185,8 @@ export interface SFCScriptBlock extends SFCBlock {
185
185
  setup?: string | boolean;
186
186
  bindings?: BindingMetadata$1;
187
187
  imports?: Record<string, ImportBinding>;
188
- scriptAst?: _babel_types0.Statement[];
189
- scriptSetupAst?: _babel_types0.Statement[];
188
+ scriptAst?: _$_babel_types0.Statement[];
189
+ scriptSetupAst?: _$_babel_types0.Statement[];
190
190
  warnings?: string[];
191
191
  /**
192
192
  * Fully resolved dependency file paths (unix slashes) with imported types