@vue/compiler-core 3.2.20 → 3.2.24

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.
@@ -578,7 +578,6 @@ function getUnnormalizedProps(props, callPath = []) {
578
578
  }
579
579
  function injectProp(node, prop, context) {
580
580
  let propsWithInjection;
581
- const originalProps = node.type === 13 /* VNODE_CALL */ ? node.props : node.arguments[2];
582
581
  /**
583
582
  * 1. mergeProps(...)
584
583
  * 2. toHandlers(...)
@@ -587,7 +586,7 @@ function injectProp(node, prop, context) {
587
586
  *
588
587
  * we need to get the real props before normalization
589
588
  */
590
- let props = originalProps;
589
+ let props = node.type === 13 /* VNODE_CALL */ ? node.props : node.arguments[2];
591
590
  let callPath = [];
592
591
  let parentCall;
593
592
  if (props &&
@@ -1226,6 +1225,7 @@ function parseTag(context, type, parent) {
1226
1225
  }
1227
1226
  if (hasIf && hasFor) {
1228
1227
  warnDeprecation("COMPILER_V_IF_V_FOR_PRECEDENCE" /* COMPILER_V_IF_V_FOR_PRECEDENCE */, context, getSelection(context, start));
1228
+ break;
1229
1229
  }
1230
1230
  }
1231
1231
  }
@@ -1650,15 +1650,6 @@ function isSingleElementRoot(root, child) {
1650
1650
  !isSlotOutlet(child));
1651
1651
  }
