@vue/compiler-sfc 3.4.1 → 3.4.3
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 +31 -17
- package/dist/compiler-sfc.d.ts +1 -1
- package/dist/compiler-sfc.esm-browser.js +32 -18
- package/package.json +5 -5
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];
|
|
@@ -1801,21 +1804,32 @@ function extractIdentifiers(ids, node) {
|
|
|
1801
1804
|
|
|
1802
1805
|
const DEFAULT_FILENAME = "anonymous.vue";
|
|
1803
1806
|
const parseCache$1 = createCache();
|
|
1804
|
-
function
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
}
|
|
1814
|
-
|
|
1807
|
+
function genCacheKey(source, options) {
|
|
1808
|
+
var _a;
|
|
1809
|
+
return source + JSON.stringify(
|
|
1810
|
+
{
|
|
1811
|
+
...options,
|
|
1812
|
+
compiler: { parse: (_a = options.compiler) == null ? void 0 : _a.parse }
|
|
1813
|
+
},
|
|
1814
|
+
(_, val) => typeof val === "function" ? val.toString() : val
|
|
1815
|
+
);
|
|
1816
|
+
}
|
|
1817
|
+
function parse$2(source, options = {}) {
|
|
1818
|
+
const sourceKey = genCacheKey(source, options);
|
|
1815
1819
|
const cache = parseCache$1.get(sourceKey);
|
|
1816
1820
|
if (cache) {
|
|
1817
1821
|
return cache;
|
|
1818
1822
|
}
|
|
1823
|
+
const {
|
|
1824
|
+
sourceMap = true,
|
|
1825
|
+
filename = DEFAULT_FILENAME,
|
|
1826
|
+
sourceRoot = "",
|
|
1827
|
+
pad = false,
|
|
1828
|
+
ignoreEmpty = true,
|
|
1829
|
+
compiler = CompilerDOM__namespace,
|
|
1830
|
+
templateParseOptions = {},
|
|
1831
|
+
parseExpressions = true
|
|
1832
|
+
} = options;
|
|
1819
1833
|
const descriptor = {
|
|
1820
1834
|
filename,
|
|
1821
1835
|
source,
|
|
@@ -20579,7 +20593,7 @@ function isStaticNode(node) {
|
|
|
20579
20593
|
return false;
|
|
20580
20594
|
}
|
|
20581
20595
|
|
|
20582
|
-
const version = "3.4.
|
|
20596
|
+
const version = "3.4.3";
|
|
20583
20597
|
const parseCache = parseCache$1;
|
|
20584
20598
|
const errorMessages = {
|
|
20585
20599
|
...CompilerDOM.errorMessages,
|
package/dist/compiler-sfc.d.ts
CHANGED
|
@@ -226,7 +226,7 @@ export interface SFCParseResult {
|
|
|
226
226
|
descriptor: SFCDescriptor;
|
|
227
227
|
errors: (CompilerError | SyntaxError)[];
|
|
228
228
|
}
|
|
229
|
-
export declare function parse(source: string,
|
|
229
|
+
export declare function parse(source: string, options?: SFCParseOptions): SFCParseResult;
|
|
230
230
|
|
|
231
231
|
type PreprocessLang = 'less' | 'sass' | 'scss' | 'styl' | 'stylus';
|
|
232
232
|
|
|
@@ -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];
|
|
@@ -26651,21 +26654,31 @@ var __spreadValues$a = (a, b) => {
|
|
|
26651
26654
|
var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
|
|
26652
26655
|
const DEFAULT_FILENAME = "anonymous.vue";
|
|
26653
26656
|
const parseCache$1 = createCache();
|
|
26654
|
-
function
|
|
26655
|
-
|
|
26656
|
-
|
|
26657
|
-
|
|
26658
|
-
|
|
26659
|
-
|
|
26660
|
-
|
|
26661
|
-
|
|
26662
|
-
|
|
26663
|
-
|
|
26664
|
-
const sourceKey = source
|
|
26657
|
+
function genCacheKey(source, options) {
|
|
26658
|
+
var _a;
|
|
26659
|
+
return source + JSON.stringify(
|
|
26660
|
+
__spreadProps$9(__spreadValues$a({}, options), {
|
|
26661
|
+
compiler: { parse: (_a = options.compiler) == null ? void 0 : _a.parse }
|
|
26662
|
+
}),
|
|
26663
|
+
(_, val) => typeof val === "function" ? val.toString() : val
|
|
26664
|
+
);
|
|
26665
|
+
}
|
|
26666
|
+
function parse$7(source, options = {}) {
|
|
26667
|
+
const sourceKey = genCacheKey(source, options);
|
|
26665
26668
|
const cache = parseCache$1.get(sourceKey);
|
|
26666
26669
|
if (cache) {
|
|
26667
26670
|
return cache;
|
|
26668
26671
|
}
|
|
26672
|
+
const {
|
|
26673
|
+
sourceMap = true,
|
|
26674
|
+
filename = DEFAULT_FILENAME,
|
|
26675
|
+
sourceRoot = "",
|
|
26676
|
+
pad = false,
|
|
26677
|
+
ignoreEmpty = true,
|
|
26678
|
+
compiler = CompilerDOM,
|
|
26679
|
+
templateParseOptions = {},
|
|
26680
|
+
parseExpressions = true
|
|
26681
|
+
} = options;
|
|
26669
26682
|
const descriptor = {
|
|
26670
26683
|
filename,
|
|
26671
26684
|
source,
|
|
@@ -31228,7 +31241,8 @@ const ssrTransformSlotOutlet = (node, context) => {
|
|
|
31228
31241
|
}
|
|
31229
31242
|
let method = SSR_RENDER_SLOT;
|
|
31230
31243
|
const parent = context.parent;
|
|
31231
|
-
|
|
31244
|
+
let componentType;
|
|
31245
|
+
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) {
|
|
31232
31246
|
method = SSR_RENDER_SLOT_INNER;
|
|
31233
31247
|
if (!(context.scopeId && context.slotted !== false)) {
|
|
31234
31248
|
args.push("null");
|
|
@@ -48598,7 +48612,7 @@ var __spreadValues = (a, b) => {
|
|
|
48598
48612
|
}
|
|
48599
48613
|
return a;
|
|
48600
48614
|
};
|
|
48601
|
-
const version = "3.4.
|
|
48615
|
+
const version = "3.4.3";
|
|
48602
48616
|
const parseCache = parseCache$1;
|
|
48603
48617
|
const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages);
|
|
48604
48618
|
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.3",
|
|
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-core": "3.4.
|
|
41
|
-
"@vue/compiler-
|
|
42
|
-
"@vue/compiler-
|
|
43
|
-
"@vue/shared": "3.4.
|
|
40
|
+
"@vue/compiler-core": "3.4.3",
|
|
41
|
+
"@vue/compiler-ssr": "3.4.3",
|
|
42
|
+
"@vue/compiler-dom": "3.4.3",
|
|
43
|
+
"@vue/shared": "3.4.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@babel/types": "^7.23.6",
|