vue 3.2.11 → 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.
@@ -1612,335 +1612,6 @@ function devtoolsComponentEmit(component, event, params) {
1612
1612
  devtools.emit("component:emit" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);
1613
1613
  }
1614
1614
 
1615
- const deprecationData = {
1616
- ["GLOBAL_MOUNT" /* GLOBAL_MOUNT */]: {
1617
- message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
1618
- `option have been removed. Use createApp(RootComponent).mount() instead.`,
1619
- link: `https://v3.vuejs.org/guide/migration/global-api.html#mounting-app-instance`
1620
- },
1621
- ["GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */]: {
1622
- message: `Vue detected directives on the mount container. ` +
1623
- `In Vue 3, the container is no longer considered part of the template ` +
1624
- `and will not be processed/replaced.`,
1625
- link: `https://v3.vuejs.org/guide/migration/mount-changes.html`
1626
- },
1627
- ["GLOBAL_EXTEND" /* GLOBAL_EXTEND */]: {
1628
- message: `Vue.extend() has been removed in Vue 3. ` +
1629
- `Use defineComponent() instead.`,
1630
- link: `https://v3.vuejs.org/api/global-api.html#definecomponent`
1631
- },
1632
- ["GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */]: {
1633
- message: `Vue.prototype is no longer available in Vue 3. ` +
1634
- `Use app.config.globalProperties instead.`,
1635
- link: `https://v3.vuejs.org/guide/migration/global-api.html#vue-prototype-replaced-by-config-globalproperties`
1636
- },
1637
- ["GLOBAL_SET" /* GLOBAL_SET */]: {
1638
- message: `Vue.set() has been removed as it is no longer needed in Vue 3. ` +
1639
- `Simply use native JavaScript mutations.`
1640
- },
1641
- ["GLOBAL_DELETE" /* GLOBAL_DELETE */]: {
1642
- message: `Vue.delete() has been removed as it is no longer needed in Vue 3. ` +
1643
- `Simply use native JavaScript mutations.`
1644
- },
1645
- ["GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */]: {
1646
- message: `Vue.observable() has been removed. ` +
1647
- `Use \`import { reactive } from "vue"\` from Composition API instead.`,
1648
- link: `https://v3.vuejs.org/api/basic-reactivity.html`
1649
- },
1650
- ["GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */]: {
1651
- message: `Vue.util has been removed. Please refactor to avoid its usage ` +
1652
- `since it was an internal API even in Vue 2.`
1653
- },
1654
- ["CONFIG_SILENT" /* CONFIG_SILENT */]: {
1655
- message: `config.silent has been removed because it is not good practice to ` +
1656
- `intentionally suppress warnings. You can use your browser console's ` +
1657
- `filter features to focus on relevant messages.`
1658
- },
1659
- ["CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */]: {
1660
- message: `config.devtools has been removed. To enable devtools for ` +
1661
- `production, configure the __VUE_PROD_DEVTOOLS__ compile-time flag.`,
1662
- link: `https://github.com/vuejs/vue-next/tree/master/packages/vue#bundler-build-feature-flags`
1663
- },
1664
- ["CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */]: {
1665
- message: `config.keyCodes has been removed. ` +
1666
- `In Vue 3, you can directly use the kebab-case key names as v-on modifiers.`,
1667
- link: `https://v3.vuejs.org/guide/migration/keycode-modifiers.html`
1668
- },
1669
- ["CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */]: {
1670
- message: `config.productionTip has been removed.`,
1671
- link: `https://v3.vuejs.org/guide/migration/global-api.html#config-productiontip-removed`
1672
- },
1673
- ["CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */]: {
1674
- message: () => {
1675
- let msg = `config.ignoredElements has been removed.`;
1676
- if (isRuntimeOnly()) {
1677
- msg += ` Pass the "isCustomElement" option to @vue/compiler-dom instead.`;
1678
- }
1679
- else {
1680
- msg += ` Use config.isCustomElement instead.`;
1681
- }
1682
- return msg;
1683
- },
1684
- link: `https://v3.vuejs.org/guide/migration/global-api.html#config-ignoredelements-is-now-config-iscustomelement`
1685
- },
1686
- ["CONFIG_WHITESPACE" /* CONFIG_WHITESPACE */]: {
1687
- // this warning is only relevant in the full build when using runtime
1688
- // compilation, so it's put in the runtime compatConfig list.
1689
- message: `Vue 3 compiler's whitespace option will default to "condense" instead of ` +
1690
- `"preserve". To suppress this warning, provide an explicit value for ` +
1691
- `\`config.compilerOptions.whitespace\`.`
1692
- },
1693
- ["CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */]: {
1694
- message: `config.optionMergeStrategies no longer exposes internal strategies. ` +
1695
- `Use custom merge functions instead.`
1696
- },
1697
- ["INSTANCE_SET" /* INSTANCE_SET */]: {
1698
- message: `vm.$set() has been removed as it is no longer needed in Vue 3. ` +
1699
- `Simply use native JavaScript mutations.`
1700
- },
1701
- ["INSTANCE_DELETE" /* INSTANCE_DELETE */]: {
1702
- message: `vm.$delete() has been removed as it is no longer needed in Vue 3. ` +
1703
- `Simply use native JavaScript mutations.`
1704
- },
1705
- ["INSTANCE_DESTROY" /* INSTANCE_DESTROY */]: {
1706
- message: `vm.$destroy() has been removed. Use app.unmount() instead.`,
1707
- link: `https://v3.vuejs.org/api/application-api.html#unmount`
1708
- },
1709
- ["INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */]: {
1710
- message: `vm.$on/$once/$off() have been removed. ` +
1711
- `Use an external event emitter library instead.`,
1712
- link: `https://v3.vuejs.org/guide/migration/events-api.html`
1713
- },
1714
- ["INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */]: {
1715
- message: event => `"${event}" lifecycle events are no longer supported. From templates, ` +
1716
- `use the "vnode" prefix instead of "hook:". For example, @${event} ` +
1717
- `should be changed to @vnode-${event.slice(5)}. ` +
1718
- `From JavaScript, use Composition API to dynamically register lifecycle ` +
1719
- `hooks.`,
1720
- link: `https://v3.vuejs.org/guide/migration/vnode-lifecycle-events.html`
1721
- },
1722
- ["INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */]: {
1723
- message: `vm.$children has been removed. Consider refactoring your logic ` +
1724
- `to avoid relying on direct access to child components.`,
1725
- link: `https://v3.vuejs.org/guide/migration/children.html`
1726
- },
1727
- ["INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */]: {
1728
- message: `vm.$listeners has been removed. In Vue 3, parent v-on listeners are ` +
1729
- `included in vm.$attrs and it is no longer necessary to separately use ` +
1730
- `v-on="$listeners" if you are already using v-bind="$attrs". ` +
1731
- `(Note: the Vue 3 behavior only applies if this compat config is disabled)`,
1732
- link: `https://v3.vuejs.org/guide/migration/listeners-removed.html`
1733
- },
1734
- ["INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */]: {
1735
- message: `vm.$scopedSlots has been removed. Use vm.$slots instead.`,
1736
- link: `https://v3.vuejs.org/guide/migration/slots-unification.html`
1737
- },
1738
- ["INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */]: {
1739
- message: componentName => `Component <${componentName || 'Anonymous'}> has \`inheritAttrs: false\` but is ` +
1740
- `relying on class/style fallthrough from parent. In Vue 3, class/style ` +
1741
- `are now included in $attrs and will no longer fallthrough when ` +
1742
- `inheritAttrs is false. If you are already using v-bind="$attrs" on ` +
1743
- `component root it should render the same end result. ` +
1744
- `If you are binding $attrs to a non-root element and expecting ` +
1745
- `class/style to fallthrough on root, you will need to now manually bind ` +
1746
- `them on root via :class="$attrs.class".`,
1747
- link: `https://v3.vuejs.org/guide/migration/attrs-includes-class-style.html`
1748
- },
1749
- ["OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */]: {
1750
- message: `The "data" option can no longer be a plain object. ` +
1751
- `Always use a function.`,
1752
- link: `https://v3.vuejs.org/guide/migration/data-option.html`
1753
- },
1754
- ["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */]: {
1755
- message: (key) => `Detected conflicting key "${key}" when merging data option values. ` +
1756
- `In Vue 3, data keys are merged shallowly and will override one another.`,
1757
- link: `https://v3.vuejs.org/guide/migration/data-option.html#mixin-merge-behavior-change`
1758
- },
1759
- ["OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */]: {
1760
- message: `\`beforeDestroy\` has been renamed to \`beforeUnmount\`.`
1761
- },
1762
- ["OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */]: {
1763
- message: `\`destroyed\` has been renamed to \`unmounted\`.`
1764
- },
1765
- ["WATCH_ARRAY" /* WATCH_ARRAY */]: {
1766
- message: `"watch" option or vm.$watch on an array value will no longer ` +
1767
- `trigger on array mutation unless the "deep" option is specified. ` +
1768
- `If current usage is intended, you can disable the compat behavior and ` +
1769
- `suppress this warning with:` +
1770
- `\n\n configureCompat({ ${"WATCH_ARRAY" /* WATCH_ARRAY */}: false })\n`,
1771
- link: `https://v3.vuejs.org/guide/migration/watch.html`
1772
- },
1773
- ["PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */]: {
1774
- message: (key) => `props default value function no longer has access to "this". The compat ` +
1775
- `build only offers access to this.$options.` +
1776
- `(found in prop "${key}")`,
1777
- link: `https://v3.vuejs.org/guide/migration/props-default-this.html`
1778
- },
1779
- ["CUSTOM_DIR" /* CUSTOM_DIR */]: {
1780
- message: (legacyHook, newHook) => `Custom directive hook "${legacyHook}" has been removed. ` +
1781
- `Use "${newHook}" instead.`,
1782
- link: `https://v3.vuejs.org/guide/migration/custom-directives.html`
1783
- },
1784
- ["V_FOR_REF" /* V_FOR_REF */]: {
1785
- message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +
1786
- `Consider using function refs or refactor to avoid ref usage altogether.`,
1787
- link: `https://v3.vuejs.org/guide/migration/array-refs.html`
1788
- },
1789
- ["V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */]: {
1790
- message: `Using keyCode as v-on modifier is no longer supported. ` +
1791
- `Use kebab-case key name modifiers instead.`,
1792
- link: `https://v3.vuejs.org/guide/migration/keycode-modifiers.html`
1793
- },
1794
- ["ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */]: {
1795
- message: (name) => `Attribute "${name}" with v-bind value \`false\` will render ` +
1796
- `${name}="false" instead of removing it in Vue 3. To remove the attribute, ` +
1797
- `use \`null\` or \`undefined\` instead. If the usage is intended, ` +
1798
- `you can disable the compat behavior and suppress this warning with:` +
1799
- `\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */}: false })\n`,
1800
- link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`
1801
- },
1802
- ["ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */]: {
1803
- message: (name, value, coerced) => `Enumerated attribute "${name}" with v-bind value \`${value}\` will ` +
1804
- `${value === null ? `be removed` : `render the value as-is`} instead of coercing the value to "${coerced}" in Vue 3. ` +
1805
- `Always use explicit "true" or "false" values for enumerated attributes. ` +
1806
- `If the usage is intended, ` +
1807
- `you can disable the compat behavior and suppress this warning with:` +
1808
- `\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */}: false })\n`,
1809
- link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`
1810
- },
1811
- ["TRANSITION_CLASSES" /* TRANSITION_CLASSES */]: {
1812
- message: `` // this feature cannot be runtime-detected
1813
- },
1814
- ["TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */]: {
1815
- message: `<TransitionGroup> no longer renders a root <span> element by ` +
1816
- `default if no "tag" prop is specified. If you do not rely on the span ` +
1817
- `for styling, you can disable the compat behavior and suppress this ` +
1818
- `warning with:` +
1819
- `\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */}: false })\n`,
1820
- link: `https://v3.vuejs.org/guide/migration/transition-group.html`
1821
- },
1822
- ["COMPONENT_ASYNC" /* COMPONENT_ASYNC */]: {
1823
- message: (comp) => {
1824
- const name = getComponentName(comp);
1825
- return (`Async component${name ? ` <${name}>` : `s`} should be explicitly created via \`defineAsyncComponent()\` ` +
1826
- `in Vue 3. Plain functions will be treated as functional components in ` +
1827
- `non-compat build. If you have already migrated all async component ` +
1828
- `usage and intend to use plain functions for functional components, ` +
1829
- `you can disable the compat behavior and suppress this ` +
1830
- `warning with:` +
1831
- `\n\n configureCompat({ ${"COMPONENT_ASYNC" /* COMPONENT_ASYNC */}: false })\n`);
1832
- },
1833
- link: `https://v3.vuejs.org/guide/migration/async-components.html`
1834
- },
1835
- ["COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */]: {
1836
- message: (comp) => {
1837
- const name = getComponentName(comp);
1838
- return (`Functional component${name ? ` <${name}>` : `s`} should be defined as a plain function in Vue 3. The "functional" ` +
1839
- `option has been removed. NOTE: Before migrating to use plain ` +
1840
- `functions for functional components, first make sure that all async ` +
1841
- `components usage have been migrated and its compat behavior has ` +
1842
- `been disabled.`);
1843
- },
1844
- link: `https://v3.vuejs.org/guide/migration/functional-components.html`
1845
- },
1846
- ["COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */]: {
1847
- message: (comp) => {
1848
- const configMsg = `opt-in to ` +
1849
- `Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */}: false }\`.`;
1850
- if (comp.props &&
1851
- (isArray(comp.props)
1852
- ? comp.props.includes('modelValue')
1853
- : hasOwn(comp.props, 'modelValue'))) {
1854
- return (`Component delcares "modelValue" prop, which is Vue 3 usage, but ` +
1855
- `is running under Vue 2 compat v-model behavior. You can ${configMsg}`);
1856
- }
1857
- return (`v-model usage on component has changed in Vue 3. Component that expects ` +
1858
- `to work with v-model should now use the "modelValue" prop and emit the ` +
1859
- `"update:modelValue" event. You can update the usage and then ${configMsg}`);
1860
- },
1861
- link: `https://v3.vuejs.org/guide/migration/v-model.html`
1862
- },
1863
- ["RENDER_FUNCTION" /* RENDER_FUNCTION */]: {
1864
- message: `Vue 3's render function API has changed. ` +
1865
- `You can opt-in to the new API with:` +
1866
- `\n\n configureCompat({ ${"RENDER_FUNCTION" /* RENDER_FUNCTION */}: false })\n` +
1867
- `\n (This can also be done per-component via the "compatConfig" option.)`,
1868
- link: `https://v3.vuejs.org/guide/migration/render-function-api.html`
1869
- },
1870
- ["FILTERS" /* FILTERS */]: {
1871
- message: `filters have been removed in Vue 3. ` +
1872
- `The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
1873
- `Use method calls or computed properties instead.`,
1874
- link: `https://v3.vuejs.org/guide/migration/filters.html`
1875
- },
1876
- ["PRIVATE_APIS" /* PRIVATE_APIS */]: {
1877
- message: name => `"${name}" is a Vue 2 private API that no longer exists in Vue 3. ` +
1878
- `If you are seeing this warning only due to a dependency, you can ` +
1879
- `suppress this warning via { PRIVATE_APIS: 'supress-warning' }.`
1880
- }
1881
- };
1882
- const instanceWarned = Object.create(null);
1883
- const warnCount = Object.create(null);
1884
- function warnDeprecation(key, instance, ...args) {
1885
- instance = instance || getCurrentInstance();
1886
- // check user config
1887
- const config = getCompatConfigForKey(key, instance);
1888
- if (config === 'suppress-warning') {
1889
- return;
1890
- }
1891
- const dupKey = key + args.join('');
1892
- let compId = instance && formatComponentName(instance, instance.type);
1893
- if (compId === 'Anonymous' && instance) {
1894
- compId = instance.uid;
1895
- }
1896
- // skip if the same warning is emitted for the same component type
1897
- const componentDupKey = dupKey + compId;
1898
- if (componentDupKey in instanceWarned) {
1899
- return;
1900
- }
1901
- instanceWarned[componentDupKey] = true;
1902
- // same warning, but different component. skip the long message and just
1903
- // log the key and count.
1904
- if (dupKey in warnCount) {
1905
- warn$1(`(deprecation ${key}) (${++warnCount[dupKey] + 1})`);
1906
- return;
1907
- }
1908
- warnCount[dupKey] = 0;
1909
- const { message, link } = deprecationData[key];
1910
- warn$1(`(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`);
1911
- if (!isCompatEnabled(key, instance, true)) {
1912
- console.error(`^ The above deprecation's compat behavior is disabled and will likely ` +
1913
- `lead to runtime errors.`);
1914
- }
1915
- }
1916
- const globalCompatConfig = {
1917
- MODE: 2
1918
- };
1919
- function getCompatConfigForKey(key, instance) {
1920
- const instanceConfig = instance && instance.type.compatConfig;
1921
- if (instanceConfig && key in instanceConfig) {
1922
- return instanceConfig[key];
1923
- }
1924
- return globalCompatConfig[key];
1925
- }
1926
- function isCompatEnabled(key, instance, enableForBuiltIn = false) {
1927
- // skip compat for built-in components
1928
- if (!enableForBuiltIn && instance && instance.type.__isBuiltIn) {
1929
- return false;
1930
- }
1931
- const rawMode = getCompatConfigForKey('MODE', instance) || 2;
1932
- const val = getCompatConfigForKey(key, instance);
1933
- const mode = isFunction(rawMode)
1934
- ? rawMode(instance && instance.type)
1935
- : rawMode;
1936
- if (mode === 2) {
1937
- return val !== false;
1938
- }
1939
- else {
1940
- return val === true || val === 'suppress-warning';
1941
- }
1942
- }
1943
-
1944
1615
  function emit(instance, event, ...rawArgs) {
1945
1616
  const props = instance.vnode.props || EMPTY_OBJ;
1946
1617
  {
@@ -2166,12 +1837,12 @@ function markAttrsAccessed() {
2166
1837
  function renderComponentRoot(instance) {
2167
1838
  const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx, inheritAttrs } = instance;
2168
1839
  let result;
1840
+ let fallthroughAttrs;
2169
1841
  const prev = setCurrentRenderingInstance(instance);
2170
1842
  {
2171
1843
  accessedAttrs = false;
2172
1844
  }
2173
1845
  try {
2174
- let fallthroughAttrs;
2175
1846
  if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
2176
1847
  // withProxy is a proxy with a different `has` trap only for
2177
1848
  // runtime-compiled render functions using `with` block.
@@ -2202,97 +1873,91 @@ function renderComponentRoot(instance) {
2202
1873
  ? attrs
2203
1874
  : getFunctionalFallthrough(attrs);
2204
1875
  }
2205
- // attr merging
2206
- // in dev mode, comments are preserved, and it's possible for a template
2207
- // to have comments along side the root element which makes it a fragment
2208
- let root = result;
2209
- let setRoot = undefined;
2210
- if (true &&
2211
- result.patchFlag > 0 &&
2212
- result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
2213
- ;
2214
- [root, setRoot] = getChildRoot(result);
2215
- }
2216
- if (fallthroughAttrs && inheritAttrs !== false) {
2217
- const keys = Object.keys(fallthroughAttrs);
2218
- const { shapeFlag } = root;
2219
- if (keys.length) {
2220
- if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2221
- if (propsOptions && keys.some(isModelListener)) {
2222
- // If a v-model listener (onUpdate:xxx) has a corresponding declared
2223
- // prop, it indicates this component expects to handle v-model and
2224
- // it should not fallthrough.
2225
- // related: #1543, #1643, #1989
2226
- fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
2227
- }
2228
- root = cloneVNode(root, fallthroughAttrs);
2229
- }
2230
- else if (true && !accessedAttrs && root.type !== Comment) {
2231
- const allAttrs = Object.keys(attrs);
2232
- const eventAttrs = [];
2233
- const extraAttrs = [];
2234
- for (let i = 0, l = allAttrs.length; i < l; i++) {
2235
- const key = allAttrs[i];
2236
- if (isOn(key)) {
2237
- // ignore v-model handlers when they fail to fallthrough
2238
- if (!isModelListener(key)) {
2239
- // remove `on`, lowercase first letter to reflect event casing
2240
- // accurately
2241
- eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2242
- }
2243
- }
2244
- else {
2245
- extraAttrs.push(key);
1876
+ }
1877
+ catch (err) {
1878
+ blockStack.length = 0;
1879
+ handleError(err, instance, 1 /* RENDER_FUNCTION */);
1880
+ result = createVNode(Comment);
1881
+ }
1882
+ // attr merging
1883
+ // in dev mode, comments are preserved, and it's possible for a template
1884
+ // to have comments along side the root element which makes it a fragment
1885
+ let root = result;
1886
+ let setRoot = undefined;
1887
+ if (result.patchFlag > 0 &&
1888
+ result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
1889
+ [root, setRoot] = getChildRoot(result);
1890
+ }
1891
+ if (fallthroughAttrs && inheritAttrs !== false) {
1892
+ const keys = Object.keys(fallthroughAttrs);
1893
+ const { shapeFlag } = root;
1894
+ if (keys.length) {
1895
+ if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
1896
+ if (propsOptions && keys.some(isModelListener)) {
1897
+ // If a v-model listener (onUpdate:xxx) has a corresponding declared
1898
+ // prop, it indicates this component expects to handle v-model and
1899
+ // it should not fallthrough.
1900
+ // related: #1543, #1643, #1989
1901
+ fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
1902
+ }
1903
+ root = cloneVNode(root, fallthroughAttrs);
1904
+ }
1905
+ else if (!accessedAttrs && root.type !== Comment) {
1906
+ const allAttrs = Object.keys(attrs);
1907
+ const eventAttrs = [];
1908
+ const extraAttrs = [];
1909
+ for (let i = 0, l = allAttrs.length; i < l; i++) {
1910
+ const key = allAttrs[i];
1911
+ if (isOn(key)) {
1912
+ // ignore v-model handlers when they fail to fallthrough
1913
+ if (!isModelListener(key)) {
1914
+ // remove `on`, lowercase first letter to reflect event casing
1915
+ // accurately
1916
+ eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2246
1917
  }
2247
1918
  }
2248
- if (extraAttrs.length) {
2249
- warn$1(`Extraneous non-props attributes (` +
2250
- `${extraAttrs.join(', ')}) ` +
2251
- `were passed to component but could not be automatically inherited ` +
2252
- `because component renders fragment or text root nodes.`);
2253
- }
2254
- if (eventAttrs.length) {
2255
- warn$1(`Extraneous non-emits event listeners (` +
2256
- `${eventAttrs.join(', ')}) ` +
2257
- `were passed to component but could not be automatically inherited ` +
2258
- `because component renders fragment or text root nodes. ` +
2259
- `If the listener is intended to be a component custom event listener only, ` +
2260
- `declare it using the "emits" option.`);
1919
+ else {
1920
+ extraAttrs.push(key);
2261
1921
  }
2262
1922
  }
1923
+ if (extraAttrs.length) {
1924
+ warn$1(`Extraneous non-props attributes (` +
1925
+ `${extraAttrs.join(', ')}) ` +
1926
+ `were passed to component but could not be automatically inherited ` +
1927
+ `because component renders fragment or text root nodes.`);
1928
+ }
1929
+ if (eventAttrs.length) {
1930
+ warn$1(`Extraneous non-emits event listeners (` +
1931
+ `${eventAttrs.join(', ')}) ` +
1932
+ `were passed to component but could not be automatically inherited ` +
1933
+ `because component renders fragment or text root nodes. ` +
1934
+ `If the listener is intended to be a component custom event listener only, ` +
1935
+ `declare it using the "emits" option.`);
1936
+ }
2263
1937
  }
2264
1938
  }
2265
- if (false &&
2266
- isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
2267
- vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&
2268
- root.shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) ;
2269
- // inherit directives
2270
- if (vnode.dirs) {
2271
- if (true && !isElementRoot(root)) {
2272
- warn$1(`Runtime directive used on component with non-element root node. ` +
2273
- `The directives will not function as intended.`);
2274
- }
2275
- root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2276
- }
2277
- // inherit transition data
2278
- if (vnode.transition) {
2279
- if (true && !isElementRoot(root)) {
2280
- warn$1(`Component inside <Transition> renders non-element root node ` +
2281
- `that cannot be animated.`);
2282
- }
2283
- root.transition = vnode.transition;
2284
- }
2285
- if (true && setRoot) {
2286
- setRoot(root);
1939
+ }
1940
+ // inherit directives
1941
+ if (vnode.dirs) {
1942
+ if (!isElementRoot(root)) {
1943
+ warn$1(`Runtime directive used on component with non-element root node. ` +
1944
+ `The directives will not function as intended.`);
2287
1945
  }
2288
- else {
2289
- result = root;
1946
+ root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
1947
+ }
1948
+ // inherit transition data
1949
+ if (vnode.transition) {
1950
+ if (!isElementRoot(root)) {
1951
+ warn$1(`Component inside <Transition> renders non-element root node ` +
1952
+ `that cannot be animated.`);
2290
1953
  }
1954
+ root.transition = vnode.transition;
2291
1955
  }
2292
- catch (err) {
2293
- blockStack.length = 0;
2294
- handleError(err, instance, 1 /* RENDER_FUNCTION */);
2295
- result = createVNode(Comment);
1956
+ if (setRoot) {
1957
+ setRoot(root);
1958
+ }
1959
+ else {
1960
+ result = root;
2296
1961
  }
2297
1962
  setCurrentRenderingInstance(prev);
2298
1963
  return result;
@@ -2827,8 +2492,8 @@ function normalizeSuspenseChildren(vnode) {
2827
2492
  function normalizeSuspenseSlot(s) {
2828
2493
  let block;
2829
2494
  if (isFunction(s)) {
2830
- const isCompiledSlot = s._c;
2831
- if (isCompiledSlot) {
2495
+ const trackBlock = isBlockTreeEnabled && s._c;
2496
+ if (trackBlock) {
2832
2497
  // disableTracking: false
2833
2498
  // allow block tracking for compiled slots
2834
2499
  // (see ./componentRenderContext.ts)
@@ -2836,7 +2501,7 @@ function normalizeSuspenseSlot(s) {
2836
2501
  openBlock();
2837
2502
  }
2838
2503
  s = s();
2839
- if (isCompiledSlot) {
2504
+ if (trackBlock) {
2840
2505
  s._d = true;
2841
2506
  block = currentBlock;
2842
2507
  closeBlock();
@@ -6932,7 +6597,11 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
6932
6597
  return Component;
6933
6598
  }
6934
6599
  if (warnMissing && !res) {
6935
- warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}`);
6600
+ const extra = type === COMPONENTS
6601
+ ? `\nIf this is a native custom element, make sure to exclude it from ` +
6602
+ `component resolution via compilerOptions.isCustomElement.`
6603
+ : ``;
6604
+ warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
6936
6605
  }
6937
6606
  return res;
6938
6607
  }
@@ -7787,17 +7456,19 @@ function exposePropsOnRenderContext(instance) {
7787
7456
  function exposeSetupStateOnRenderContext(instance) {
7788
7457
  const { ctx, setupState } = instance;
7789
7458
  Object.keys(toRaw(setupState)).forEach(key => {
7790
- if (!setupState.__isScriptSetup && (key[0] === '$' || key[0] === '_')) {
7791
- warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
7792
- `which are reserved prefixes for Vue internals.`);
7793
- return;
7459
+ if (!setupState.__isScriptSetup) {
7460
+ if (key[0] === '$' || key[0] === '_') {
7461
+ warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
7462
+ `which are reserved prefixes for Vue internals.`);
7463
+ return;
7464
+ }
7465
+ Object.defineProperty(ctx, key, {
7466
+ enumerable: true,
7467
+ configurable: true,
7468
+ get: () => setupState[key],
7469
+ set: NOOP
7470
+ });
7794
7471
  }
7795
- Object.defineProperty(ctx, key, {
7796
- enumerable: true,
7797
- configurable: true,
7798
- get: () => setupState[key],
7799
- set: NOOP
7800
- });
7801
7472
  });
7802
7473
  }
7803
7474
 
@@ -8541,11 +8212,18 @@ function flushJobs(seen) {
8541
8212
  // 2. If a component is unmounted during a parent component's update,
8542
8213
  // its update can be skipped.
8543
8214
  queue.sort((a, b) => getId(a) - getId(b));
8215
+ // conditional usage of checkRecursiveUpdate must be determined out of
8216
+ // try ... catch block since Rollup by default de-optimizes treeshaking
8217
+ // inside try-catch. This can leave all warning code unshaked. Although
8218
+ // they would get eventually shaken by a minifier like terser, some minifiers
8219
+ // would fail to do that (e.g. https://github.com/evanw/esbuild/issues/1610)
8220
+ const check = (job) => checkRecursiveUpdates(seen, job)
8221
+ ;
8544
8222
  try {
8545
8223
  for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
8546
8224
  const job = queue[flushIndex];
8547
8225
  if (job && job.active !== false) {
8548
- if (true && checkRecursiveUpdates(seen, job)) {
8226
+ if (true && check(job)) {
8549
8227
  continue;
8550
8228
  }
8551
8229
  // console.log(`running:`, job.id)
@@ -9225,7 +8903,7 @@ function isMemoSame(cached, memo) {
9225
8903
  }
9226
8904
 
9227
8905
  // Core API ------------------------------------------------------------------
9228
- const version = "3.2.11";
8906
+ const version = "3.2.12";
9229
8907
  /**
9230
8908
  * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
9231
8909
  * @internal
@@ -9707,6 +9385,7 @@ class VueElement extends BaseClass {
9707
9385
  this._instance = null;
9708
9386
  this._connected = false;
9709
9387
  this._resolved = false;
9388
+ this._numberProps = null;
9710
9389
  if (this.shadowRoot && hydrate) {
9711
9390
  hydrate(this._createVNode(), this.shadowRoot);
9712
9391
  }
@@ -9722,18 +9401,17 @@ class VueElement extends BaseClass {
9722
9401
  this._setAttr(this.attributes[i].name);
9723
9402
  }
9724
9403
  // watch future attr changes
9725
- const observer = new MutationObserver(mutations => {
9404
+ new MutationObserver(mutations => {
9726
9405
  for (const m of mutations) {
9727
9406
  this._setAttr(m.attributeName);
9728
9407
  }
9729
- });
9730
- observer.observe(this, { attributes: true });
9408
+ }).observe(this, { attributes: true });
9731
9409
  }
9732
9410
  connectedCallback() {
9733
9411
  this._connected = true;
9734
9412
  if (!this._instance) {
9735
9413
  this._resolveDef();
9736
- render(this._createVNode(), this.shadowRoot);
9414
+ this._update();
9737
9415
  }
9738
9416
  }
9739
9417
  disconnectedCallback() {
@@ -9754,15 +9432,31 @@ class VueElement extends BaseClass {
9754
9432
  }
9755
9433
  const resolve = (def) => {
9756
9434
  this._resolved = true;
9435
+ const { props, styles } = def;
9436
+ const hasOptions = !isArray(props);
9437
+ const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
9438
+ // cast Number-type props set before resolve
9439
+ let numberProps;
9440
+ if (hasOptions) {
9441
+ for (const key in this._props) {
9442
+ const opt = props[key];
9443
+ if (opt === Number || (opt && opt.type === Number)) {
9444
+ this._props[key] = toNumber(this._props[key]);
9445
+ (numberProps || (numberProps = Object.create(null)))[key] = true;
9446
+ }
9447
+ }
9448
+ }
9449
+ if (numberProps) {
9450
+ this._numberProps = numberProps;
9451
+ this._update();
9452
+ }
9757
9453
  // check if there are props set pre-upgrade or connect
9758
9454
  for (const key of Object.keys(this)) {
9759
9455
  if (key[0] !== '_') {
9760
9456
  this._setProp(key, this[key]);
9761
9457
  }
9762
9458
  }
9763
- const { props, styles } = def;
9764
9459
  // defining getter/setters on prototype
9765
- const rawKeys = props ? (isArray(props) ? props : Object.keys(props)) : [];
9766
9460
  for (const key of rawKeys.map(camelize)) {
9767
9461
  Object.defineProperty(this, key, {
9768
9462
  get() {
@@ -9784,7 +9478,11 @@ class VueElement extends BaseClass {
9784
9478
  }
9785
9479
  }
9786
9480
  _setAttr(key) {
9787
- this._setProp(camelize(key), toNumber(this.getAttribute(key)), false);
9481
+ let value = this.getAttribute(key);
9482
+ if (this._numberProps && this._numberProps[key]) {
9483
+ value = toNumber(value);
9484
+ }
9485
+ this._setProp(camelize(key), value, false);
9788
9486
  }
9789
9487
  /**
9790
9488
  * @internal
@@ -9799,7 +9497,7 @@ class VueElement extends BaseClass {
9799
9497
  if (val !== this._props[key]) {
9800
9498
  this._props[key] = val;
9801
9499
  if (this._instance) {
9802
- render(this._createVNode(), this.shadowRoot);
9500
+ this._update();
9803
9501
  }
9804
9502
  // reflect
9805
9503
  if (shouldReflect) {
@@ -9815,6 +9513,9 @@ class VueElement extends BaseClass {
9815
9513
  }
9816
9514
  }
9817
9515
  }
9516
+ _update() {
9517
+ render(this._createVNode(), this.shadowRoot);
9518
+ }
9818
9519
  _createVNode() {
9819
9520
  const vnode = createVNode(this._def, extend({}, this._props));
9820
9521
  if (!this._instance) {
@@ -9835,7 +9536,7 @@ class VueElement extends BaseClass {
9835
9536
  if (!this._def.__asyncLoader) {
9836
9537
  // reload
9837
9538
  this._instance = null;
9838
- render(this._createVNode(), this.shadowRoot);
9539
+ this._update();
9839
9540
  }
9840
9541
  };
9841
9542
  }