1652
1652
  function walk(node, context, doNotHoistNode = false) {
1653
- // Some transforms, e.g. transformAssetUrls from @vue/compiler-sfc, replaces
1654
- // static bindings with expressions. These expressions are guaranteed to be
1655
- // constant so they are still eligible for hoisting, but they are only
1656
- // available at runtime and therefore cannot be evaluated ahead of time.
1657
- // This is only a concern for pre-stringification (via transformHoist by
1658
- // @vue/compiler-dom), but doing it here allows us to perform only one full
1659
- // walk of the AST and allow `stringifyStatic` to stop walking as soon as its
1660
- // stringification threshold is met.
1661
- let canStringify = true;
1662
1653
  const { children } = node;
1663
1654
  const originalCount = children.length;
1664
1655
  let hoistedCount = 0;
@@ -1671,9 +1662,6 @@ function walk(node, context, doNotHoistNode = false) {
1671
1662
  ? 0 /* NOT_CONSTANT */
1672
1663
  : getConstantType(child, context);
1673
1664
  if (constantType > 0 /* NOT_CONSTANT */) {
1674
- if (constantType < 3 /* CAN_STRINGIFY */) {
1675
- canStringify = false;
1676
- }
1677
1665
  if (constantType >= 2 /* CAN_HOIST */) {
1678
1666
  child.codegenNode.patchFlag =
1679
1667
  -1 /* HOISTED */ + (` /* HOISTED */` );
@@ -1704,17 +1692,10 @@ function walk(node, context, doNotHoistNode = false) {
1704
1692
  }
1705
1693
  }
1706
1694
  }
1707
- else if (child.type === 12 /* TEXT_CALL */) {
1708
- const contentType = getConstantType(child.content, context);
1709
- if (contentType > 0) {
1710
- if (contentType < 3 /* CAN_STRINGIFY */) {
1711
- canStringify = false;
1712
- }
1713
- if (contentType >= 2 /* CAN_HOIST */) {
1714
- child.codegenNode = context.hoist(child.codegenNode);
1715
- hoistedCount++;
1716
- }
1717
- }
1695
+ else if (child.type === 12 /* TEXT_CALL */ &&
1696
+ getConstantType(child.content, context) >= 2 /* CAN_HOIST */) {
1697
+ child.codegenNode = context.hoist(child.codegenNode);
1698
+ hoistedCount++;
1718
1699
  }
1719
1700
  // walk further
1720
1701
  if (child.type === 1 /* ELEMENT */) {
@@ -1738,7 +1719,7 @@ function walk(node, context, doNotHoistNode = false) {
1738
1719
  }
1739
1720
  }
1740
1721
  }
1741
- if (canStringify && hoistedCount && context.transformHoist) {
1722
+ if (hoistedCount && context.transformHoist) {
1742
1723
  context.transformHoist(children, context, node);
1743
1724
  }
1744
1725
  // all children were hoisted - the entire children array is hoistable.
@@ -4954,7 +4935,7 @@ function stringifyDynamicPropNames(props) {
4954
4935
  return propsNamesString + `]`;
4955
4936
  }
4956
4937
  function isComponentTag(tag) {
4957
- return tag[0].toLowerCase() + tag.slice(1) === 'component';
4938
+ return tag === 'component' || tag === 'Component';
4958
4939
  }
4959
4940
  function processInlineRef(context, raw) {
4960
4941
  const body = [createSimpleExpression(`_refs['${raw}'] = _value`)];
@@ -577,7 +577,6 @@ function getUnnormalizedProps(props, callPath = []) {
577
577
  }
578
578
  function injectProp(node, prop, context) {
579
579
  let propsWithInjection;
580
- const originalProps = node.type === 13 /* VNODE_CALL */ ? node.props : node.arguments[2];
581
580
  /**
582
581
  * 1. mergeProps(...)
583
582
  * 2. toHandlers(...)
@@ -586,7 +585,7 @@ function injectProp(node, prop, context) {
586
585
  *
587
586
  * we need to get the real props before normalization
588
587
  */
589
- let props = originalProps;
588
+ let props = node.type === 13 /* VNODE_CALL */ ? node.props : node.arguments[2];
590
589
  let callPath = [];
591
590
  let parentCall;
592
591
  if (props &&
@@ -1623,15 +1622,6 @@ function isSingleElementRoot(root, child) {
1623
1622
  !isSlotOutlet(child));
1624
1623
  }
1625
1624
  function walk(node, context, doNotHoistNode = false) {
1626
- // Some transforms, e.g. transformAssetUrls from @vue/compiler-sfc, replaces
1627
- // static bindings with expressions. These expressions are guaranteed to be
1628
- // constant so they are still eligible for hoisting, but they are only
1629
- // available at runtime and therefore cannot be evaluated ahead of time.
1630
- // This is only a concern for pre-stringification (via transformHoist by
1631
- // @vue/compiler-dom), but doing it here allows us to perform only one full
1632
- // walk of the AST and allow `stringifyStatic` to stop walking as soon as its
1633
- // stringification threshold is met.
1634
- let canStringify = true;
1635
1625
  const { children } = node;
1636
1626
  const originalCount = children.length;
1637
1627
  let hoistedCount = 0;
@@ -1644,9 +1634,6 @@ function walk(node, context, doNotHoistNode = false) {
1644
1634
  ? 0 /* NOT_CONSTANT */
1645
1635
  : getConstantType(child, context);
1646
1636
  if (constantType > 0 /* NOT_CONSTANT */) {
1647
- if (constantType < 3 /* CAN_STRINGIFY */) {
1648
- canStringify = false;
1649
- }
1650
1637
  if (constantType >= 2 /* CAN_HOIST */) {
1651
1638
  child.codegenNode.patchFlag =
1652
1639
  -1 /* HOISTED */ + (``);
@@ -1677,17 +1664,10 @@ function walk(node, context, doNotHoistNode = false) {
1677
1664
  }
1678
1665
  }
1679
1666
  }
1680
- else if (child.type === 12 /* TEXT_CALL */) {
1681
- const contentType = getConstantType(child.content, context);
1682
- if (contentType > 0) {
1683
- if (contentType < 3 /* CAN_STRINGIFY */) {
1684
- canStringify = false;
1685
- }
1686
- if (contentType >= 2 /* CAN_HOIST */) {
1687
- child.codegenNode = context.hoist(child.codegenNode);
1688
- hoistedCount++;
1689
- }
1690
- }
1667
+ else if (child.type === 12 /* TEXT_CALL */ &&
1668
+ getConstantType(child.content, context) >= 2 /* CAN_HOIST */) {
1669
+ child.codegenNode = context.hoist(child.codegenNode);
1670
+ hoistedCount++;
1691
1671
  }
1692
1672
  // walk further
1693
1673
  if (child.type === 1 /* ELEMENT */) {
@@ -1711,7 +1691,7 @@ function walk(node, context, doNotHoistNode = false) {
1711
1691
  }
1712
1692
  }
1713
1693
  }
1714
- if (canStringify && hoistedCount && context.transformHoist) {
1694
+ if (hoistedCount && context.transformHoist) {
1715
1695
  context.transformHoist(children, context, node);
1716
1696
  }
1717
1697
  // all children were hoisted - the entire children array is hoistable.
@@ -4830,7 +4810,7 @@ function stringifyDynamicPropNames(props) {
4830
4810
  return propsNamesString + `]`;
4831
4811
  }
4832
4812
  function isComponentTag(tag) {
4833
- return tag[0].toLowerCase() + tag.slice(1) === 'component';
4813
+ return tag === 'component' || tag === 'Component';
4834
4814
  }
4835
4815
  function processInlineRef(context, raw) {
4836
4816
  const body = [createSimpleExpression(`_refs['${raw}'] = _value`)];
@@ -560,7 +560,6 @@ function getUnnormalizedProps(props, callPath = []) {
560
560
  }
561
561
  function injectProp(node, prop, context) {
562
562
  let propsWithInjection;
563
- const originalProps = node.type === 13 /* VNODE_CALL */ ? node.props : node.arguments[2];
564
563
  /**
565
564
  * 1. mergeProps(...)
566
565
  * 2. toHandlers(...)
@@ -569,7 +568,7 @@ function injectProp(node, prop, context) {
569
568
  *
570
569
  * we need to get the real props before normalization
571
570
  */
572
- let props = originalProps;
571
+ let props = node.type === 13 /* VNODE_CALL */ ? node.props : node.arguments[2];
573
572
  let callPath = [];
574
573
  let parentCall;
575
574
  if (props &&
@@ -1211,6 +1210,7 @@ function parseTag(context, type, parent) {
1211
1210
  }
1212
1211
  if (hasIf && hasFor) {
1213
1212
  warnDeprecation("COMPILER_V_IF_V_FOR_PRECEDENCE" /* COMPILER_V_IF_V_FOR_PRECEDENCE */, context, getSelection(context, start));
1213
+ break;
1214
1214
  }
1215
1215
  }
1216
1216
  }
@@ -1635,15 +1635,6 @@ function isSingleElementRoot(root, child) {
1635
1635
  !isSlotOutlet(child));
1636
1636
  }
1637
1637
  function walk(node, context, doNotHoistNode = false) {
1638
- // Some transforms, e.g. transformAssetUrls from @vue/compiler-sfc, replaces
1639
- // static bindings with expressions. These expressions are guaranteed to be
1640
- // constant so they are still eligible for hoisting, but they are only
1641
- // available at runtime and therefore cannot be evaluated ahead of time.
1642
- // This is only a concern for pre-stringification (via transformHoist by
1643
- // @vue/compiler-dom), but doing it here allows us to perform only one full
1644
- // walk of the AST and allow `stringifyStatic` to stop walking as soon as its
1645
- // stringification threshold is met.
1646
- let canStringify = true;
1647
1638
  const { children } = node;
1648
1639
  const originalCount = children.length;
1649
1640
  let hoistedCount = 0;
@@ -1656,9 +1647,6 @@ function walk(node, context, doNotHoistNode = false) {
1656
1647
  ? 0 /* NOT_CONSTANT */
1657
1648
  : getConstantType(child, context);
1658
1649
  if (constantType > 0 /* NOT_CONSTANT */) {
1659
- if (constantType < 3 /* CAN_STRINGIFY */) {
1660
- canStringify = false;
1661
- }
1662
1650
  if (constantType >= 2 /* CAN_HOIST */) {
1663
1651
  child.codegenNode.patchFlag =
1664
1652
  -1 /* HOISTED */ + ((process.env.NODE_ENV !== 'production') ? ` /* HOISTED */` : ``);
@@ -1689,17 +1677,10 @@ function walk(node, context, doNotHoistNode = false) {
1689
1677
  }
1690
1678
  }
1691
1679
  }
1692
- else if (child.type === 12 /* TEXT_CALL */) {
1693
- const contentType = getConstantType(child.content, context);
1694
- if (contentType > 0) {
1695
- if (contentType < 3 /* CAN_STRINGIFY */) {
1696
- canStringify = false;
1697
- }
1698
- if (contentType >= 2 /* CAN_HOIST */) {
1699
- child.codegenNode = context.hoist(child.codegenNode);
1700
- hoistedCount++;
1701
- }
1702
- }
1680
+ else if (child.type === 12 /* TEXT_CALL */ &&
1681
+ getConstantType(child.content, context) >= 2 /* CAN_HOIST */) {
1682
+ child.codegenNode = context.hoist(child.codegenNode);
1683
+ hoistedCount++;
1703
1684
  }
1704
1685
  // walk further
1705
1686
  if (child.type === 1 /* ELEMENT */) {
@@ -1723,7 +1704,7 @@ function walk(node, context, doNotHoistNode = false) {
1723
1704
  }
1724
1705
  }
1725
1706
  }
1726
- if (canStringify && hoistedCount && context.transformHoist) {
1707
+ if (hoistedCount && context.transformHoist) {
1727
1708
  context.transformHoist(children, context, node);
1728
1709
  }
1729
1710
  // all children were hoisted - the entire children array is hoistable.
@@ -4207,7 +4188,7 @@ function stringifyDynamicPropNames(props) {
4207
4188
  return propsNamesString + `]`;
4208
4189
  }
4209
4190
  function isComponentTag(tag) {
4210
- return tag[0].toLowerCase() + tag.slice(1) === 'component';
4191
+ return tag === 'component' || tag === 'Component';
4211
4192
  }
4212
4193
 
4213
4194
  (process.env.NODE_ENV !== 'production')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.2.20",
3
+ "version": "3.2.24",
4
4
  "description": "@vue/compiler-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/compiler-core.esm-bundler.js",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "homepage": "https://github.com/vuejs/vue-next/tree/master/packages/compiler-core#readme",
34
34
  "dependencies": {
35
- "@vue/shared": "3.2.20",
35
+ "@vue/shared": "3.2.24",
36
36
  "@babel/parser": "^7.15.0",
37
37
  "estree-walker": "^2.0.2",
38
38
  "source-map": "^0.6.1"