@vue/compiler-sfc 3.2.14 → 3.2.18

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.
@@ -17103,6 +17103,9 @@ function stripTemplateString(str) {
17103
17103
  return '';
17104
17104
  }
17105
17105
 
17106
+ // API
17107
+ const walk$1 = estreeWalker.walk;
17108
+
17106
17109
  exports.extractIdentifiers = compilerCore.extractIdentifiers;
17107
17110
  exports.generateCodeFrame = compilerCore.generateCodeFrame;
17108
17111
  exports.isInDestructureAssignment = compilerCore.isInDestructureAssignment;
@@ -17110,7 +17113,6 @@ exports.isStaticProperty = compilerCore.isStaticProperty;
17110
17113
  exports.walkIdentifiers = compilerCore.walkIdentifiers;
17111
17114
  exports.MagicString = MagicString__default;
17112
17115
  exports.babelParse = parser$2.parse;
17113
- exports.walk = estreeWalker.walk;
17114
17116
  exports.shouldTransformRef = refTransform.shouldTransform;
17115
17117
  exports.transformRef = refTransform.transform;
17116
17118
  exports.transformRefAST = refTransform.transformAST;
@@ -17120,3 +17122,4 @@ exports.compileStyleAsync = compileStyleAsync;
17120
17122
  exports.compileTemplate = compileTemplate;
17121
17123
  exports.parse = parse;
17122
17124
  exports.rewriteDefault = rewriteDefault;
17125
+ exports.walk = walk$1;
@@ -19,7 +19,6 @@ import { shouldTransform as shouldTransformRef } from '@vue/ref-transform';
19
19
  import { SourceLocation } from '@vue/compiler-core';
20
20
  import { transform as transformRef } from '@vue/ref-transform';
21
21
  import { transformAST as transformRefAST } from '@vue/ref-transform';
22
- import { walk } from 'estree-walker';
23
22
  import { walkIdentifiers } from '@vue/compiler-core';
24
23
 
