@vue/compiler-core 3.2.23 → 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 &&
@@ -1651,15 +1650,6 @@ function isSingleElementRoot(root, child) {
1651
1650
  !isSlotOutlet(child));
1652
1651
  }
1653
1652
  function walk(node, context, doNotHoistNode = false) {
1654
- // Some transforms, e.g. transformAssetUrls from @vue/compiler-sfc, replaces
1655
- // static bindings with expressions. These expressions are guaranteed to be
1656
- // constant so they are still eligible for hoisting, but they are only
1657
- // available at runtime and therefore cannot be evaluated ahead of time.
1658
- // This is only a concern for pre-stringification (via transformHoist by
1659
- // @vue/compiler-dom), but doing it here allows us to perform only one full
1660
- // walk of the AST and allow `stringifyStatic` to stop walking as soon as its
1661
- // stringification threshold is met.
1662
- let canStringify = true;
1663
1653
  const { children } = node;
1664
1654
  const originalCount = children.length;
1665
1655
  let hoistedCount = 0;
@@ -1672,9 +1662,6 @@ function walk(node, context, doNotHoistNode = false) {
1672
1662
  ? 0 /* NOT_CONSTANT */
1673
1663
  : getConstantType(child, context);
1674
1664
  if (constantType > 0 /* NOT_CONSTANT */) {
1675
- if (constantType < 3 /* CAN_STRINGIFY */) {
1676
- canStringify = false;
1677
- }
1678
1665
  if (constantType >= 2 /* CAN_HOIST */) {
1679
1666
  child.codegenNode.patchFlag =
1680
1667
  -1 /* HOISTED */ + (` /* HOISTED */` );
@@ -1705,17 +1692,10 @@ function walk(node, context, doNotHoistNode = false) {
1705
1692
  }
1706
1693
  }
1707
1694
  }
1708
- else if (child.type === 12 /* TEXT_CALL */) {
1709
- const contentType = getConstantType(child.content, context);
1710
- if (contentType > 0) {
1711
- if (contentType < 3 /* CAN_STRINGIFY */) {
1712
- canStringify = false;
1713
- }
1714
- if (contentType >= 2 /* CAN_HOIST */) {
1715
- child.codegenNode = context.hoist(child.codegenNode);
1716
- hoistedCount++;
1717
- }
1718
- }
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++;
1719
1699
  }
1720
1700
  // walk further
1721
1701
  if (child.type === 1 /* ELEMENT */) {
@@ -1739,7 +1719,7 @@ function walk(node, context, doNotHoistNode = false) {
1739
1719
  }
1740
1720
  }
1741
1721
  }
1742
- if (canStringify && hoistedCount && context.transformHoist) {
1722
+ if (hoistedCount && context.transformHoist) {
1743
1723
  context.transformHoist(children, context, node);
1744
1724
  }
1745
1725
  // all children were hoisted - the entire children array is hoistable.
@@ -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.
@@ -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 &&
@@ -1636,15 +1635,6 @@ function isSingleElementRoot(root, child) {
1636
1635
  !isSlotOutlet(child));
1637
1636
  }
1638
1637
  function walk(node, context, doNotHoistNode = false) {
1639
- // Some transforms, e.g. transformAssetUrls from @vue/compiler-sfc, replaces
1640
- // static bindings with expressions. These expressions are guaranteed to be
1641
- // constant so they are still eligible for hoisting, but they are only
1642
- // available at runtime and therefore cannot be evaluated ahead of time.
1643
- // This is only a concern for pre-stringification (via transformHoist by
1644
- // @vue/compiler-dom), but doing it here allows us to perform only one full
1645
- // walk of the AST and allow `stringifyStatic` to stop walking as soon as its
1646
- // stringification threshold is met.
1647
- let canStringify = true;
1648
1638
  const { children } = node;
1649
1639
  const originalCount = children.length;
1650
1640
  let hoistedCount = 0;
@@ -1657,9 +1647,6 @@ function walk(node, context, doNotHoistNode = false) {
1657
1647
  ? 0 /* NOT_CONSTANT */
1658
1648
  : getConstantType(child, context);
1659
1649
  if (constantType > 0 /* NOT_CONSTANT */) {
1660
- if (constantType < 3 /* CAN_STRINGIFY */) {
1661
- canStringify = false;
1662
- }
1663
1650
  if (constantType >= 2 /* CAN_HOIST */) {
1664
1651
  child.codegenNode.patchFlag =
1665
1652
  -1 /* HOISTED */ + ((process.env.NODE_ENV !== 'production') ? ` /* HOISTED */` : ``);
@@ -1690,17 +1677,10 @@ function walk(node, context, doNotHoistNode = false) {
1690
1677
  }
1691
1678
  }
1692
1679
  }
1693
- else if (child.type === 12 /* TEXT_CALL */) {
1694
- const contentType = getConstantType(child.content, context);
1695
- if (contentType > 0) {
1696
- if (contentType < 3 /* CAN_STRINGIFY */) {
1697
- canStringify = false;
1698
- }
1699
- if (contentType >= 2 /* CAN_HOIST */) {
1700
- child.codegenNode = context.hoist(child.codegenNode);
1701
- hoistedCount++;
1702
- }
1703
- }
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++;
1704
1684
  }
1705
1685
  // walk further
1706
1686
  if (child.type === 1 /* ELEMENT */) {
@@ -1724,7 +1704,7 @@ function walk(node, context, doNotHoistNode = false) {
1724
1704
  }
1725
1705
  }
1726
1706
  }
1727
- if (canStringify && hoistedCount && context.transformHoist) {
1707
+ if (hoistedCount && context.transformHoist) {
1728
1708
  context.transformHoist(children, context, node);
1729
1709
  }
1730
1710
  // all children were hoisted - the entire children array is hoistable.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.2.23",
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.23",
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"