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.
@@ -1687,335 +1687,6 @@ function devtoolsComponentEmit(component, event, params) {
1687
1687
  devtools.emit("component:emit" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);
1688
1688
  }
1689
1689
 
1690
- const deprecationData = {
1691
- ["GLOBAL_MOUNT" /* GLOBAL_MOUNT */]: {
1692
- message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
1693
- `option have been removed. Use createApp(RootComponent).mount() instead.`,
1694
- link: `https://v3.vuejs.org/guide/migration/global-api.html#mounting-app-instance`
1695
- },
1696
- ["GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */]: {
1697
- message: `Vue detected directives on the mount container. ` +
1698
- `In Vue 3, the container is no longer considered part of the template ` +
1699
- `and will not be processed/replaced.`,
1700
- link: `https://v3.vuejs.org/guide/migration/mount-changes.html`
1701
- },
1702
- ["GLOBAL_EXTEND" /* GLOBAL_EXTEND */]: {
1703
- message: `Vue.extend() has been removed in Vue 3. ` +
1704
- `Use defineComponent() instead.`,
1705
- link: `https://v3.vuejs.org/api/global-api.html#definecomponent`
1706
- },
1707
- ["GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */]: {
1708
- message: `Vue.prototype is no longer available in Vue 3. ` +
1709
- `Use app.config.globalProperties instead.`,
1710
- link: `https://v3.vuejs.org/guide/migration/global-api.html#vue-prototype-replaced-by-config-globalproperties`
1711
- },
1712
- ["GLOBAL_SET" /* GLOBAL_SET */]: {
1713
- message: `Vue.set() has been removed as it is no longer needed in Vue 3. ` +
1714
- `Simply use native JavaScript mutations.`
1715
- },
1716
- ["GLOBAL_DELETE" /* GLOBAL_DELETE */]: {
1717
- message: `Vue.delete() has been removed as it is no longer needed in Vue 3. ` +
1718
- `Simply use native JavaScript mutations.`
1719
- },
1720
- ["GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */]: {
1721
- message: `Vue.observable() has been removed. ` +
1722
- `Use \`import { reactive } from "vue"\` from Composition API instead.`,
1723
- link: `https://v3.vuejs.org/api/basic-reactivity.html`
1724
- },
1725
- ["GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */]: {
1726
- message: `Vue.util has been removed. Please refactor to avoid its usage ` +
1727
- `since it was an internal API even in Vue 2.`
1728
- },
1729
- ["CONFIG_SILENT" /* CONFIG_SILENT */]: {
1730
- message: `config.silent has been removed because it is not good practice to ` +
1731
- `intentionally suppress warnings. You can use your browser console's ` +
1732
- `filter features to focus on relevant messages.`
1733
- },
1734
- ["CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */]: {
1735
- message: `config.devtools has been removed. To enable devtools for ` +
1736
- `production, configure the __VUE_PROD_DEVTOOLS__ compile-time flag.`,
1737
- link: `https://github.com/vuejs/vue-next/tree/master/packages/vue#bundler-build-feature-flags`
1738
- },
1739
- ["CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */]: {
1740
- message: `config.keyCodes has been removed. ` +
1741
- `In Vue 3, you can directly use the kebab-case key names as v-on modifiers.`,
1742
- link: `https://v3.vuejs.org/guide/migration/keycode-modifiers.html`
1743
- },
1744
- ["CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */]: {
1745
- message: `config.productionTip has been removed.`,
1746
- link: `https://v3.vuejs.org/guide/migration/global-api.html#config-productiontip-removed`
1747
- },
1748
- ["CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */]: {
1749
- message: () => {
1750
- let msg = `config.ignoredElements has been removed.`;
1751
- if (isRuntimeOnly()) {
1752
- msg += ` Pass the "isCustomElement" option to @vue/compiler-dom instead.`;
1753
- }
1754
- else {
1755
- msg += ` Use config.isCustomElement instead.`;
1756
- }
1757
- return msg;
1758
- },
1759
- link: `https://v3.vuejs.org/guide/migration/global-api.html#config-ignoredelements-is-now-config-iscustomelement`
1760
- },
1761
- ["CONFIG_WHITESPACE" /* CONFIG_WHITESPACE */]: {
1762
- // this warning is only relevant in the full build when using runtime
1763
- // compilation, so it's put in the runtime compatConfig list.
1764
- message: `Vue 3 compiler's whitespace option will default to "condense" instead of ` +
1765
- `"preserve". To suppress this warning, provide an explicit value for ` +
1766
- `\`config.compilerOptions.whitespace\`.`
1767
- },
1768
- ["CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */]: {
1769
- message: `config.optionMergeStrategies no longer exposes internal strategies. ` +
1770
- `Use custom merge functions instead.`
1771
- },
1772
- ["INSTANCE_SET" /* INSTANCE_SET */]: {
1773
- message: `vm.$set() has been removed as it is no longer needed in Vue 3. ` +
1774
- `Simply use native JavaScript mutations.`
1775
- },
1776
- ["INSTANCE_DELETE" /* INSTANCE_DELETE */]: {
1777
- message: `vm.$delete() has been removed as it is no longer needed in Vue 3. ` +
1778
- `Simply use native JavaScript mutations.`
1779
- },
1780
- ["INSTANCE_DESTROY" /* INSTANCE_DESTROY */]: {
1781
- message: `vm.$destroy() has been removed. Use app.unmount() instead.`,
1782
- link: `https://v3.vuejs.org/api/application-api.html#unmount`
1783
- },
1784
- ["INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */]: {
1785
- message: `vm.$on/$once/$off() have been removed. ` +
1786
- `Use an external event emitter library instead.`,
1787
- link: `https://v3.vuejs.org/guide/migration/events-api.html`
1788
- },
1789
- ["INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */]: {
1790
- message: event => `"${event}" lifecycle events are no longer supported. From templates, ` +
1791
- `use the "vnode" prefix instead of "hook:". For example, @${event} ` +
1792
- `should be changed to @vnode-${event.slice(5)}. ` +
1793
- `From JavaScript, use Composition API to dynamically register lifecycle ` +
1794
- `hooks.`,
1795
- link: `https://v3.vuejs.org/guide/migration/vnode-lifecycle-events.html`
1796
- },
1797
- ["INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */]: {
1798
- message: `vm.$children has been removed. Consider refactoring your logic ` +
1799
- `to avoid relying on direct access to child components.`,
1800
- link: `https://v3.vuejs.org/guide/migration/children.html`
1801
- },
1802
- ["INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */]: {
1803
- message: `vm.$listeners has been removed. In Vue 3, parent v-on listeners are ` +
1804
- `included in vm.$attrs and it is no longer necessary to separately use ` +
1805
- `v-on="$listeners" if you are already using v-bind="$attrs". ` +
1806
- `(Note: the Vue 3 behavior only applies if this compat config is disabled)`,
1807
- link: `https://v3.vuejs.org/guide/migration/listeners-removed.html`
1808
- },
1809
- ["INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */]: {
1810
- message: `vm.$scopedSlots has been removed. Use vm.$slots instead.`,
1811
- link: `https://v3.vuejs.org/guide/migration/slots-unification.html`
1812
- },
1813
- ["INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */]: {
1814
- message: componentName => `Component <${componentName || 'Anonymous'}> has \`inheritAttrs: false\` but is ` +
1815
- `relying on class/style fallthrough from parent. In Vue 3, class/style ` +
1816
- `are now included in $attrs and will no longer fallthrough when ` +
1817
- `inheritAttrs is false. If you are already using v-bind="$attrs" on ` +
1818
- `component root it should render the same end result. ` +
1819
- `If you are binding $attrs to a non-root element and expecting ` +
1820
- `class/style to fallthrough on root, you will need to now manually bind ` +
1821
- `them on root via :class="$attrs.class".`,
1822
- link: `https://v3.vuejs.org/guide/migration/attrs-includes-class-style.html`
1823
- },
1824
- ["OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */]: {
1825
- message: `The "data" option can no longer be a plain object. ` +
1826
- `Always use a function.`,
1827
- link: `https://v3.vuejs.org/guide/migration/data-option.html`
1828
- },
1829
- ["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */]: {
1830
- message: (key) => `Detected conflicting key "${key}" when merging data option values. ` +
1831
- `In Vue 3, data keys are merged shallowly and will override one another.`,
1832
- link: `https://v3.vuejs.org/guide/migration/data-option.html#mixin-merge-behavior-change`
1833
- },
1834
- ["OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */]: {
1835
- message: `\`beforeDestroy\` has been renamed to \`beforeUnmount\`.`
1836
- },
1837
- ["OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */]: {
1838
- message: `\`destroyed\` has been renamed to \`unmounted\`.`
1839
- },
1840
- ["WATCH_ARRAY" /* WATCH_ARRAY */]: {
1841
- message: `"watch" option or vm.$watch on an array value will no longer ` +
1842
- `trigger on array mutation unless the "deep" option is specified. ` +
1843
- `If current usage is intended, you can disable the compat behavior and ` +
1844
- `suppress this warning with:` +
1845
- `\n\n configureCompat({ ${"WATCH_ARRAY" /* WATCH_ARRAY */}: false })\n`,
1846
- link: `https://v3.vuejs.org/guide/migration/watch.html`
1847
- },
1848
- ["PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */]: {
1849
- message: (key) => `props default value function no longer has access to "this". The compat ` +
1850
- `build only offers access to this.$options.` +
1851
- `(found in prop "${key}")`,
1852
- link: `https://v3.vuejs.org/guide/migration/props-default-this.html`
1853
- },
1854
- ["CUSTOM_DIR" /* CUSTOM_DIR */]: {
1855
- message: (legacyHook, newHook) => `Custom directive hook "${legacyHook}" has been removed. ` +
1856
- `Use "${newHook}" instead.`,
1857
- link: `https://v3.vuejs.org/guide/migration/custom-directives.html`
1858
- },
1859
- ["V_FOR_REF" /* V_FOR_REF */]: {
1860
- message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +
1861
- `Consider using function refs or refactor to avoid ref usage altogether.`,
1862
- link: `https://v3.vuejs.org/guide/migration/array-refs.html`
1863
- },
1864
- ["V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */]: {
1865
- message: `Using keyCode as v-on modifier is no longer supported. ` +
1866
- `Use kebab-case key name modifiers instead.`,
1867
- link: `https://v3.vuejs.org/guide/migration/keycode-modifiers.html`
1868
- },
1869
- ["ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */]: {
1870
- message: (name) => `Attribute "${name}" with v-bind value \`false\` will render ` +
1871
- `${name}="false" instead of removing it in Vue 3. To remove the attribute, ` +
1872
- `use \`null\` or \`undefined\` instead. If the usage is intended, ` +
1873
- `you can disable the compat behavior and suppress this warning with:` +
1874
- `\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */}: false })\n`,
1875
- link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`
1876
- },
1877
- ["ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */]: {
1878
- message: (name, value, coerced) => `Enumerated attribute "${name}" with v-bind value \`${value}\` will ` +
1879
- `${value === null ? `be removed` : `render the value as-is`} instead of coercing the value to "${coerced}" in Vue 3. ` +
1880
- `Always use explicit "true" or "false" values for enumerated attributes. ` +
1881
- `If the usage is intended, ` +
1882
- `you can disable the compat behavior and suppress this warning with:` +
1883
- `\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */}: false })\n`,
1884
- link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`
1885
- },
1886
- ["TRANSITION_CLASSES" /* TRANSITION_CLASSES */]: {
1887
- message: `` // this feature cannot be runtime-detected
1888
- },
1889
- ["TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */]: {
1890
- message: `<TransitionGroup> no longer renders a root <span> element by ` +
1891
- `default if no "tag" prop is specified. If you do not rely on the span ` +
1892
- `for styling, you can disable the compat behavior and suppress this ` +
1893
- `warning with:` +
1894
- `\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */}: false })\n`,
1895
- link: `https://v3.vuejs.org/guide/migration/transition-group.html`
1896
- },
1897
- ["COMPONENT_ASYNC" /* COMPONENT_ASYNC */]: {
1898
- message: (comp) => {
1899
- const name = getComponentName(comp);
1900
- return (`Async component${name ? ` <${name}>` : `s`} should be explicitly created via \`defineAsyncComponent()\` ` +
1901
- `in Vue 3. Plain functions will be treated as functional components in ` +
1902
- `non-compat build. If you have already migrated all async component ` +
1903
- `usage and intend to use plain functions for functional components, ` +
1904
- `you can disable the compat behavior and suppress this ` +
1905
- `warning with:` +
1906
- `\n\n configureCompat({ ${"COMPONENT_ASYNC" /* COMPONENT_ASYNC */}: false })\n`);
1907
- },
1908
- link: `https://v3.vuejs.org/guide/migration/async-components.html`
1909
- },
1910
- ["COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */]: {
1911
- message: (comp) => {
1912
- const name = getComponentName(comp);
1913
- return (`Functional component${name ? ` <${name}>` : `s`} should be defined as a plain function in Vue 3. The "functional" ` +
1914
- `option has been removed. NOTE: Before migrating to use plain ` +
1915
- `functions for functional components, first make sure that all async ` +
1916
- `components usage have been migrated and its compat behavior has ` +
1917
- `been disabled.`);
1918
- },
1919
- link: `https://v3.vuejs.org/guide/migration/functional-components.html`
1920
- },
1921
- ["COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */]: {
1922
- message: (comp) => {
1923
- const configMsg = `opt-in to ` +
1924
- `Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */}: false }\`.`;
1925
- if (comp.props &&
1926
- (isArray(comp.props)
1927
- ? comp.props.includes('modelValue')
1928
- : hasOwn(comp.props, 'modelValue'))) {
1929
- return (`Component delcares "modelValue" prop, which is Vue 3 usage, but ` +
1930
- `is running under Vue 2 compat v-model behavior. You can ${configMsg}`);
1931
- }
1932
- return (`v-model usage on component has changed in Vue 3. Component that expects ` +
1933
- `to work with v-model should now use the "modelValue" prop and emit the ` +
1934
- `"update:modelValue" event. You can update the usage and then ${configMsg}`);
1935
- },
1936
- link: `https://v3.vuejs.org/guide/migration/v-model.html`
1937
- },
1938
- ["RENDER_FUNCTION" /* RENDER_FUNCTION */]: {
1939
- message: `Vue 3's render function API has changed. ` +
1940
- `You can opt-in to the new API with:` +
1941
- `\n\n configureCompat({ ${"RENDER_FUNCTION" /* RENDER_FUNCTION */}: false })\n` +
1942
- `\n (This can also be done per-component via the "compatConfig" option.)`,
1943
- link: `https://v3.vuejs.org/guide/migration/render-function-api.html`
1944
- },
1945
- ["FILTERS" /* FILTERS */]: {
1946
- message: `filters have been removed in Vue 3. ` +
1947
- `The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
1948
- `Use method calls or computed properties instead.`,
1949
- link: `https://v3.vuejs.org/guide/migration/filters.html`
1950
- },
1951
- ["PRIVATE_APIS" /* PRIVATE_APIS */]: {
1952
- message: name => `"${name}" is a Vue 2 private API that no longer exists in Vue 3. ` +
1953
- `If you are seeing this warning only due to a dependency, you can ` +
1954
- `suppress this warning via { PRIVATE_APIS: 'supress-warning' }.`
1955
- }
1956
- };
1957
- const instanceWarned = Object.create(null);
1958
- const warnCount = Object.create(null);
1959
- function warnDeprecation(key, instance, ...args) {
1960
- instance = instance || getCurrentInstance();
1961
- // check user config
1962
- const config = getCompatConfigForKey(key, instance);
1963
- if (config === 'suppress-warning') {
1964
- return;
1965
- }
1966
- const dupKey = key + args.join('');
1967
- let compId = instance && formatComponentName(instance, instance.type);
1968
- if (compId === 'Anonymous' && instance) {
1969
- compId = instance.uid;
1970
- }
1971
- // skip if the same warning is emitted for the same component type
1972
- const componentDupKey = dupKey + compId;
1973
- if (componentDupKey in instanceWarned) {
1974
- return;
1975
- }
1976
- instanceWarned[componentDupKey] = true;
1977
- // same warning, but different component. skip the long message and just
1978
- // log the key and count.
1979
- if (dupKey in warnCount) {
1980
- warn$1(`(deprecation ${key}) (${++warnCount[dupKey] + 1})`);
1981
- return;
1982
- }
1983
- warnCount[dupKey] = 0;
1984
- const { message, link } = deprecationData[key];
1985
- warn$1(`(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`);
1986
- if (!isCompatEnabled(key, instance, true)) {
1987
- console.error(`^ The above deprecation's compat behavior is disabled and will likely ` +
1988
- `lead to runtime errors.`);
1989
- }
1990
- }
1991
- const globalCompatConfig = {
1992
- MODE: 2
1993
- };
1994
- function getCompatConfigForKey(key, instance) {
1995
- const instanceConfig = instance && instance.type.compatConfig;
1996
- if (instanceConfig && key in instanceConfig) {
1997
- return instanceConfig[key];
1998
- }
1999
- return globalCompatConfig[key];
2000
- }
2001
- function isCompatEnabled(key, instance, enableForBuiltIn = false) {
2002
- // skip compat for built-in components
2003
- if (!enableForBuiltIn && instance && instance.type.__isBuiltIn) {
2004
- return false;
2005
- }
2006
- const rawMode = getCompatConfigForKey('MODE', instance) || 2;
2007
- const val = getCompatConfigForKey(key, instance);
2008
- const mode = isFunction(rawMode)
2009
- ? rawMode(instance && instance.type)
2010
- : rawMode;
2011
- if (mode === 2) {
2012
- return val !== false;
2013
- }
2014
- else {
2015
- return val === true || val === 'suppress-warning';
2016
- }
2017
- }
2018
-
2019
1690
  function emit(instance, event, ...rawArgs) {
2020
1691
  const props = instance.vnode.props || EMPTY_OBJ;
2021
1692
  {
@@ -2241,12 +1912,12 @@ function markAttrsAccessed() {
2241
1912
  function renderComponentRoot(instance) {
2242
1913
  const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx, inheritAttrs } = instance;
2243
1914
  let result;
1915
+ let fallthroughAttrs;
2244
1916
  const prev = setCurrentRenderingInstance(instance);
2245
1917
  {
2246
1918
  accessedAttrs = false;
2247
1919
  }
2248
1920
  try {
2249
- let fallthroughAttrs;
2250
1921
  if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
2251
1922
  // withProxy is a proxy with a different `has` trap only for
2252
1923
  // runtime-compiled render functions using `with` block.
@@ -2277,97 +1948,91 @@ function renderComponentRoot(instance) {
2277
1948
  ? attrs
2278
1949
  : getFunctionalFallthrough(attrs);
2279
1950
  }
2280
- // attr merging
2281
- // in dev mode, comments are preserved, and it's possible for a template
2282
- // to have comments along side the root element which makes it a fragment
2283
- let root = result;
2284
- let setRoot = undefined;
2285
- if (true &&
2286
- result.patchFlag > 0 &&
2287
- result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
2288
- ;
2289
- [root, setRoot] = getChildRoot(result);
2290
- }
2291
- if (fallthroughAttrs && inheritAttrs !== false) {
2292
- const keys = Object.keys(fallthroughAttrs);
2293
- const { shapeFlag } = root;
2294
- if (keys.length) {
2295
- if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2296
- if (propsOptions && keys.some(isModelListener)) {
2297
- // If a v-model listener (onUpdate:xxx) has a corresponding declared
2298
- // prop, it indicates this component expects to handle v-model and
2299
- // it should not fallthrough.
2300
- // related: #1543, #1643, #1989
2301
- fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
2302
- }
2303
- root = cloneVNode(root, fallthroughAttrs);
2304
- }
2305
- else if (true && !accessedAttrs && root.type !== Comment) {
2306
- const allAttrs = Object.keys(attrs);
2307
- const eventAttrs = [];
2308
- const extraAttrs = [];
2309
- for (let i = 0, l = allAttrs.length; i < l; i++) {
2310
- const key = allAttrs[i];
2311
- if (isOn(key)) {
2312
- // ignore v-model handlers when they fail to fallthrough
2313
- if (!isModelListener(key)) {
2314
- // remove `on`, lowercase first letter to reflect event casing
2315
- // accurately
2316
- eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2317
- }
2318
- }
2319
- else {
2320
- extraAttrs.push(key);
1951
+ }
1952
+ catch (err) {
1953
+ blockStack.length = 0;
1954
+ handleError(err, instance, 1 /* RENDER_FUNCTION */);
1955
+ result = createVNode(Comment);
1956
+ }
1957
+ // attr merging
1958
+ // in dev mode, comments are preserved, and it's possible for a template
1959
+ // to have comments along side the root element which makes it a fragment
1960
+ let root = result;
1961
+ let setRoot = undefined;
1962
+ if (result.patchFlag > 0 &&
1963
+ result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
1964
+ [root, setRoot] = getChildRoot(result);
1965
+ }
1966
+ if (fallthroughAttrs && inheritAttrs !== false) {
1967
+ const keys = Object.keys(fallthroughAttrs);
1968
+ const { shapeFlag } = root;
1969
+ if (keys.length) {
1970
+ if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
1971
+ if (propsOptions && keys.some(isModelListener)) {
1972
+ // If a v-model listener (onUpdate:xxx) has a corresponding declared
1973
+ // prop, it indicates this component expects to handle v-model and
1974
+ // it should not fallthrough.
1975
+ // related: #1543, #1643, #1989
1976
+ fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
1977
+ }
1978
+ root = cloneVNode(root, fallthroughAttrs);
1979
+ }
1980
+ else if (!accessedAttrs && root.type !== Comment) {
1981
+ const allAttrs = Object.keys(attrs);
1982
+ const eventAttrs = [];
1983
+ const extraAttrs = [];
1984
+ for (let i = 0, l = allAttrs.length; i < l; i++) {
1985
+ const key = allAttrs[i];
1986
+ if (isOn(key)) {
1987
+ // ignore v-model handlers when they fail to fallthrough
1988
+ if (!isModelListener(key)) {
1989
+ // remove `on`, lowercase first letter to reflect event casing
1990
+ // accurately
1991
+ eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2321
1992
  }
2322
1993
  }
2323
- if (extraAttrs.length) {
2324
- warn$1(`Extraneous non-props attributes (` +
2325
- `${extraAttrs.join(', ')}) ` +
2326
- `were passed to component but could not be automatically inherited ` +
2327
- `because component renders fragment or text root nodes.`);
2328
- }
2329
- if (eventAttrs.length) {
2330
- warn$1(`Extraneous non-emits event listeners (` +
2331
- `${eventAttrs.join(', ')}) ` +
2332
- `were passed to component but could not be automatically inherited ` +
2333
- `because component renders fragment or text root nodes. ` +
2334
- `If the listener is intended to be a component custom event listener only, ` +
2335
- `declare it using the "emits" option.`);
1994
+ else {
1995
+ extraAttrs.push(key);
2336
1996
  }
2337
1997
  }
1998
+ if (extraAttrs.length) {
1999
+ warn$1(`Extraneous non-props attributes (` +
2000
+ `${extraAttrs.join(', ')}) ` +
2001
+ `were passed to component but could not be automatically inherited ` +
2002
+ `because component renders fragment or text root nodes.`);
2003
+ }
2004
+ if (eventAttrs.length) {
2005
+ warn$1(`Extraneous non-emits event listeners (` +
2006
+ `${eventAttrs.join(', ')}) ` +
2007
+ `were passed to component but could not be automatically inherited ` +
2008
+ `because component renders fragment or text root nodes. ` +
2009
+ `If the listener is intended to be a component custom event listener only, ` +
2010
+ `declare it using the "emits" option.`);
2011
+ }
2338
2012
  }
2339
2013
  }
2340
- if (false &&
2341
- isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
2342
- vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&
2343
- root.shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) ;
2344
- // inherit directives
2345
- if (vnode.dirs) {
2346
- if (true && !isElementRoot(root)) {
2347
- warn$1(`Runtime directive used on component with non-element root node. ` +
2348
- `The directives will not function as intended.`);
2349
- }
2350
- root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2351
- }
2352
- // inherit transition data
2353
- if (vnode.transition) {
2354
- if (true && !isElementRoot(root)) {
2355
- warn$1(`Component inside <Transition> renders non-element root node ` +
2356
- `that cannot be animated.`);
2357
- }
2358
- root.transition = vnode.transition;
2359
- }
2360
- if (true && setRoot) {
2361
- setRoot(root);
2014
+ }
2015
+ // inherit directives
2016
+ if (vnode.dirs) {
2017
+ if (!isElementRoot(root)) {
2018
+ warn$1(`Runtime directive used on component with non-element root node. ` +
2019
+ `The directives will not function as intended.`);
2362
2020
  }
2363
- else {
2364
- result = root;
2021
+ root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2022
+ }
2023
+ // inherit transition data
2024
+ if (vnode.transition) {
2025
+ if (!isElementRoot(root)) {
2026
+ warn$1(`Component inside <Transition> renders non-element root node ` +
2027
+ `that cannot be animated.`);
2365
2028
  }
2029
+ root.transition = vnode.transition;
2366
2030
  }
2367
- catch (err) {
2368
- blockStack.length = 0;
2369
- handleError(err, instance, 1 /* RENDER_FUNCTION */);
2370
- result = createVNode(Comment);
2031
+ if (setRoot) {
2032
+ setRoot(root);
2033
+ }
2034
+ else {
2035
+ result = root;
2371
2036
  }
2372
2037
  setCurrentRenderingInstance(prev);
2373
2038
  return result;
@@ -2902,8 +2567,8 @@ function normalizeSuspenseChildren(vnode) {
2902
2567
  function normalizeSuspenseSlot(s) {
2903
2568
  let block;
2904
2569
  if (isFunction(s)) {
2905
- const isCompiledSlot = s._c;
2906
- if (isCompiledSlot) {
2570
+ const trackBlock = isBlockTreeEnabled && s._c;
2571
+ if (trackBlock) {
2907
2572
  // disableTracking: false
2908
2573
  // allow block tracking for compiled slots
2909
2574
  // (see ./componentRenderContext.ts)
@@ -2911,7 +2576,7 @@ function normalizeSuspenseSlot(s) {
2911
2576
  openBlock();
2912
2577
  }
2913
2578
  s = s();
2914
- if (isCompiledSlot) {
2579
+ if (trackBlock) {
2915
2580
  s._d = true;
2916
2581
  block = currentBlock;
2917
2582
  closeBlock();
@@ -7007,7 +6672,11 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
7007
6672
  return Component;
7008
6673
  }
7009
6674
  if (warnMissing && !res) {
7010
- warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}`);
6675
+ const extra = type === COMPONENTS
6676
+ ? `\nIf this is a native custom element, make sure to exclude it from ` +
6677
+ `component resolution via compilerOptions.isCustomElement.`
6678
+ : ``;
6679
+ warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
7011
6680
  }
7012
6681
  return res;
7013
6682
  }
@@ -7862,17 +7531,19 @@ function exposePropsOnRenderContext(instance) {
7862
7531
  function exposeSetupStateOnRenderContext(instance) {
7863
7532
  const { ctx, setupState } = instance;
7864
7533
  Object.keys(toRaw(setupState)).forEach(key => {
7865
- if (!setupState.__isScriptSetup && (key[0] === '$' || key[0] === '_')) {
7866
- warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
7867
- `which are reserved prefixes for Vue internals.`);
7868
- return;
7534
+ if (!setupState.__isScriptSetup) {
7535
+ if (key[0] === '$' || key[0] === '_') {
7536
+ warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
7537
+ `which are reserved prefixes for Vue internals.`);
7538
+ return;
7539
+ }
7540
+ Object.defineProperty(ctx, key, {
7541
+ enumerable: true,
7542
+ configurable: true,
7543
+ get: () => setupState[key],
7544
+ set: NOOP
7545
+ });
7869
7546
  }
7870
- Object.defineProperty(ctx, key, {
7871
- enumerable: true,
7872
- configurable: true,
7873
- get: () => setupState[key],
7874
- set: NOOP
7875
- });
7876
7547
  });
7877
7548
  }
7878
7549
 
@@ -8616,11 +8287,18 @@ function flushJobs(seen) {
8616
8287
  // 2. If a component is unmounted during a parent component's update,
8617
8288
  // its update can be skipped.
8618
8289
  queue.sort((a, b) => getId(a) - getId(b));
8290
+ // conditional usage of checkRecursiveUpdate must be determined out of
8291
+ // try ... catch block since Rollup by default de-optimizes treeshaking
8292
+ // inside try-catch. This can leave all warning code unshaked. Although
8293
+ // they would get eventually shaken by a minifier like terser, some minifiers
8294
+ // would fail to do that (e.g. https://github.com/evanw/esbuild/issues/1610)
8295
+ const check = (job) => checkRecursiveUpdates(seen, job)
8296
+ ;
8619
8297
  try {
8620
8298
  for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
8621
8299
  const job = queue[flushIndex];
8622
8300
  if (job && job.active !== false) {
8623
- if (true && checkRecursiveUpdates(seen, job)) {
8301
+ if (true && check(job)) {
8624
8302
  continue;
8625
8303
  }
8626
8304
  // console.log(`running:`, job.id)
@@ -9300,7 +8978,7 @@ function isMemoSame(cached, memo) {
9300
8978
  }
9301
8979
 
9302
8980
  // Core API ------------------------------------------------------------------
9303
- const version = "3.2.11";
8981
+ const version = "3.2.12";
9304
8982
  /**
9305
8983
  * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
9306
8984
  * @internal
@@ -9782,6 +9460,7 @@ class VueElement extends BaseClass {
9782
9460
  this._instance = null;
9783
9461
  this._connected = false;
9784
9462
  this._resolved = false;
9463
+ this._numberProps = null;
9785
9464
  if (this.shadowRoot && hydrate) {
9786
9465
  hydrate(this._createVNode(), this.shadowRoot);
9787
9466
  }
@@ -9797,18 +9476,17 @@ class VueElement extends BaseClass {
9797
9476
  this._setAttr(this.attributes[i].name);
9798
9477
  }
9799
9478
  // watch future attr changes
9800
- const observer = new MutationObserver(mutations => {
9479
+ new MutationObserver(mutations => {
9801
9480
  for (const m of mutations) {
9802
9481
  this._setAttr(m.attributeName);
9803
9482
  }
9804
- });
9805
- observer.observe(this, { attributes: true });
9483
+ }).observe(this, { attributes: true });
9806
9484
  }
9807
9485
  connectedCallback() {
9808
9486
  this._connected = true;
9809
9487
  if (!this._instance) {
9810
9488
  this._resolveDef();
9811
- render(this._createVNode(), this.shadowRoot);
9489
+ this._update();
9812
9490
  }
9813
9491
  }
9814
9492
  disconnectedCallback() {
@@ -9829,15 +9507,31 @@ class VueElement extends BaseClass {
9829
9507
  }
9830
9508
  const resolve = (def) => {
9831
9509
  this._resolved = true;
9510
+ const { props, styles } = def;
9511
+ const hasOptions = !isArray(props);
9512
+ const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
9513
+ // cast Number-type props set before resolve
9514
+ let numberProps;
9515
+ if (hasOptions) {
9516
+ for (const key in this._props) {
9517
+ const opt = props[key];
9518
+ if (opt === Number || (opt && opt.type === Number)) {
9519
+ this._props[key] = toNumber(this._props[key]);
9520
+ (numberProps || (numberProps = Object.create(null)))[key] = true;
9521
+ }
9522
+ }
9523
+ }
9524
+ if (numberProps) {
9525
+ this._numberProps = numberProps;
9526
+ this._update();
9527
+ }
9832
9528
  // check if there are props set pre-upgrade or connect
9833
9529
  for (const key of Object.keys(this)) {
9834
9530
  if (key[0] !== '_') {
9835
9531
  this._setProp(key, this[key]);
9836
9532
  }
9837
9533
  }
9838
- const { props, styles } = def;
9839
9534
  // defining getter/setters on prototype
9840
- const rawKeys = props ? (isArray(props) ? props : Object.keys(props)) : [];
9841
9535
  for (const key of rawKeys.map(camelize)) {
9842
9536
  Object.defineProperty(this, key, {
9843
9537
  get() {
@@ -9859,7 +9553,11 @@ class VueElement extends BaseClass {
9859
9553
  }
9860
9554
  }
9861
9555
  _setAttr(key) {
9862
- this._setProp(camelize(key), toNumber(this.getAttribute(key)), false);
9556
+ let value = this.getAttribute(key);
9557
+ if (this._numberProps && this._numberProps[key]) {
9558
+ value = toNumber(value);
9559
+ }
9560
+ this._setProp(camelize(key), value, false);
9863
9561
  }
9864
9562
  /**
9865
9563
  * @internal
@@ -9874,7 +9572,7 @@ class VueElement extends BaseClass {
9874
9572
  if (val !== this._props[key]) {
9875
9573
  this._props[key] = val;
9876
9574
  if (this._instance) {
9877
- render(this._createVNode(), this.shadowRoot);
9575
+ this._update();
9878
9576
  }
9879
9577
  // reflect
9880
9578
  if (shouldReflect) {
@@ -9890,6 +9588,9 @@ class VueElement extends BaseClass {
9890
9588
  }
9891
9589
  }
9892
9590
  }
9591
+ _update() {
9592
+ render(this._createVNode(), this.shadowRoot);
9593
+ }
9893
9594
  _createVNode() {
9894
9595
  const vnode = createVNode(this._def, extend({}, this._props));
9895
9596
  if (!this._instance) {
@@ -9910,7 +9611,7 @@ class VueElement extends BaseClass {
9910
9611
  if (!this._def.__asyncLoader) {
9911
9612
  // reload
9912
9613
  this._instance = null;
9913
- render(this._createVNode(), this.shadowRoot);
9614
+ this._update();
9914
9615
  }
9915
9616
  };
9916
9617
  }
@@ -11674,7 +11375,7 @@ function makeBlock(node, { helper, removeHelper, inSSR }) {
11674
11375
  }
11675
11376
  }
11676
11377
 
11677
- const deprecationData$1 = {
11378
+ const deprecationData = {
11678
11379
  ["COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */]: {
11679
11380
  message: `Platform-native elements with "is" prop will no longer be ` +
11680
11381
  `treated as components in Vue 3 unless the "is" value is explicitly ` +
@@ -11743,7 +11444,7 @@ function getCompatValue(key, context) {
11743
11444
  return value;
11744
11445
  }
11745
11446
  }
11746
- function isCompatEnabled$1(key, context) {
11447
+ function isCompatEnabled(key, context) {
11747
11448
  const mode = getCompatValue('MODE', context);
11748
11449
  const value = getCompatValue(key, context);
11749
11450
  // in v3 mode, only enable if explicitly set to true
@@ -11751,18 +11452,18 @@ function isCompatEnabled$1(key, context) {
11751
11452
  return mode === 3 ? value === true : value !== false;
11752
11453
  }
11753
11454
  function checkCompatEnabled(key, context, loc, ...args) {
11754
- const enabled = isCompatEnabled$1(key, context);
11455
+ const enabled = isCompatEnabled(key, context);
11755
11456
  if (enabled) {
11756
- warnDeprecation$1(key, context, loc, ...args);
11457
+ warnDeprecation(key, context, loc, ...args);
11757
11458
  }
11758
11459
  return enabled;
11759
11460
  }
11760
- function warnDeprecation$1(key, context, loc, ...args) {
11461
+ function warnDeprecation(key, context, loc, ...args) {
11761
11462
  const val = getCompatValue(key, context);
11762
11463
  if (val === 'suppress-warning') {
11763
11464
  return;
11764
11465
  }
11765
- const { message, link } = deprecationData$1[key];
11466
+ const { message, link } = deprecationData[key];
11766
11467
  const msg = `(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`;
11767
11468
  const err = new SyntaxError(msg);
11768
11469
  err.code = key;
@@ -14994,7 +14695,7 @@ function processSlotOutlet(node, context) {
14994
14695
  };
14995
14696
  }
14996
14697
 
14997
- const fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^\s*function(?:\s+[\w$]+)?\s*\(/;
14698
+ const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
14998
14699
  const transformOn = (dir, node, context, augmentor) => {
14999
14700
  const { loc, modifiers, arg } = dir;
15000
14701
  if (!dir.exp && !modifiers.length) {