@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.
@@ -1743,10 +1743,10 @@ function createCache(max = 500) {
1743
1743
  }
1744
1744
 
1745
1745
  function isImportUsed(local, sfc) {
1746
- return resolveTemplateUsageCheckString(sfc).has(local);
1746
+ return resolveTemplateUsedIdentifiers(sfc).has(local);
1747
1747
  }
1748
1748
  const templateUsageCheckCache = createCache();
1749
- function resolveTemplateUsageCheckString(sfc) {
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
- if (!CompilerDOM.parserOptions.isNativeTag(node.tag) && !CompilerDOM.parserOptions.isBuiltInComponent(node.tag)) {
1762
- ids.add(shared.camelize(node.tag));
1763
- ids.add(shared.capitalize(shared.camelize(node.tag)));
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 parse$2(source, {
1805
- sourceMap = true,
1806
- filename = DEFAULT_FILENAME,
1807
- sourceRoot = "",
1808
- pad = false,
1809
- ignoreEmpty = true,
1810
- compiler = CompilerDOM__namespace,
1811
- templateParseOptions = {},
1812
- parseExpressions = true
1813
- } = {}) {
1814
- const sourceKey = source + sourceMap + filename + sourceRoot + pad + compiler.parse;
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.1";
20596
+ const version = "3.4.3";
20583
20597
  const parseCache = parseCache$1;
20584
20598
  const errorMessages = {
20585
20599
  ...CompilerDOM.errorMessages,
@@ -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, { sourceMap, filename, sourceRoot, pad, ignoreEmpty, compiler, templateParseOptions, parseExpressions, }?: SFCParseOptions): SFCParseResult;
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 resolveTemplateUsageCheckString(sfc).has(local);
26577
+ return resolveTemplateUsedIdentifiers(sfc).has(local);
26578
26578
  }
26579
26579
  const templateUsageCheckCache = createCache();
26580
- function resolveTemplateUsageCheckString(sfc) {
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
- if (!parserOptions.isNativeTag(node.tag) && !parserOptions.isBuiltInComponent(node.tag)) {
26593
- ids.add(camelize(node.tag));
26594
- ids.add(capitalize$1(camelize(node.tag)));
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 parse$7(source, {
26655
- sourceMap = true,
26656
- filename = DEFAULT_FILENAME,
26657
- sourceRoot = "",
26658
- pad = false,
26659
- ignoreEmpty = true,
26660
- compiler = CompilerDOM,
26661
- templateParseOptions = {},
26662
- parseExpressions = true
26663
- } = {}) {
26664
- const sourceKey = source + sourceMap + filename + sourceRoot + pad + compiler.parse;
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
- if (parent && parent.type === 1 && parent.tagType === 1 && resolveComponentType(parent, context, true) === TRANSITION && parent.children.filter((c) => c.type === 1).length === 1) {
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.1";
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.1",
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.1",
41
- "@vue/compiler-dom": "3.4.1",
42
- "@vue/compiler-ssr": "3.4.1",
43
- "@vue/shared": "3.4.1"
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",