@vue/compiler-sfc 3.4.0 → 3.4.2
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.cjs.js
CHANGED
|
@@ -1743,10 +1743,10 @@ function createCache(max = 500) {
|
|
|
1743
1743
|
}
|
|
1744
1744
|
|
|
1745
1745
|
function isImportUsed(local, sfc) {
|
|
1746
|
-
return
|
|
1746
|
+
return resolveTemplateUsedIdentifiers(sfc).has(local);
|
|
1747
1747
|
}
|
|
1748
1748
|
const templateUsageCheckCache = createCache();
|
|
1749
|
-
function
|
|
1749
|
+
function resolveTemplateUsedIdentifiers(sfc) {
|
|
1750
1750
|
const { content, ast } = sfc.template;
|
|
1751
1751
|
const cached = templateUsageCheckCache.get(content);
|
|
1752
1752
|
if (cached) {
|
|
@@ -1758,9 +1758,12 @@ function resolveTemplateUsageCheckString(sfc) {
|
|
|
1758
1758
|
var _a;
|
|
1759
1759
|
switch (node.type) {
|
|
1760
1760
|
case 1:
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1761
|
+
let tag = node.tag;
|
|
1762
|
+
if (tag.includes("."))
|
|
1763
|
+
tag = tag.split(".")[0].trim();
|
|
1764
|
+
if (!CompilerDOM.parserOptions.isNativeTag(tag) && !CompilerDOM.parserOptions.isBuiltInComponent(tag)) {
|
|
1765
|
+
ids.add(shared.camelize(tag));
|
|
1766
|
+
ids.add(shared.capitalize(shared.camelize(tag)));
|
|
1764
1767
|
}
|
|
1765
1768
|
for (let i = 0; i < node.props.length; i++) {
|
|
1766
1769
|
const prop = node.props[i];
|
|
@@ -1808,6 +1811,7 @@ function parse$2(source, {
|
|
|
1808
1811
|
pad = false,
|
|
1809
1812
|
ignoreEmpty = true,
|
|
1810
1813
|
compiler = CompilerDOM__namespace,
|
|
1814
|
+
templateParseOptions = {},
|
|
1811
1815
|
parseExpressions = true
|
|
1812
1816
|
} = {}) {
|
|
1813
1817
|
const sourceKey = source + sourceMap + filename + sourceRoot + pad + compiler.parse;
|
|
@@ -1831,6 +1835,7 @@ function parse$2(source, {
|
|
|
1831
1835
|
const ast = compiler.parse(source, {
|
|
1832
1836
|
parseMode: "sfc",
|
|
1833
1837
|
prefixIdentifiers: parseExpressions,
|
|
1838
|
+
...templateParseOptions,
|
|
1834
1839
|
onError: (e) => {
|
|
1835
1840
|
errors.push(e);
|
|
1836
1841
|
}
|
|
@@ -20577,7 +20582,7 @@ function isStaticNode(node) {
|
|
|
20577
20582
|
return false;
|
|
20578
20583
|
}
|
|
20579
20584
|
|
|
20580
|
-
const version = "3.4.
|
|
20585
|
+
const version = "3.4.2";
|
|
20581
20586
|
const parseCache = parseCache$1;
|
|
20582
20587
|
const errorMessages = {
|
|
20583
20588
|
...CompilerDOM.errorMessages,
|
package/dist/compiler-sfc.d.ts
CHANGED
|
@@ -158,6 +158,11 @@ export interface SFCParseOptions {
|
|
|
158
158
|
pad?: boolean | 'line' | 'space';
|
|
159
159
|
ignoreEmpty?: boolean;
|
|
160
160
|
compiler?: TemplateCompiler;
|
|
161
|
+
templateParseOptions?: ParserOptions;
|
|
162
|
+
/**
|
|
163
|
+
* TODO remove in 3.5
|
|
164
|
+
* @deprecated use `templateParseOptions: { prefixIdentifiers: false }` instead
|
|
165
|
+
*/
|
|
161
166
|
parseExpressions?: boolean;
|
|
162
167
|
}
|
|
163
168
|
export interface SFCBlock {
|
|
@@ -221,7 +226,7 @@ export interface SFCParseResult {
|
|
|
221
226
|
descriptor: SFCDescriptor;
|
|
222
227
|
errors: (CompilerError | SyntaxError)[];
|
|
223
228
|
}
|
|
224
|
-
export declare function parse(source: string, { sourceMap, filename, sourceRoot, pad, ignoreEmpty, compiler, parseExpressions, }?: SFCParseOptions): SFCParseResult;
|
|
229
|
+
export declare function parse(source: string, { sourceMap, filename, sourceRoot, pad, ignoreEmpty, compiler, templateParseOptions, parseExpressions, }?: SFCParseOptions): SFCParseResult;
|
|
225
230
|
|
|
226
231
|
type PreprocessLang = 'less' | 'sass' | 'scss' | 'styl' | 'stylus';
|
|
227
232
|
|
|
@@ -2073,7 +2073,7 @@ const CompilerDeprecationTypes = {
|
|
|
2073
2073
|
"COMPILER_V_IF_V_FOR_PRECEDENCE": "COMPILER_V_IF_V_FOR_PRECEDENCE",
|
|
2074
2074
|
"COMPILER_NATIVE_TEMPLATE": "COMPILER_NATIVE_TEMPLATE",
|
|
2075
2075
|
"COMPILER_INLINE_TEMPLATE": "COMPILER_INLINE_TEMPLATE",
|
|
2076
|
-
"COMPILER_FILTERS": "
|
|
2076
|
+
"COMPILER_FILTERS": "COMPILER_FILTERS"
|
|
2077
2077
|
};
|
|
2078
2078
|
const deprecationData = {
|
|
2079
2079
|
["COMPILER_IS_ON_ELEMENT"]: {
|
|
@@ -2103,7 +2103,7 @@ const deprecationData = {
|
|
|
2103
2103
|
message: `"inline-template" has been removed in Vue 3.`,
|
|
2104
2104
|
link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html`
|
|
2105
2105
|
},
|
|
2106
|
-
["
|
|
2106
|
+
["COMPILER_FILTERS"]: {
|
|
2107
2107
|
message: `filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.`,
|
|
2108
2108
|
link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`
|
|
2109
2109
|
}
|
|
@@ -26574,10 +26574,10 @@ function createCache(max = 500) {
|
|
|
26574
26574
|
}
|
|
26575
26575
|
|
|
26576
26576
|
function isImportUsed(local, sfc) {
|
|
26577
|
-
return
|
|
26577
|
+
return resolveTemplateUsedIdentifiers(sfc).has(local);
|
|
26578
26578
|
}
|
|
26579
26579
|
const templateUsageCheckCache = createCache();
|
|
26580
|
-
function
|
|
26580
|
+
function resolveTemplateUsedIdentifiers(sfc) {
|
|
26581
26581
|
const { content, ast } = sfc.template;
|
|
26582
26582
|
const cached = templateUsageCheckCache.get(content);
|
|
26583
26583
|
if (cached) {
|
|
@@ -26589,9 +26589,12 @@ function resolveTemplateUsageCheckString(sfc) {
|
|
|
26589
26589
|
var _a;
|
|
26590
26590
|
switch (node.type) {
|
|
26591
26591
|
case 1:
|
|
26592
|
-
|
|
26593
|
-
|
|
26594
|
-
|
|
26592
|
+
let tag = node.tag;
|
|
26593
|
+
if (tag.includes("."))
|
|
26594
|
+
tag = tag.split(".")[0].trim();
|
|
26595
|
+
if (!parserOptions.isNativeTag(tag) && !parserOptions.isBuiltInComponent(tag)) {
|
|
26596
|
+
ids.add(camelize(tag));
|
|
26597
|
+
ids.add(capitalize$1(camelize(tag)));
|
|
26595
26598
|
}
|
|
26596
26599
|
for (let i = 0; i < node.props.length; i++) {
|
|
26597
26600
|
const prop = node.props[i];
|
|
@@ -26630,6 +26633,25 @@ function extractIdentifiers(ids, node) {
|
|
|
26630
26633
|
}
|
|
26631
26634
|
}
|
|
26632
26635
|
|
|
26636
|
+
var __defProp$a = Object.defineProperty;
|
|
26637
|
+
var __defProps$9 = Object.defineProperties;
|
|
26638
|
+
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
|
26639
|
+
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
26640
|
+
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
26641
|
+
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
26642
|
+
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
26643
|
+
var __spreadValues$a = (a, b) => {
|
|
26644
|
+
for (var prop in b || (b = {}))
|
|
26645
|
+
if (__hasOwnProp$a.call(b, prop))
|
|
26646
|
+
__defNormalProp$a(a, prop, b[prop]);
|
|
26647
|
+
if (__getOwnPropSymbols$a)
|
|
26648
|
+
for (var prop of __getOwnPropSymbols$a(b)) {
|
|
26649
|
+
if (__propIsEnum$a.call(b, prop))
|
|
26650
|
+
__defNormalProp$a(a, prop, b[prop]);
|
|
26651
|
+
}
|
|
26652
|
+
return a;
|
|
26653
|
+
};
|
|
26654
|
+
var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
|
|
26633
26655
|
const DEFAULT_FILENAME = "anonymous.vue";
|
|
26634
26656
|
const parseCache$1 = createCache();
|
|
26635
26657
|
function parse$7(source, {
|
|
@@ -26639,6 +26661,7 @@ function parse$7(source, {
|
|
|
26639
26661
|
pad = false,
|
|
26640
26662
|
ignoreEmpty = true,
|
|
26641
26663
|
compiler = CompilerDOM,
|
|
26664
|
+
templateParseOptions = {},
|
|
26642
26665
|
parseExpressions = true
|
|
26643
26666
|
} = {}) {
|
|
26644
26667
|
const sourceKey = source + sourceMap + filename + sourceRoot + pad + compiler.parse;
|
|
@@ -26659,13 +26682,14 @@ function parse$7(source, {
|
|
|
26659
26682
|
shouldForceReload: (prevImports) => hmrShouldReload(prevImports, descriptor)
|
|
26660
26683
|
};
|
|
26661
26684
|
const errors = [];
|
|
26662
|
-
const ast = compiler.parse(source, {
|
|
26685
|
+
const ast = compiler.parse(source, __spreadProps$9(__spreadValues$a({
|
|
26663
26686
|
parseMode: "sfc",
|
|
26664
|
-
prefixIdentifiers: parseExpressions
|
|
26687
|
+
prefixIdentifiers: parseExpressions
|
|
26688
|
+
}, templateParseOptions), {
|
|
26665
26689
|
onError: (e) => {
|
|
26666
26690
|
errors.push(e);
|
|
26667
26691
|
}
|
|
26668
|
-
});
|
|
26692
|
+
}));
|
|
26669
26693
|
ast.children.forEach((node) => {
|
|
26670
26694
|
if (node.type !== 1) {
|
|
26671
26695
|
return;
|
|
@@ -31207,7 +31231,8 @@ const ssrTransformSlotOutlet = (node, context) => {
|
|
|
31207
31231
|
}
|
|
31208
31232
|
let method = SSR_RENDER_SLOT;
|
|
31209
31233
|
const parent = context.parent;
|
|
31210
|
-
|
|
31234
|
+
let componentType;
|
|
31235
|
+
if (parent && parent.type === 1 && parent.tagType === 1 && ((componentType = resolveComponentType(parent, context, true)) === TRANSITION || componentType === TRANSITION_GROUP) && parent.children.filter((c) => c.type === 1).length === 1) {
|
|
31211
31236
|
method = SSR_RENDER_SLOT_INNER;
|
|
31212
31237
|
if (!(context.scopeId && context.slotted !== false)) {
|
|
31213
31238
|
args.push("null");
|
|
@@ -48577,7 +48602,7 @@ var __spreadValues = (a, b) => {
|
|
|
48577
48602
|
}
|
|
48578
48603
|
return a;
|
|
48579
48604
|
};
|
|
48580
|
-
const version = "3.4.
|
|
48605
|
+
const version = "3.4.2";
|
|
48581
48606
|
const parseCache = parseCache$1;
|
|
48582
48607
|
const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages);
|
|
48583
48608
|
const walk = walk$2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-sfc",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"description": "@vue/compiler-sfc",
|
|
5
5
|
"main": "dist/compiler-sfc.cjs.js",
|
|
6
6
|
"module": "dist/compiler-sfc.esm-browser.js",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"magic-string": "^0.30.5",
|
|
38
38
|
"postcss": "^8.4.32",
|
|
39
39
|
"source-map-js": "^1.0.2",
|
|
40
|
-
"@vue/compiler-
|
|
41
|
-
"@vue/
|
|
42
|
-
"@vue/
|
|
43
|
-
"@vue/compiler-ssr": "3.4.
|
|
40
|
+
"@vue/compiler-dom": "3.4.2",
|
|
41
|
+
"@vue/shared": "3.4.2",
|
|
42
|
+
"@vue/compiler-core": "3.4.2",
|
|
43
|
+
"@vue/compiler-ssr": "3.4.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@babel/types": "^7.23.6",
|