25
24
  declare interface AssetURLOptions {
@@ -280,7 +279,7 @@ export { transformRef }
280
279
 
281
280
  export { transformRefAST }
282
281
 
283
- export { walk }
282
+ export declare const walk: any;
284
283
 
285
284
  export { walkIdentifiers }
286
285
 
@@ -15447,21 +15447,21 @@ const isMemberExpressionBrowser = (path) => {
15447
15447
  return !currentOpenBracketCount && !currentOpenParensCount;
15448
15448
  };
15449
15449
  const isMemberExpressionNode = (path, context) => {
15450
- try {
15451
- let ret = parseExpression_1(path, {
15452
- plugins: [...context.expressionPlugins, ...babelParserDefaultPlugins]
15453
- });
15454
- if (ret.type === 'TSAsExpression' || ret.type === 'TSTypeAssertion') {
15455
- ret = ret.expression;
15450
+ try {
15451
+ let ret = parseExpression_1(path, {
15452
+ plugins: [...context.expressionPlugins, ...babelParserDefaultPlugins]
15453
+ });
15454
+ if (ret.type === 'TSAsExpression' || ret.type === 'TSTypeAssertion') {
15455
+ ret = ret.expression;
15456
+ }
15457
+ return (ret.type === 'MemberExpression' ||
15458
+ ret.type === 'OptionalMemberExpression' ||
15459
+ ret.type === 'Identifier');
15456
15460
  }
15457
- return (ret.type === 'MemberExpression' ||
15458
- ret.type === 'OptionalMemberExpression' ||
15459
- ret.type === 'Identifier');
15460
- }
15461
- catch (e) {
15462
- return false;
15463
- }
15464
- };
15461
+ catch (e) {
15462
+ return false;
15463
+ }
15464
+ };
15465
15465
  const isMemberExpression = isMemberExpressionNode;
15466
15466
  function getInnerRange(loc, offset, length) {
15467
15467
  const source = loc.source.substr(offset, length);
@@ -20389,7 +20389,7 @@ var sourceMap = {
20389
20389
  };
20390
20390
 
20391
20391
  const PURE_ANNOTATION = `/*#__PURE__*/`;
20392
- function createCodegenContext(ast, { mode = 'function', prefixIdentifiers = mode === 'module', sourceMap = false, filename = `template.vue.html`, scopeId = null, optimizeImports = false, runtimeGlobalName = `Vue`, runtimeModuleName = `vue`, ssr = false, isTS = false, inSSR = false }) {
20392
+ function createCodegenContext(ast, { mode = 'function', prefixIdentifiers = mode === 'module', sourceMap = false, filename = `template.vue.html`, scopeId = null, optimizeImports = false, runtimeGlobalName = `Vue`, runtimeModuleName = `vue`, ssrRuntimeModuleName = 'vue/server-renderer', ssr = false, isTS = false, inSSR = false }) {
20393
20393
  const context = {
20394
20394
  mode,
20395
20395
  prefixIdentifiers,
@@ -20399,6 +20399,7 @@ function createCodegenContext(ast, { mode = 'function', prefixIdentifiers = mode
20399
20399
  optimizeImports,
20400
20400
  runtimeGlobalName,
20401
20401
  runtimeModuleName,
20402
+ ssrRuntimeModuleName,
20402
20403
  ssr,
20403
20404
  isTS,
20404
20405
  inSSR,
@@ -20570,7 +20571,7 @@ function generate(ast, options = {}) {
20570
20571
  };
20571
20572
  }
20572
20573
  function genFunctionPreamble(ast, context) {
20573
- const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName } = context;
20574
+ const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName, ssrRuntimeModuleName } = context;
20574
20575
  const VueBinding = ssr
20575
20576
  ? `require(${JSON.stringify(runtimeModuleName)})`
20576
20577
  : runtimeGlobalName;
@@ -20610,14 +20611,14 @@ function genFunctionPreamble(ast, context) {
20610
20611
  // ssr guarantees prefixIdentifier: true
20611
20612
  push(`const { ${ast.ssrHelpers
20612
20613
  .map(aliasHelper)
20613
- .join(', ')} } = require("@vue/server-renderer")\n`);
20614
+ .join(', ')} } = require("${ssrRuntimeModuleName}")\n`);
20614
20615
  }
20615
20616
  genHoists(ast.hoists, context);
20616
20617
  newline();
20617
20618
  push(`return `);
20618
20619
  }
20619
20620
  function genModulePreamble(ast, context, genScopeId, inline) {
20620
- const { push, newline, optimizeImports, runtimeModuleName } = context;
20621
+ const { push, newline, optimizeImports, runtimeModuleName, ssrRuntimeModuleName } = context;
20621
20622
  if (genScopeId && ast.hoists.length) {
20622
20623
  ast.helpers.push(PUSH_SCOPE_ID, POP_SCOPE_ID);
20623
20624
  }
@@ -20645,7 +20646,7 @@ function genModulePreamble(ast, context, genScopeId, inline) {
20645
20646
  if (ast.ssrHelpers && ast.ssrHelpers.length) {
20646
20647
  push(`import { ${ast.ssrHelpers
20647
20648
  .map(s => `${helperNameMap[s]} as _${helperNameMap[s]}`)
20648
- .join(', ')} } from "@vue/server-renderer"\n`);
20649
+ .join(', ')} } from "${ssrRuntimeModuleName}"\n`);
20649
20650
  }
20650
20651
  if (ast.imports.length) {
20651
20652
  genImports(ast.imports, context);
@@ -47821,4 +47822,7 @@ function stripTemplateString(str) {
47821
47822
  return '';
47822
47823
  }
47823
47824
 
47824
- export { MagicString, parse_1 as babelParse, compileScript, compileStyle, compileStyleAsync, compileTemplate, extractIdentifiers, generateCodeFrame, isInDestructureAssignment, isStaticProperty, parse$2 as parse, rewriteDefault, shouldTransform as shouldTransformRef, transform$1 as transformRef, transformAST as transformRefAST, walk$1 as walk, walkIdentifiers };
47825
+ // API
47826
+ const walk$2 = walk$1;
47827
+
47828
+ export { MagicString, parse_1 as babelParse, compileScript, compileStyle, compileStyleAsync, compileTemplate, extractIdentifiers, generateCodeFrame, isInDestructureAssignment, isStaticProperty, parse$2 as parse, rewriteDefault, shouldTransform as shouldTransformRef, transform$1 as transformRef, transformAST as transformRefAST, walk$2 as walk, walkIdentifiers };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-sfc",
3
- "version": "3.2.14",
3
+ "version": "3.2.18",
4
4
  "description": "@vue/compiler-sfc",
5
5
  "main": "dist/compiler-sfc.cjs.js",
6
6
  "module": "dist/compiler-sfc.esm-browser.js",
@@ -33,11 +33,11 @@
33
33
  "homepage": "https://github.com/vuejs/vue-next/tree/master/packages/compiler-sfc#readme",
34
34
  "dependencies": {
35
35
  "@babel/parser": "^7.15.0",
36
- "@vue/compiler-core": "3.2.14",
37
- "@vue/compiler-dom": "3.2.14",
38
- "@vue/compiler-ssr": "3.2.14",
39
- "@vue/ref-transform": "3.2.14",
40
- "@vue/shared": "3.2.14",
36
+ "@vue/compiler-core": "3.2.18",
37
+ "@vue/compiler-dom": "3.2.18",
38
+ "@vue/compiler-ssr": "3.2.18",
39
+ "@vue/ref-transform": "3.2.18",
40
+ "@vue/shared": "3.2.18",
41
41
  "estree-walker": "^2.0.2",
42
42
  "magic-string": "^0.25.7",
43
43
  "source-map": "^0.6.1",