@vue/compiler-sfc 3.2.15 → 3.2.19
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.
- package/dist/compiler-sfc.esm-browser.js +23 -20
- package/package.json +6 -6
|
@@ -15447,21 +15447,21 @@ const isMemberExpressionBrowser = (path) => {
|
|
|
15447
15447
|
return !currentOpenBracketCount && !currentOpenParensCount;
|
|
15448
15448
|
};
|
|
15449
15449
|
const isMemberExpressionNode = (path, context) => {
|
|
15450
|
-
|
|
15451
|
-
|
|
15452
|
-
|
|
15453
|
-
|
|
15454
|
-
|
|
15455
|
-
|
|
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
|
-
|
|
15458
|
-
|
|
15459
|
-
|
|
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("
|
|
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 "
|
|
20649
|
+
.join(', ')} } from "${ssrRuntimeModuleName}"\n`);
|
|
20649
20650
|
}
|
|
20650
20651
|
if (ast.imports.length) {
|
|
20651
20652
|
genImports(ast.imports, context);
|
|
@@ -22138,7 +22139,9 @@ const transformFor = createStructuralDirectiveTransform('for', (node, dir, conte
|
|
|
22138
22139
|
? createSimpleExpression(keyProp.value.content, true)
|
|
22139
22140
|
: keyProp.exp);
|
|
22140
22141
|
const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
|
|
22141
|
-
if (context.prefixIdentifiers &&
|
|
22142
|
+
if (context.prefixIdentifiers &&
|
|
22143
|
+
keyProperty &&
|
|
22144
|
+
keyProp.type !== 6 /* ATTRIBUTE */) {
|
|
22142
22145
|
// #2085 process :key expression needs to be processed in order for it
|
|
22143
22146
|
// to behave consistently for <template v-for> and <div v-for>.
|
|
22144
22147
|
// In the case of `<template v-for>`, the node is discarded and never
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-sfc",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.19",
|
|
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.
|
|
37
|
-
"@vue/compiler-dom": "3.2.
|
|
38
|
-
"@vue/compiler-ssr": "3.2.
|
|
39
|
-
"@vue/ref-transform": "3.2.
|
|
40
|
-
"@vue/shared": "3.2.
|
|
36
|
+
"@vue/compiler-core": "3.2.19",
|
|
37
|
+
"@vue/compiler-dom": "3.2.19",
|
|
38
|
+
"@vue/compiler-ssr": "3.2.19",
|
|
39
|
+
"@vue/ref-transform": "3.2.19",
|
|
40
|
+
"@vue/shared": "3.2.19",
|
|
41
41
|
"estree-walker": "^2.0.2",
|
|
42
42
|
"magic-string": "^0.25.7",
|
|
43
43
|
"source-map": "^0.6.1",
|