vue 3.2.8 → 3.2.12

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.
@@ -1459,41 +1459,33 @@ var Vue = (function (exports) {
1459
1459
  const id = instance.type.__hmrId;
1460
1460
  let record = map.get(id);
1461
1461
  if (!record) {
1462
- createRecord(id, instance.type);
1462
+ createRecord(id);
1463
1463
  record = map.get(id);
1464
1464
  }
1465
- record.instances.add(instance);
1465
+ record.add(instance);
1466
1466
  }
1467
1467
  function unregisterHMR(instance) {
1468
- map.get(instance.type.__hmrId).instances.delete(instance);
1468
+ map.get(instance.type.__hmrId).delete(instance);
1469
1469
  }
1470
- function createRecord(id, component) {
1471
- if (!component) {
1472
- warn$1(`HMR API usage is out of date.\n` +
1473
- `Please upgrade vue-loader/vite/rollup-plugin-vue or other relevant ` +
1474
- `dependency that handles Vue SFC compilation.`);
1475
- component = {};
1476
- }
1470
+ function createRecord(id) {
1477
1471
  if (map.has(id)) {
1478
1472
  return false;
1479
1473
  }
1480
- map.set(id, {
1481
- component: isClassComponent(component) ? component.__vccOpts : component,
1482
- instances: new Set()
1483
- });
1474
+ map.set(id, new Set());
1484
1475
  return true;
1485
1476
  }
1477
+ function normalizeClassComponent(component) {
1478
+ return isClassComponent(component) ? component.__vccOpts : component;
1479
+ }
1486
1480
  function rerender(id, newRender) {
1487
1481
  const record = map.get(id);
1488
- if (!record)
1482
+ if (!record) {
1489
1483
  return;
1490
- if (newRender)
1491
- record.component.render = newRender;
1492
- // Array.from creates a snapshot which avoids the set being mutated during
1493
- // updates
1494
- Array.from(record.instances).forEach(instance => {
1484
+ }
1485
+ [...record].forEach(instance => {
1495
1486
  if (newRender) {
1496
1487
  instance.render = newRender;
1488
+ normalizeClassComponent(instance.type).render = newRender;
1497
1489
  }
1498
1490
  instance.renderCache = [];
1499
1491
  // this flag forces child components with slot content to update
@@ -1506,34 +1498,31 @@ var Vue = (function (exports) {
1506
1498
  const record = map.get(id);
1507
1499
  if (!record)
1508
1500
  return;
1509
- // Array.from creates a snapshot which avoids the set being mutated during
1510
- // updates
1511
- const { component, instances } = record;
1512
- if (!hmrDirtyComponents.has(component)) {
1513
- // 1. Update existing comp definition to match new one
1514
- newComp = isClassComponent(newComp) ? newComp.__vccOpts : newComp;
1515
- extend(component, newComp);
1516
- for (const key in component) {
1517
- if (key !== '__file' && !(key in newComp)) {
1518
- delete component[key];
1519
- }
1520
- }
1521
- // 2. Mark component dirty. This forces the renderer to replace the component
1522
- // on patch.
1523
- hmrDirtyComponents.add(component);
1524
- // 3. Make sure to unmark the component after the reload.
1525
- queuePostFlushCb(() => {
1526
- hmrDirtyComponents.delete(component);
1527
- });
1528
- }
1529
- Array.from(instances).forEach(instance => {
1530
- // invalidate options resolution cache
1501
+ newComp = normalizeClassComponent(newComp);
1502
+ // create a snapshot which avoids the set being mutated during updates
1503
+ const instances = [...record];
1504
+ for (const instance of instances) {
1505
+ const oldComp = normalizeClassComponent(instance.type);
1506
+ if (!hmrDirtyComponents.has(oldComp)) {
1507
+ // 1. Update existing comp definition to match new one
1508
+ extend(oldComp, newComp);
1509
+ for (const key in oldComp) {
1510
+ if (key !== '__file' && !(key in newComp)) {
1511
+ delete oldComp[key];
1512
+ }
1513
+ }
1514
+ // 2. mark definition dirty. This forces the renderer to replace the
1515
+ // component on patch.
1516
+ hmrDirtyComponents.add(oldComp);
1517
+ }
1518
+ // 3. invalidate options resolution cache
1531
1519
  instance.appContext.optionsCache.delete(instance.type);
1520
+ // 4. actually update
1532
1521
  if (instance.ceReload) {
1533
1522
  // custom element
1534
- hmrDirtyComponents.add(component);
1523
+ hmrDirtyComponents.add(oldComp);
1535
1524
  instance.ceReload(newComp.styles);
1536
- hmrDirtyComponents.delete(component);
1525
+ hmrDirtyComponents.delete(oldComp);
1537
1526
  }
1538
1527
  else if (instance.parent) {
1539
1528
  // 4. Force the parent instance to re-render. This will cause all updated
@@ -1558,6 +1547,12 @@ var Vue = (function (exports) {
1558
1547
  else {
1559
1548
  console.warn('[HMR] Root or manually mounted instance modified. Full reload required.');
1560
1549
  }
1550
+ }
1551
+ // 5. make sure to cleanup dirty hmr components after update
1552
+ queuePostFlushCb(() => {
1553
+ for (const instance of instances) {
1554
+ hmrDirtyComponents.delete(normalizeClassComponent(instance.type));
1555
+ }
1561
1556
  });
1562
1557
  }
1563
1558
  function tryWrap(fn) {
@@ -1619,335 +1614,6 @@ var Vue = (function (exports) {
1619
1614
  exports.devtools.emit("component:emit" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);
1620
1615
  }
1621
1616
 
1622
- const deprecationData = {
1623
- ["GLOBAL_MOUNT" /* GLOBAL_MOUNT */]: {
1624
- message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
1625
- `option have been removed. Use createApp(RootComponent).mount() instead.`,
1626
- link: `https://v3.vuejs.org/guide/migration/global-api.html#mounting-app-instance`
1627
- },
1628
- ["GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */]: {
1629
- message: `Vue detected directives on the mount container. ` +
1630
- `In Vue 3, the container is no longer considered part of the template ` +
1631
- `and will not be processed/replaced.`,
1632
- link: `https://v3.vuejs.org/guide/migration/mount-changes.html`
1633
- },
1634
- ["GLOBAL_EXTEND" /* GLOBAL_EXTEND */]: {
1635
- message: `Vue.extend() has been removed in Vue 3. ` +
1636
- `Use defineComponent() instead.`,
1637
- link: `https://v3.vuejs.org/api/global-api.html#definecomponent`
1638
- },
1639
- ["GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */]: {
1640
- message: `Vue.prototype is no longer available in Vue 3. ` +
1641
- `Use app.config.globalProperties instead.`,
1642
- link: `https://v3.vuejs.org/guide/migration/global-api.html#vue-prototype-replaced-by-config-globalproperties`
1643
- },
1644
- ["GLOBAL_SET" /* GLOBAL_SET */]: {
1645
- message: `Vue.set() has been removed as it is no longer needed in Vue 3. ` +
1646
- `Simply use native JavaScript mutations.`
1647
- },
1648
- ["GLOBAL_DELETE" /* GLOBAL_DELETE */]: {
1649
- message: `Vue.delete() has been removed as it is no longer needed in Vue 3. ` +
1650
- `Simply use native JavaScript mutations.`
1651
- },
1652
- ["GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */]: {
1653
- message: `Vue.observable() has been removed. ` +
1654
- `Use \`import { reactive } from "vue"\` from Composition API instead.`,
1655
- link: `https://v3.vuejs.org/api/basic-reactivity.html`
1656
- },
1657
- ["GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */]: {
1658
- message: `Vue.util has been removed. Please refactor to avoid its usage ` +
1659
- `since it was an internal API even in Vue 2.`
1660
- },
1661
- ["CONFIG_SILENT" /* CONFIG_SILENT */]: {
1662
- message: `config.silent has been removed because it is not good practice to ` +
1663
- `intentionally suppress warnings. You can use your browser console's ` +
1664
- `filter features to focus on relevant messages.`
1665
- },
1666
- ["CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */]: {
1667
- message: `config.devtools has been removed. To enable devtools for ` +
1668
- `production, configure the __VUE_PROD_DEVTOOLS__ compile-time flag.`,
1669
- link: `https://github.com/vuejs/vue-next/tree/master/packages/vue#bundler-build-feature-flags`
1670
- },
1671
- ["CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */]: {
1672
- message: `config.keyCodes has been removed. ` +
1673
- `In Vue 3, you can directly use the kebab-case key names as v-on modifiers.`,
1674
- link: `https://v3.vuejs.org/guide/migration/keycode-modifiers.html`
1675
- },
1676
- ["CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */]: {
1677
- message: `config.productionTip has been removed.`,
1678
- link: `https://v3.vuejs.org/guide/migration/global-api.html#config-productiontip-removed`
1679
- },
1680
- ["CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */]: {
1681
- message: () => {
1682
- let msg = `config.ignoredElements has been removed.`;
1683
- if (isRuntimeOnly()) {
1684
- msg += ` Pass the "isCustomElement" option to @vue/compiler-dom instead.`;
1685
- }
1686
- else {
1687
- msg += ` Use config.isCustomElement instead.`;
1688
- }
1689
- return msg;
1690
- },
1691
- link: `https://v3.vuejs.org/guide/migration/global-api.html#config-ignoredelements-is-now-config-iscustomelement`
1692
- },
1693
- ["CONFIG_WHITESPACE" /* CONFIG_WHITESPACE */]: {
1694
- // this warning is only relevant in the full build when using runtime
1695
- // compilation, so it's put in the runtime compatConfig list.
1696
- message: `Vue 3 compiler's whitespace option will default to "condense" instead of ` +
1697
- `"preserve". To suppress this warning, provide an explicit value for ` +
1698
- `\`config.compilerOptions.whitespace\`.`
1699
- },
1700
- ["CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */]: {
1701
- message: `config.optionMergeStrategies no longer exposes internal strategies. ` +
1702
- `Use custom merge functions instead.`
1703
- },
1704
- ["INSTANCE_SET" /* INSTANCE_SET */]: {
1705
- message: `vm.$set() has been removed as it is no longer needed in Vue 3. ` +
1706
- `Simply use native JavaScript mutations.`
1707
- },
1708
- ["INSTANCE_DELETE" /* INSTANCE_DELETE */]: {
1709
- message: `vm.$delete() has been removed as it is no longer needed in Vue 3. ` +
1710
- `Simply use native JavaScript mutations.`
1711
- },
1712
- ["INSTANCE_DESTROY" /* INSTANCE_DESTROY */]: {
1713
- message: `vm.$destroy() has been removed. Use app.unmount() instead.`,
1714
- link: `https://v3.vuejs.org/api/application-api.html#unmount`
1715
- },
1716
- ["INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */]: {
1717
- message: `vm.$on/$once/$off() have been removed. ` +
1718
- `Use an external event emitter library instead.`,
1719
- link: `https://v3.vuejs.org/guide/migration/events-api.html`
1720
- },
1721
- ["INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */]: {
1722
- message: event => `"${event}" lifecycle events are no longer supported. From templates, ` +
1723
- `use the "vnode" prefix instead of "hook:". For example, @${event} ` +
1724
- `should be changed to @vnode-${event.slice(5)}. ` +
1725
- `From JavaScript, use Composition API to dynamically register lifecycle ` +
1726
- `hooks.`,
1727
- link: `https://v3.vuejs.org/guide/migration/vnode-lifecycle-events.html`
1728
- },
1729
- ["INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */]: {
1730
- message: `vm.$children has been removed. Consider refactoring your logic ` +
1731
- `to avoid relying on direct access to child components.`,
1732
- link: `https://v3.vuejs.org/guide/migration/children.html`
1733
- },
1734
- ["INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */]: {
1735
- message: `vm.$listeners has been removed. In Vue 3, parent v-on listeners are ` +
1736
- `included in vm.$attrs and it is no longer necessary to separately use ` +
1737
- `v-on="$listeners" if you are already using v-bind="$attrs". ` +
1738
- `(Note: the Vue 3 behavior only applies if this compat config is disabled)`,
1739
- link: `https://v3.vuejs.org/guide/migration/listeners-removed.html`
1740
- },
1741
- ["INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */]: {
1742
- message: `vm.$scopedSlots has been removed. Use vm.$slots instead.`,
1743
- link: `https://v3.vuejs.org/guide/migration/slots-unification.html`
1744
- },
1745
- ["INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */]: {
1746
- message: componentName => `Component <${componentName || 'Anonymous'}> has \`inheritAttrs: false\` but is ` +
1747
- `relying on class/style fallthrough from parent. In Vue 3, class/style ` +
1748
- `are now included in $attrs and will no longer fallthrough when ` +
1749
- `inheritAttrs is false. If you are already using v-bind="$attrs" on ` +
1750
- `component root it should render the same end result. ` +
1751
- `If you are binding $attrs to a non-root element and expecting ` +
1752
- `class/style to fallthrough on root, you will need to now manually bind ` +
1753
- `them on root via :class="$attrs.class".`,
1754
- link: `https://v3.vuejs.org/guide/migration/attrs-includes-class-style.html`
1755
- },
1756
- ["OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */]: {
1757
- message: `The "data" option can no longer be a plain object. ` +
1758
- `Always use a function.`,
1759
- link: `https://v3.vuejs.org/guide/migration/data-option.html`
1760
- },
1761
- ["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */]: {
1762
- message: (key) => `Detected conflicting key "${key}" when merging data option values. ` +
1763
- `In Vue 3, data keys are merged shallowly and will override one another.`,
1764
- link: `https://v3.vuejs.org/guide/migration/data-option.html#mixin-merge-behavior-change`
1765
- },
1766
- ["OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */]: {
1767
- message: `\`beforeDestroy\` has been renamed to \`beforeUnmount\`.`
1768
- },
1769
- ["OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */]: {
1770
- message: `\`destroyed\` has been renamed to \`unmounted\`.`
1771
- },
1772
- ["WATCH_ARRAY" /* WATCH_ARRAY */]: {
1773
- message: `"watch" option or vm.$watch on an array value will no longer ` +
1774
- `trigger on array mutation unless the "deep" option is specified. ` +
1775
- `If current usage is intended, you can disable the compat behavior and ` +
1776
- `suppress this warning with:` +
1777
- `\n\n configureCompat({ ${"WATCH_ARRAY" /* WATCH_ARRAY */}: false })\n`,
1778
- link: `https://v3.vuejs.org/guide/migration/watch.html`
1779
- },
1780
- ["PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */]: {
1781
- message: (key) => `props default value function no longer has access to "this". The compat ` +
1782
- `build only offers access to this.$options.` +
1783
- `(found in prop "${key}")`,
1784
- link: `https://v3.vuejs.org/guide/migration/props-default-this.html`
1785
- },
1786
- ["CUSTOM_DIR" /* CUSTOM_DIR */]: {
1787
- message: (legacyHook, newHook) => `Custom directive hook "${legacyHook}" has been removed. ` +
1788
- `Use "${newHook}" instead.`,
1789
- link: `https://v3.vuejs.org/guide/migration/custom-directives.html`
1790
- },
1791
- ["V_FOR_REF" /* V_FOR_REF */]: {
1792
- message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +
1793
- `Consider using function refs or refactor to avoid ref usage altogether.`,
1794
- link: `https://v3.vuejs.org/guide/migration/array-refs.html`
1795
- },
1796
- ["V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */]: {
1797
- message: `Using keyCode as v-on modifier is no longer supported. ` +
1798
- `Use kebab-case key name modifiers instead.`,
1799
- link: `https://v3.vuejs.org/guide/migration/keycode-modifiers.html`
1800
- },
1801
- ["ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */]: {
1802
- message: (name) => `Attribute "${name}" with v-bind value \`false\` will render ` +
1803
- `${name}="false" instead of removing it in Vue 3. To remove the attribute, ` +
1804
- `use \`null\` or \`undefined\` instead. If the usage is intended, ` +
1805
- `you can disable the compat behavior and suppress this warning with:` +
1806
- `\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */}: false })\n`,
1807
- link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`
1808
- },
1809
- ["ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */]: {
1810
- message: (name, value, coerced) => `Enumerated attribute "${name}" with v-bind value \`${value}\` will ` +
1811
- `${value === null ? `be removed` : `render the value as-is`} instead of coercing the value to "${coerced}" in Vue 3. ` +
1812
- `Always use explicit "true" or "false" values for enumerated attributes. ` +
1813
- `If the usage is intended, ` +
1814
- `you can disable the compat behavior and suppress this warning with:` +
1815
- `\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */}: false })\n`,
1816
- link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`
1817
- },
1818
- ["TRANSITION_CLASSES" /* TRANSITION_CLASSES */]: {
1819
- message: `` // this feature cannot be runtime-detected
1820
- },
1821
- ["TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */]: {
1822
- message: `<TransitionGroup> no longer renders a root <span> element by ` +
1823
- `default if no "tag" prop is specified. If you do not rely on the span ` +
1824
- `for styling, you can disable the compat behavior and suppress this ` +
1825
- `warning with:` +
1826
- `\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */}: false })\n`,
1827
- link: `https://v3.vuejs.org/guide/migration/transition-group.html`
1828
- },
1829
- ["COMPONENT_ASYNC" /* COMPONENT_ASYNC */]: {
1830
- message: (comp) => {
1831
- const name = getComponentName(comp);
1832
- return (`Async component${name ? ` <${name}>` : `s`} should be explicitly created via \`defineAsyncComponent()\` ` +
1833
- `in Vue 3. Plain functions will be treated as functional components in ` +
1834
- `non-compat build. If you have already migrated all async component ` +
1835
- `usage and intend to use plain functions for functional components, ` +
1836
- `you can disable the compat behavior and suppress this ` +
1837
- `warning with:` +
1838
- `\n\n configureCompat({ ${"COMPONENT_ASYNC" /* COMPONENT_ASYNC */}: false })\n`);
1839
- },
1840
- link: `https://v3.vuejs.org/guide/migration/async-components.html`
1841
- },
1842
- ["COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */]: {
1843
- message: (comp) => {
1844
- const name = getComponentName(comp);
1845
- return (`Functional component${name ? ` <${name}>` : `s`} should be defined as a plain function in Vue 3. The "functional" ` +
1846
- `option has been removed. NOTE: Before migrating to use plain ` +
1847
- `functions for functional components, first make sure that all async ` +
1848
- `components usage have been migrated and its compat behavior has ` +
1849
- `been disabled.`);
1850
- },
1851
- link: `https://v3.vuejs.org/guide/migration/functional-components.html`
1852
- },
1853
- ["COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */]: {
1854
- message: (comp) => {
1855
- const configMsg = `opt-in to ` +
1856
- `Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */}: false }\`.`;
1857
- if (comp.props &&
1858
- (isArray(comp.props)
1859
- ? comp.props.includes('modelValue')
1860
- : hasOwn(comp.props, 'modelValue'))) {
1861
- return (`Component delcares "modelValue" prop, which is Vue 3 usage, but ` +
1862
- `is running under Vue 2 compat v-model behavior. You can ${configMsg}`);
1863
- }
1864
- return (`v-model usage on component has changed in Vue 3. Component that expects ` +
1865
- `to work with v-model should now use the "modelValue" prop and emit the ` +
1866
- `"update:modelValue" event. You can update the usage and then ${configMsg}`);
1867
- },
1868
- link: `https://v3.vuejs.org/guide/migration/v-model.html`
1869
- },
1870
- ["RENDER_FUNCTION" /* RENDER_FUNCTION */]: {
1871
- message: `Vue 3's render function API has changed. ` +
1872
- `You can opt-in to the new API with:` +
1873
- `\n\n configureCompat({ ${"RENDER_FUNCTION" /* RENDER_FUNCTION */}: false })\n` +
1874
- `\n (This can also be done per-component via the "compatConfig" option.)`,
1875
- link: `https://v3.vuejs.org/guide/migration/render-function-api.html`
1876
- },
1877
- ["FILTERS" /* FILTERS */]: {
1878
- message: `filters have been removed in Vue 3. ` +
1879
- `The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
1880
- `Use method calls or computed properties instead.`,
1881
- link: `https://v3.vuejs.org/guide/migration/filters.html`
1882
- },
1883
- ["PRIVATE_APIS" /* PRIVATE_APIS */]: {
1884
- message: name => `"${name}" is a Vue 2 private API that no longer exists in Vue 3. ` +
1885
- `If you are seeing this warning only due to a dependency, you can ` +
1886
- `suppress this warning via { PRIVATE_APIS: 'supress-warning' }.`
1887
- }
1888
- };
1889
- const instanceWarned = Object.create(null);
1890
- const warnCount = Object.create(null);
1891
- function warnDeprecation(key, instance, ...args) {
1892
- instance = instance || getCurrentInstance();
1893
- // check user config
1894
- const config = getCompatConfigForKey(key, instance);
1895
- if (config === 'suppress-warning') {
1896
- return;
1897
- }
1898
- const dupKey = key + args.join('');
1899
- let compId = instance && formatComponentName(instance, instance.type);
1900
- if (compId === 'Anonymous' && instance) {
1901
- compId = instance.uid;
1902
- }
1903
- // skip if the same warning is emitted for the same component type
1904
- const componentDupKey = dupKey + compId;
1905
- if (componentDupKey in instanceWarned) {
1906
- return;
1907
- }
1908
- instanceWarned[componentDupKey] = true;
1909
- // same warning, but different component. skip the long message and just
1910
- // log the key and count.
1911
- if (dupKey in warnCount) {
1912
- warn$1(`(deprecation ${key}) (${++warnCount[dupKey] + 1})`);
1913
- return;
1914
- }
1915
- warnCount[dupKey] = 0;
1916
- const { message, link } = deprecationData[key];
1917
- warn$1(`(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`);
1918
- if (!isCompatEnabled(key, instance, true)) {
1919
- console.error(`^ The above deprecation's compat behavior is disabled and will likely ` +
1920
- `lead to runtime errors.`);
1921
- }
1922
- }
1923
- const globalCompatConfig = {
1924
- MODE: 2
1925
- };
1926
- function getCompatConfigForKey(key, instance) {
1927
- const instanceConfig = instance && instance.type.compatConfig;
1928
- if (instanceConfig && key in instanceConfig) {
1929
- return instanceConfig[key];
1930
- }
1931
- return globalCompatConfig[key];
1932
- }
1933
- function isCompatEnabled(key, instance, enableForBuiltIn = false) {
1934
- // skip compat for built-in components
1935
- if (!enableForBuiltIn && instance && instance.type.__isBuiltIn) {
1936
- return false;
1937
- }
1938
- const rawMode = getCompatConfigForKey('MODE', instance) || 2;
1939
- const val = getCompatConfigForKey(key, instance);
1940
- const mode = isFunction(rawMode)
1941
- ? rawMode(instance && instance.type)
1942
- : rawMode;
1943
- if (mode === 2) {
1944
- return val !== false;
1945
- }
1946
- else {
1947
- return val === true || val === 'suppress-warning';
1948
- }
1949
- }
1950
-
1951
1617
  function emit(instance, event, ...rawArgs) {
1952
1618
  const props = instance.vnode.props || EMPTY_OBJ;
1953
1619
  {
@@ -2173,12 +1839,12 @@ var Vue = (function (exports) {
2173
1839
  function renderComponentRoot(instance) {
2174
1840
  const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx, inheritAttrs } = instance;
2175
1841
  let result;
1842
+ let fallthroughAttrs;
2176
1843
  const prev = setCurrentRenderingInstance(instance);
2177
1844
  {
2178
1845
  accessedAttrs = false;
2179
1846
  }
2180
1847
  try {
2181
- let fallthroughAttrs;
2182
1848
  if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
2183
1849
  // withProxy is a proxy with a different `has` trap only for
2184
1850
  // runtime-compiled render functions using `with` block.
@@ -2209,97 +1875,91 @@ var Vue = (function (exports) {
2209
1875
  ? attrs
2210
1876
  : getFunctionalFallthrough(attrs);
2211
1877
  }
2212
- // attr merging
2213
- // in dev mode, comments are preserved, and it's possible for a template
2214
- // to have comments along side the root element which makes it a fragment
2215
- let root = result;
2216
- let setRoot = undefined;
2217
- if (true &&
2218
- result.patchFlag > 0 &&
2219
- result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
2220
- ;
2221
- [root, setRoot] = getChildRoot(result);
2222
- }
2223
- if (fallthroughAttrs && inheritAttrs !== false) {
2224
- const keys = Object.keys(fallthroughAttrs);
2225
- const { shapeFlag } = root;
2226
- if (keys.length) {
2227
- if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2228
- if (propsOptions && keys.some(isModelListener)) {
2229
- // If a v-model listener (onUpdate:xxx) has a corresponding declared
2230
- // prop, it indicates this component expects to handle v-model and
2231
- // it should not fallthrough.
2232
- // related: #1543, #1643, #1989
2233
- fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
2234
- }
2235
- root = cloneVNode(root, fallthroughAttrs);
2236
- }
2237
- else if (true && !accessedAttrs && root.type !== Comment) {
2238
- const allAttrs = Object.keys(attrs);
2239
- const eventAttrs = [];
2240
- const extraAttrs = [];
2241
- for (let i = 0, l = allAttrs.length; i < l; i++) {
2242
- const key = allAttrs[i];
2243
- if (isOn(key)) {
2244
- // ignore v-model handlers when they fail to fallthrough
2245
- if (!isModelListener(key)) {
2246
- // remove `on`, lowercase first letter to reflect event casing
2247
- // accurately
2248
- eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2249
- }
2250
- }
2251
- else {
2252
- extraAttrs.push(key);
1878
+ }
1879
+ catch (err) {
1880
+ blockStack.length = 0;
1881
+ handleError(err, instance, 1 /* RENDER_FUNCTION */);
1882
+ result = createVNode(Comment);
1883
+ }
1884
+ // attr merging
1885
+ // in dev mode, comments are preserved, and it's possible for a template
1886
+ // to have comments along side the root element which makes it a fragment
1887
+ let root = result;
1888
+ let setRoot = undefined;
1889
+ if (result.patchFlag > 0 &&
1890
+ result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
1891
+ [root, setRoot] = getChildRoot(result);
1892
+ }
1893
+ if (fallthroughAttrs && inheritAttrs !== false) {
1894
+ const keys = Object.keys(fallthroughAttrs);
1895
+ const { shapeFlag } = root;
1896
+ if (keys.length) {
1897
+ if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
1898
+ if (propsOptions && keys.some(isModelListener)) {
1899
+ // If a v-model listener (onUpdate:xxx) has a corresponding declared
1900
+ // prop, it indicates this component expects to handle v-model and
1901
+ // it should not fallthrough.
1902
+ // related: #1543, #1643, #1989
1903
+ fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
1904
+ }
1905
+ root = cloneVNode(root, fallthroughAttrs);
1906
+ }
1907
+ else if (!accessedAttrs && root.type !== Comment) {
1908
+ const allAttrs = Object.keys(attrs);
1909
+ const eventAttrs = [];
1910
+ const extraAttrs = [];
1911
+ for (let i = 0, l = allAttrs.length; i < l; i++) {
1912
+ const key = allAttrs[i];
1913
+ if (isOn(key)) {
1914
+ // ignore v-model handlers when they fail to fallthrough
1915
+ if (!isModelListener(key)) {
1916
+ // remove `on`, lowercase first letter to reflect event casing
1917
+ // accurately
1918
+ eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2253
1919
  }
2254
1920
  }
2255
- if (extraAttrs.length) {
2256
- warn$1(`Extraneous non-props attributes (` +
2257
- `${extraAttrs.join(', ')}) ` +
2258
- `were passed to component but could not be automatically inherited ` +
2259
- `because component renders fragment or text root nodes.`);
2260
- }
2261
- if (eventAttrs.length) {
2262
- warn$1(`Extraneous non-emits event listeners (` +
2263
- `${eventAttrs.join(', ')}) ` +
2264
- `were passed to component but could not be automatically inherited ` +
2265
- `because component renders fragment or text root nodes. ` +
2266
- `If the listener is intended to be a component custom event listener only, ` +
2267
- `declare it using the "emits" option.`);
1921
+ else {
1922
+ extraAttrs.push(key);
2268
1923
  }
2269
1924
  }
1925
+ if (extraAttrs.length) {
1926
+ warn$1(`Extraneous non-props attributes (` +
1927
+ `${extraAttrs.join(', ')}) ` +
1928
+ `were passed to component but could not be automatically inherited ` +
1929
+ `because component renders fragment or text root nodes.`);
1930
+ }
1931
+ if (eventAttrs.length) {
1932
+ warn$1(`Extraneous non-emits event listeners (` +
1933
+ `${eventAttrs.join(', ')}) ` +
1934
+ `were passed to component but could not be automatically inherited ` +
1935
+ `because component renders fragment or text root nodes. ` +
1936
+ `If the listener is intended to be a component custom event listener only, ` +
1937
+ `declare it using the "emits" option.`);
1938
+ }
2270
1939
  }
2271
1940
  }
2272
- if (false &&
2273
- isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
2274
- vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&
2275
- root.shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) ;
2276
- // inherit directives
2277
- if (vnode.dirs) {
2278
- if (true && !isElementRoot(root)) {
2279
- warn$1(`Runtime directive used on component with non-element root node. ` +
2280
- `The directives will not function as intended.`);
2281
- }
2282
- root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2283
- }
2284
- // inherit transition data
2285
- if (vnode.transition) {
2286
- if (true && !isElementRoot(root)) {
2287
- warn$1(`Component inside <Transition> renders non-element root node ` +
2288
- `that cannot be animated.`);
2289
- }
2290
- root.transition = vnode.transition;
2291
- }
2292
- if (true && setRoot) {
2293
- setRoot(root);
1941
+ }
1942
+ // inherit directives
1943
+ if (vnode.dirs) {
1944
+ if (!isElementRoot(root)) {
1945
+ warn$1(`Runtime directive used on component with non-element root node. ` +
1946
+ `The directives will not function as intended.`);
2294
1947
  }
2295
- else {
2296
- result = root;
1948
+ root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
1949
+ }
1950
+ // inherit transition data
1951
+ if (vnode.transition) {
1952
+ if (!isElementRoot(root)) {
1953
+ warn$1(`Component inside <Transition> renders non-element root node ` +
1954
+ `that cannot be animated.`);
2297
1955
  }
1956
+ root.transition = vnode.transition;
2298
1957
  }
2299
- catch (err) {
2300
- blockStack.length = 0;
2301
- handleError(err, instance, 1 /* RENDER_FUNCTION */);
2302
- result = createVNode(Comment);
1958
+ if (setRoot) {
1959
+ setRoot(root);
1960
+ }
1961
+ else {
1962
+ result = root;
2303
1963
  }
2304
1964
  setCurrentRenderingInstance(prev);
2305
1965
  return result;
@@ -2834,8 +2494,8 @@ var Vue = (function (exports) {
2834
2494
  function normalizeSuspenseSlot(s) {
2835
2495
  let block;
2836
2496
  if (isFunction(s)) {
2837
- const isCompiledSlot = s._c;
2838
- if (isCompiledSlot) {
2497
+ const trackBlock = isBlockTreeEnabled && s._c;
2498
+ if (trackBlock) {
2839
2499
  // disableTracking: false
2840
2500
  // allow block tracking for compiled slots
2841
2501
  // (see ./componentRenderContext.ts)
@@ -2843,7 +2503,7 @@ var Vue = (function (exports) {
2843
2503
  openBlock();
2844
2504
  }
2845
2505
  s = s();
2846
- if (isCompiledSlot) {
2506
+ if (trackBlock) {
2847
2507
  s._d = true;
2848
2508
  block = currentBlock;
2849
2509
  closeBlock();
@@ -6939,7 +6599,11 @@ var Vue = (function (exports) {
6939
6599
  return Component;
6940
6600
  }
6941
6601
  if (warnMissing && !res) {
6942
- warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}`);
6602
+ const extra = type === COMPONENTS
6603
+ ? `\nIf this is a native custom element, make sure to exclude it from ` +
6604
+ `component resolution via compilerOptions.isCustomElement.`
6605
+ : ``;
6606
+ warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
6943
6607
  }
6944
6608
  return res;
6945
6609
  }
@@ -7794,17 +7458,19 @@ var Vue = (function (exports) {
7794
7458
  function exposeSetupStateOnRenderContext(instance) {
7795
7459
  const { ctx, setupState } = instance;
7796
7460
  Object.keys(toRaw(setupState)).forEach(key => {
7797
- if (!setupState.__isScriptSetup && (key[0] === '$' || key[0] === '_')) {
7798
- warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
7799
- `which are reserved prefixes for Vue internals.`);
7800
- return;
7461
+ if (!setupState.__isScriptSetup) {
7462
+ if (key[0] === '$' || key[0] === '_') {
7463
+ warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
7464
+ `which are reserved prefixes for Vue internals.`);
7465
+ return;
7466
+ }
7467
+ Object.defineProperty(ctx, key, {
7468
+ enumerable: true,
7469
+ configurable: true,
7470
+ get: () => setupState[key],
7471
+ set: NOOP
7472
+ });
7801
7473
  }
7802
- Object.defineProperty(ctx, key, {
7803
- enumerable: true,
7804
- configurable: true,
7805
- get: () => setupState[key],
7806
- set: NOOP
7807
- });
7808
7474
  });
7809
7475
  }
7810
7476
 
@@ -8548,11 +8214,18 @@ var Vue = (function (exports) {
8548
8214
  // 2. If a component is unmounted during a parent component's update,
8549
8215
  // its update can be skipped.
8550
8216
  queue.sort((a, b) => getId(a) - getId(b));
8217
+ // conditional usage of checkRecursiveUpdate must be determined out of
8218
+ // try ... catch block since Rollup by default de-optimizes treeshaking
8219
+ // inside try-catch. This can leave all warning code unshaked. Although
8220
+ // they would get eventually shaken by a minifier like terser, some minifiers
8221
+ // would fail to do that (e.g. https://github.com/evanw/esbuild/issues/1610)
8222
+ const check = (job) => checkRecursiveUpdates(seen, job)
8223
+ ;
8551
8224
  try {
8552
8225
  for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
8553
8226
  const job = queue[flushIndex];
8554
8227
  if (job && job.active !== false) {
8555
- if (true && checkRecursiveUpdates(seen, job)) {
8228
+ if (true && check(job)) {
8556
8229
  continue;
8557
8230
  }
8558
8231
  // console.log(`running:`, job.id)
@@ -8883,7 +8556,7 @@ var Vue = (function (exports) {
8883
8556
  }
8884
8557
  /**
8885
8558
  * Vue `<script setup>` compiler macro for providing props default values when
8886
- * using type-based `defineProps` decalration.
8559
+ * using type-based `defineProps` declaration.
8887
8560
  *
8888
8561
  * Example usage:
8889
8562
  * ```ts
@@ -9227,7 +8900,7 @@ var Vue = (function (exports) {
9227
8900
  }
9228
8901
 
9229
8902
  // Core API ------------------------------------------------------------------
9230
- const version = "3.2.8";
8903
+ const version = "3.2.12";
9231
8904
  /**
9232
8905
  * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
9233
8906
  * @internal
@@ -9349,19 +9022,13 @@ var Vue = (function (exports) {
9349
9022
 
9350
9023
  function patchStyle(el, prev, next) {
9351
9024
  const style = el.style;
9025
+ const currentDisplay = style.display;
9352
9026
  if (!next) {
9353
9027
  el.removeAttribute('style');
9354
9028
  }
9355
9029
  else if (isString(next)) {
9356
9030
  if (prev !== next) {
9357
- const current = style.display;
9358
9031
  style.cssText = next;
9359
- // indicates that the `display` of the element is controlled by `v-show`,
9360
- // so we always keep the current `display` value regardless of the `style` value,
9361
- // thus handing over control to `v-show`.
9362
- if ('_vod' in el) {
9363
- style.display = current;
9364
- }
9365
9032
  }
9366
9033
  }
9367
9034
  else {
@@ -9376,6 +9043,12 @@ var Vue = (function (exports) {
9376
9043
  }
9377
9044
  }
9378
9045
  }
9046
+ // indicates that the `display` of the element is controlled by `v-show`,
9047
+ // so we always keep the current `display` value regardless of the `style` value,
9048
+ // thus handing over control to `v-show`.
9049
+ if ('_vod' in el) {
9050
+ style.display = currentDisplay;
9051
+ }
9379
9052
  }
9380
9053
  const importantRE = /\s*!important$/;
9381
9054
  function setStyle(style, name, val) {
@@ -9709,6 +9382,7 @@ var Vue = (function (exports) {
9709
9382
  this._instance = null;
9710
9383
  this._connected = false;
9711
9384
  this._resolved = false;
9385
+ this._numberProps = null;
9712
9386
  if (this.shadowRoot && hydrate) {
9713
9387
  hydrate(this._createVNode(), this.shadowRoot);
9714
9388
  }
@@ -9724,18 +9398,17 @@ var Vue = (function (exports) {
9724
9398
  this._setAttr(this.attributes[i].name);
9725
9399
  }
9726
9400
  // watch future attr changes
9727
- const observer = new MutationObserver(mutations => {
9401
+ new MutationObserver(mutations => {
9728
9402
  for (const m of mutations) {
9729
9403
  this._setAttr(m.attributeName);
9730
9404
  }
9731
- });
9732
- observer.observe(this, { attributes: true });
9405
+ }).observe(this, { attributes: true });
9733
9406
  }
9734
9407
  connectedCallback() {
9735
9408
  this._connected = true;
9736
9409
  if (!this._instance) {
9737
9410
  this._resolveDef();
9738
- render(this._createVNode(), this.shadowRoot);
9411
+ this._update();
9739
9412
  }
9740
9413
  }
9741
9414
  disconnectedCallback() {
@@ -9756,15 +9429,31 @@ var Vue = (function (exports) {
9756
9429
  }
9757
9430
  const resolve = (def) => {
9758
9431
  this._resolved = true;
9432
+ const { props, styles } = def;
9433
+ const hasOptions = !isArray(props);
9434
+ const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
9435
+ // cast Number-type props set before resolve
9436
+ let numberProps;
9437
+ if (hasOptions) {
9438
+ for (const key in this._props) {
9439
+ const opt = props[key];
9440
+ if (opt === Number || (opt && opt.type === Number)) {
9441
+ this._props[key] = toNumber(this._props[key]);
9442
+ (numberProps || (numberProps = Object.create(null)))[key] = true;
9443
+ }
9444
+ }
9445
+ }
9446
+ if (numberProps) {
9447
+ this._numberProps = numberProps;
9448
+ this._update();
9449
+ }
9759
9450
  // check if there are props set pre-upgrade or connect
9760
9451
  for (const key of Object.keys(this)) {
9761
9452
  if (key[0] !== '_') {
9762
9453
  this._setProp(key, this[key]);
9763
9454
  }
9764
9455
  }
9765
- const { props, styles } = def;
9766
9456
  // defining getter/setters on prototype
9767
- const rawKeys = props ? (isArray(props) ? props : Object.keys(props)) : [];
9768
9457
  for (const key of rawKeys.map(camelize)) {
9769
9458
  Object.defineProperty(this, key, {
9770
9459
  get() {
@@ -9786,7 +9475,11 @@ var Vue = (function (exports) {
9786
9475
  }
9787
9476
  }
9788
9477
  _setAttr(key) {
9789
- this._setProp(camelize(key), toNumber(this.getAttribute(key)), false);
9478
+ let value = this.getAttribute(key);
9479
+ if (this._numberProps && this._numberProps[key]) {
9480
+ value = toNumber(value);
9481
+ }
9482
+ this._setProp(camelize(key), value, false);
9790
9483
  }
9791
9484
  /**
9792
9485
  * @internal
@@ -9801,7 +9494,7 @@ var Vue = (function (exports) {
9801
9494
  if (val !== this._props[key]) {
9802
9495
  this._props[key] = val;
9803
9496
  if (this._instance) {
9804
- render(this._createVNode(), this.shadowRoot);
9497
+ this._update();
9805
9498
  }
9806
9499
  // reflect
9807
9500
  if (shouldReflect) {
@@ -9817,6 +9510,9 @@ var Vue = (function (exports) {
9817
9510
  }
9818
9511
  }
9819
9512
  }
9513
+ _update() {
9514
+ render(this._createVNode(), this.shadowRoot);
9515
+ }
9820
9516
  _createVNode() {
9821
9517
  const vnode = createVNode(this._def, extend({}, this._props));
9822
9518
  if (!this._instance) {
@@ -9837,7 +9533,7 @@ var Vue = (function (exports) {
9837
9533
  if (!this._def.__asyncLoader) {
9838
9534
  // reload
9839
9535
  this._instance = null;
9840
- render(this._createVNode(), this.shadowRoot);
9536
+ this._update();
9841
9537
  }
9842
9538
  };
9843
9539
  }