@vue/compiler-sfc 3.4.2 → 3.4.4

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.
@@ -1804,21 +1804,32 @@ function extractIdentifiers(ids, node) {
1804
1804
 
1805
1805
  const DEFAULT_FILENAME = "anonymous.vue";
1806
1806
  const parseCache$1 = createCache();
1807
- function parse$2(source, {
1808
- sourceMap = true,
1809
- filename = DEFAULT_FILENAME,
1810
- sourceRoot = "",
1811
- pad = false,
1812
- ignoreEmpty = true,
1813
- compiler = CompilerDOM__namespace,
1814
- templateParseOptions = {},
1815
- parseExpressions = true
1816
- } = {}) {
1817
- 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);
1818
1819
  const cache = parseCache$1.get(sourceKey);
1819
1820
  if (cache) {
1820
1821
  return cache;
1821
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;
1822
1833
  const descriptor = {
1823
1834
  filename,
1824
1835
  source,
@@ -4263,6 +4274,7 @@ function doCompileTemplate({
4263
4274
  }
4264
4275
  if (inAST == null ? void 0 : inAST.transformed) {
4265
4276
  const newAST = (ssr ? CompilerDOM__namespace : compiler).parse(inAST.source, {
4277
+ ...compilerOptions,
4266
4278
  parseMode: "sfc",
4267
4279
  onError: (e) => errors.push(e)
4268
4280
  });
@@ -11204,10 +11216,7 @@ const scss = (source, map, options, load = require) => {
11204
11216
  if (map) {
11205
11217
  return {
11206
11218
  code: result.css.toString(),
11207
- map: merge$1(
11208
- map,
11209
- result.map.toJSON ? result.map.toJSON() : JSON.parse(result.map.toString())
11210
- ),
11219
+ map: merge$1(map, JSON.parse(result.map.toString())),
11211
11220
  errors: [],
11212
11221
  dependencies
11213
11222
  };
@@ -20582,7 +20591,7 @@ function isStaticNode(node) {
20582
20591
  return false;
20583
20592
  }
20584
20593
 
20585
- const version = "3.4.2";
20594
+ const version = "3.4.4";
20586
20595
  const parseCache = parseCache$1;
20587
20596
  const errorMessages = {
20588
20597
  ...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
 
@@ -26654,21 +26654,31 @@ var __spreadValues$a = (a, b) => {
26654
26654
  var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
26655
26655
  const DEFAULT_FILENAME = "anonymous.vue";
26656
26656
  const parseCache$1 = createCache();
26657
- function parse$7(source, {
26658
- sourceMap = true,
26659
- filename = DEFAULT_FILENAME,
26660
- sourceRoot = "",
26661
- pad = false,
26662
- ignoreEmpty = true,
26663
- compiler = CompilerDOM,
26664
- templateParseOptions = {},
26665
- parseExpressions = true
26666
- } = {}) {
26667
- 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);
26668
26668
  const cache = parseCache$1.get(sourceKey);
26669
26669
  if (cache) {
26670
26670
  return cache;
26671
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;
26672
26682
  const descriptor = {
26673
26683
  filename,
26674
26684
  source,
@@ -32621,10 +32631,10 @@ function doCompileTemplate({
32621
32631
  inAST = void 0;
32622
32632
  }
32623
32633
  if (inAST == null ? void 0 : inAST.transformed) {
32624
- const newAST = (ssr ? CompilerDOM : compiler).parse(inAST.source, {
32634
+ const newAST = (ssr ? CompilerDOM : compiler).parse(inAST.source, __spreadProps$5(__spreadValues$6({}, compilerOptions), {
32625
32635
  parseMode: "sfc",
32626
32636
  onError: (e) => errors.push(e)
32627
- });
32637
+ }));
32628
32638
  const template = newAST.children.find(
32629
32639
  (node) => node.type === 1 && node.tag === "template"
32630
32640
  );
@@ -43968,10 +43978,7 @@ const scss = (source, map, options, load = require) => {
43968
43978
  if (map) {
43969
43979
  return {
43970
43980
  code: result.css.toString(),
43971
- map: merge$1(
43972
- map,
43973
- result.map.toJSON ? result.map.toJSON() : JSON.parse(result.map.toString())
43974
- ),
43981
+ map: merge$1(map, JSON.parse(result.map.toString())),
43975
43982
  errors: [],
43976
43983
  dependencies
43977
43984
  };
@@ -48602,7 +48609,7 @@ var __spreadValues = (a, b) => {
48602
48609
  }
48603
48610
  return a;
48604
48611
  };
48605
- const version = "3.4.2";
48612
+ const version = "3.4.4";
48606
48613
  const parseCache = parseCache$1;
48607
48614
  const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages);
48608
48615
  const walk = walk$2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-sfc",
3
- "version": "3.4.2",
3
+ "version": "3.4.4",
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-dom": "3.4.2",
41
- "@vue/shared": "3.4.2",
42
- "@vue/compiler-core": "3.4.2",
43
- "@vue/compiler-ssr": "3.4.2"
40
+ "@vue/compiler-core": "3.4.4",
41
+ "@vue/shared": "3.4.4",
42
+ "@vue/compiler-dom": "3.4.4",
43
+ "@vue/compiler-ssr": "3.4.4"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@babel/types": "^7.23.6",
@@ -50,8 +50,8 @@
50
50
  "merge-source-map": "^1.1.0",
51
51
  "minimatch": "^9.0.3",
52
52
  "postcss-modules": "^6.0.0",
53
- "postcss-selector-parser": "^6.0.13",
53
+ "postcss-selector-parser": "^6.0.15",
54
54
  "pug": "^3.0.2",
55
- "sass": "^1.69.5"
55
+ "sass": "^1.69.7"
56
56
  }
57
57
  }