@vue/compat 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.
@@ -1,4 +1,4 @@
1
- var Vue = (function (exports) {
1
+ var Vue = (function () {
2
2
  'use strict';
3
3
 
4
4
  /**
@@ -1534,41 +1534,33 @@ var Vue = (function (exports) {
1534
1534
  const id = instance.type.__hmrId;
1535
1535
  let record = map.get(id);
1536
1536
  if (!record) {
1537
- createRecord(id, instance.type);
1537
+ createRecord(id);
1538
1538
  record = map.get(id);
1539
1539
  }
1540
- record.instances.add(instance);
1540
+ record.add(instance);
1541
1541
  }
1542
1542
  function unregisterHMR(instance) {
1543
- map.get(instance.type.__hmrId).instances.delete(instance);
1543
+ map.get(instance.type.__hmrId).delete(instance);
1544
1544
  }
1545
- function createRecord(id, component) {
1546
- if (!component) {
1547
- warn$1(`HMR API usage is out of date.\n` +
1548
- `Please upgrade vue-loader/vite/rollup-plugin-vue or other relevant ` +
1549
- `dependency that handles Vue SFC compilation.`);
1550
- component = {};
1551
- }
1545
+ function createRecord(id) {
1552
1546
  if (map.has(id)) {
1553
1547
  return false;
1554
1548
  }
1555
- map.set(id, {
1556
- component: isClassComponent(component) ? component.__vccOpts : component,
1557
- instances: new Set()
1558
- });
1549
+ map.set(id, new Set());
1559
1550
  return true;
1560
1551
  }
1552
+ function normalizeClassComponent(component) {
1553
+ return isClassComponent(component) ? component.__vccOpts : component;
1554
+ }
1561
1555
  function rerender(id, newRender) {
1562
1556
  const record = map.get(id);
1563
- if (!record)
1557
+ if (!record) {
1564
1558
  return;
1565
- if (newRender)
1566
- record.component.render = newRender;
1567
- // Array.from creates a snapshot which avoids the set being mutated during
1568
- // updates
1569
- Array.from(record.instances).forEach(instance => {
1559
+ }
1560
+ [...record].forEach(instance => {
1570
1561
  if (newRender) {
1571
1562
  instance.render = newRender;
1563
+ normalizeClassComponent(instance.type).render = newRender;
1572
1564
  }
1573
1565
  instance.renderCache = [];
1574
1566
  // this flag forces child components with slot content to update
@@ -1581,34 +1573,31 @@ var Vue = (function (exports) {
1581
1573
  const record = map.get(id);
1582
1574
  if (!record)
1583
1575
  return;
1584
- // Array.from creates a snapshot which avoids the set being mutated during
1585
- // updates
1586
- const { component, instances } = record;
1587
- if (!hmrDirtyComponents.has(component)) {
1588
- // 1. Update existing comp definition to match new one
1589
- newComp = isClassComponent(newComp) ? newComp.__vccOpts : newComp;
1590
- extend(component, newComp);
1591
- for (const key in component) {
1592
- if (key !== '__file' && !(key in newComp)) {
1593
- delete component[key];
1594
- }
1595
- }
1596
- // 2. Mark component dirty. This forces the renderer to replace the component
1597
- // on patch.
1598
- hmrDirtyComponents.add(component);
1599
- // 3. Make sure to unmark the component after the reload.
1600
- queuePostFlushCb(() => {
1601
- hmrDirtyComponents.delete(component);
1602
- });
1603
- }
1604
- Array.from(instances).forEach(instance => {
1605
- // invalidate options resolution cache
1576
+ newComp = normalizeClassComponent(newComp);
1577
+ // create a snapshot which avoids the set being mutated during updates
1578
+ const instances = [...record];
1579
+ for (const instance of instances) {
1580
+ const oldComp = normalizeClassComponent(instance.type);
1581
+ if (!hmrDirtyComponents.has(oldComp)) {
1582
+ // 1. Update existing comp definition to match new one
1583
+ extend(oldComp, newComp);
1584
+ for (const key in oldComp) {
1585
+ if (key !== '__file' && !(key in newComp)) {
1586
+ delete oldComp[key];
1587
+ }
1588
+ }
1589
+ // 2. mark definition dirty. This forces the renderer to replace the
1590
+ // component on patch.
1591
+ hmrDirtyComponents.add(oldComp);
1592
+ }
1593
+ // 3. invalidate options resolution cache
1606
1594
  instance.appContext.optionsCache.delete(instance.type);
1595
+ // 4. actually update
1607
1596
  if (instance.ceReload) {
1608
1597
  // custom element
1609
- hmrDirtyComponents.add(component);
1598
+ hmrDirtyComponents.add(oldComp);
1610
1599
  instance.ceReload(newComp.styles);
1611
- hmrDirtyComponents.delete(component);
1600
+ hmrDirtyComponents.delete(oldComp);
1612
1601
  }
1613
1602
  else if (instance.parent) {
1614
1603
  // 4. Force the parent instance to re-render. This will cause all updated
@@ -1633,6 +1622,12 @@ var Vue = (function (exports) {
1633
1622
  else {
1634
1623
  console.warn('[HMR] Root or manually mounted instance modified. Full reload required.');
1635
1624
  }
1625
+ }
1626
+ // 5. make sure to cleanup dirty hmr components after update
1627
+ queuePostFlushCb(() => {
1628
+ for (const instance of instances) {
1629
+ hmrDirtyComponents.delete(normalizeClassComponent(instance.type));
1630
+ }
1636
1631
  });
1637
1632
  }
1638
1633
  function tryWrap(fn) {
@@ -2446,12 +2441,12 @@ var Vue = (function (exports) {
2446
2441
  function renderComponentRoot(instance) {
2447
2442
  const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx, inheritAttrs } = instance;
2448
2443
  let result;
2444
+ let fallthroughAttrs;
2449
2445
  const prev = setCurrentRenderingInstance(instance);
2450
2446
  {
2451
2447
  accessedAttrs = false;
2452
2448
  }
2453
2449
  try {
2454
- let fallthroughAttrs;
2455
2450
  if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
2456
2451
  // withProxy is a proxy with a different `has` trap only for
2457
2452
  // runtime-compiled render functions using `with` block.
@@ -2482,108 +2477,105 @@ var Vue = (function (exports) {
2482
2477
  ? attrs
2483
2478
  : getFunctionalFallthrough(attrs);
2484
2479
  }
2485
- // attr merging
2486
- // in dev mode, comments are preserved, and it's possible for a template
2487
- // to have comments along side the root element which makes it a fragment
2488
- let root = result;
2489
- let setRoot = undefined;
2490
- if (true &&
2491
- result.patchFlag > 0 &&
2492
- result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
2493
- ;
2494
- [root, setRoot] = getChildRoot(result);
2495
- }
2496
- if (fallthroughAttrs && inheritAttrs !== false) {
2497
- const keys = Object.keys(fallthroughAttrs);
2498
- const { shapeFlag } = root;
2499
- if (keys.length) {
2500
- if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2501
- if (propsOptions && keys.some(isModelListener)) {
2502
- // If a v-model listener (onUpdate:xxx) has a corresponding declared
2503
- // prop, it indicates this component expects to handle v-model and
2504
- // it should not fallthrough.
2505
- // related: #1543, #1643, #1989
2506
- fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
2507
- }
2508
- root = cloneVNode(root, fallthroughAttrs);
2509
- }
2510
- else if (true && !accessedAttrs && root.type !== Comment) {
2511
- const allAttrs = Object.keys(attrs);
2512
- const eventAttrs = [];
2513
- const extraAttrs = [];
2514
- for (let i = 0, l = allAttrs.length; i < l; i++) {
2515
- const key = allAttrs[i];
2516
- if (isOn(key)) {
2517
- // ignore v-model handlers when they fail to fallthrough
2518
- if (!isModelListener(key)) {
2519
- // remove `on`, lowercase first letter to reflect event casing
2520
- // accurately
2521
- eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2522
- }
2523
- }
2524
- else {
2525
- extraAttrs.push(key);
2480
+ }
2481
+ catch (err) {
2482
+ blockStack.length = 0;
2483
+ handleError(err, instance, 1 /* RENDER_FUNCTION */);
2484
+ result = createVNode(Comment);
2485
+ }
2486
+ // attr merging
2487
+ // in dev mode, comments are preserved, and it's possible for a template
2488
+ // to have comments along side the root element which makes it a fragment
2489
+ let root = result;
2490
+ let setRoot = undefined;
2491
+ if (result.patchFlag > 0 &&
2492
+ result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
2493
+ [root, setRoot] = getChildRoot(result);
2494
+ }
2495
+ if (fallthroughAttrs && inheritAttrs !== false) {
2496
+ const keys = Object.keys(fallthroughAttrs);
2497
+ const { shapeFlag } = root;
2498
+ if (keys.length) {
2499
+ if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2500
+ if (propsOptions && keys.some(isModelListener)) {
2501
+ // If a v-model listener (onUpdate:xxx) has a corresponding declared
2502
+ // prop, it indicates this component expects to handle v-model and
2503
+ // it should not fallthrough.
2504
+ // related: #1543, #1643, #1989
2505
+ fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
2506
+ }
2507
+ root = cloneVNode(root, fallthroughAttrs);
2508
+ }
2509
+ else if (!accessedAttrs && root.type !== Comment) {
2510
+ const allAttrs = Object.keys(attrs);
2511
+ const eventAttrs = [];
2512
+ const extraAttrs = [];
2513
+ for (let i = 0, l = allAttrs.length; i < l; i++) {
2514
+ const key = allAttrs[i];
2515
+ if (isOn(key)) {
2516
+ // ignore v-model handlers when they fail to fallthrough
2517
+ if (!isModelListener(key)) {
2518
+ // remove `on`, lowercase first letter to reflect event casing
2519
+ // accurately
2520
+ eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2526
2521
  }
2527
2522
  }
2528
- if (extraAttrs.length) {
2529
- warn$1(`Extraneous non-props attributes (` +
2530
- `${extraAttrs.join(', ')}) ` +
2531
- `were passed to component but could not be automatically inherited ` +
2532
- `because component renders fragment or text root nodes.`);
2533
- }
2534
- if (eventAttrs.length) {
2535
- warn$1(`Extraneous non-emits event listeners (` +
2536
- `${eventAttrs.join(', ')}) ` +
2537
- `were passed to component but could not be automatically inherited ` +
2538
- `because component renders fragment or text root nodes. ` +
2539
- `If the listener is intended to be a component custom event listener only, ` +
2540
- `declare it using the "emits" option.`);
2523
+ else {
2524
+ extraAttrs.push(key);
2541
2525
  }
2542
2526
  }
2543
- }
2544
- }
2545
- if (true &&
2546
- isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
2547
- vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&
2548
- root.shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2549
- const { class: cls, style } = vnode.props || {};
2550
- if (cls || style) {
2551
- if (true && inheritAttrs === false) {
2552
- warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
2527
+ if (extraAttrs.length) {
2528
+ warn$1(`Extraneous non-props attributes (` +
2529
+ `${extraAttrs.join(', ')}) ` +
2530
+ `were passed to component but could not be automatically inherited ` +
2531
+ `because component renders fragment or text root nodes.`);
2532
+ }
2533
+ if (eventAttrs.length) {
2534
+ warn$1(`Extraneous non-emits event listeners (` +
2535
+ `${eventAttrs.join(', ')}) ` +
2536
+ `were passed to component but could not be automatically inherited ` +
2537
+ `because component renders fragment or text root nodes. ` +
2538
+ `If the listener is intended to be a component custom event listener only, ` +
2539
+ `declare it using the "emits" option.`);
2553
2540
  }
2554
- root = cloneVNode(root, {
2555
- class: cls,
2556
- style: style
2557
- });
2558
- }
2559
- }
2560
- // inherit directives
2561
- if (vnode.dirs) {
2562
- if (true && !isElementRoot(root)) {
2563
- warn$1(`Runtime directive used on component with non-element root node. ` +
2564
- `The directives will not function as intended.`);
2565
2541
  }
2566
- root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2567
2542
  }
2568
- // inherit transition data
2569
- if (vnode.transition) {
2570
- if (true && !isElementRoot(root)) {
2571
- warn$1(`Component inside <Transition> renders non-element root node ` +
2572
- `that cannot be animated.`);
2543
+ }
2544
+ if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
2545
+ vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&
2546
+ root.shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2547
+ const { class: cls, style } = vnode.props || {};
2548
+ if (cls || style) {
2549
+ if (inheritAttrs === false) {
2550
+ warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
2573
2551
  }
2574
- root.transition = vnode.transition;
2552
+ root = cloneVNode(root, {
2553
+ class: cls,
2554
+ style: style
2555
+ });
2575
2556
  }
2576
- if (true && setRoot) {
2577
- setRoot(root);
2557
+ }
2558
+ // inherit directives
2559
+ if (vnode.dirs) {
2560
+ if (!isElementRoot(root)) {
2561
+ warn$1(`Runtime directive used on component with non-element root node. ` +
2562
+ `The directives will not function as intended.`);
2578
2563
  }
2579
- else {
2580
- result = root;
2564
+ root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2565
+ }
2566
+ // inherit transition data
2567
+ if (vnode.transition) {
2568
+ if (!isElementRoot(root)) {
2569
+ warn$1(`Component inside <Transition> renders non-element root node ` +
2570
+ `that cannot be animated.`);
2581
2571
  }
2572
+ root.transition = vnode.transition;
2582
2573
  }
2583
- catch (err) {
2584
- blockStack.length = 0;
2585
- handleError(err, instance, 1 /* RENDER_FUNCTION */);
2586
- result = createVNode(Comment);
2574
+ if (setRoot) {
2575
+ setRoot(root);
2576
+ }
2577
+ else {
2578
+ result = root;
2587
2579
  }
2588
2580
  setCurrentRenderingInstance(prev);
2589
2581
  return result;
@@ -3118,8 +3110,8 @@ var Vue = (function (exports) {
3118
3110
  function normalizeSuspenseSlot(s) {
3119
3111
  let block;
3120
3112
  if (isFunction(s)) {
3121
- const isCompiledSlot = s._c;
3122
- if (isCompiledSlot) {
3113
+ const trackBlock = isBlockTreeEnabled && s._c;
3114
+ if (trackBlock) {
3123
3115
  // disableTracking: false
3124
3116
  // allow block tracking for compiled slots
3125
3117
  // (see ./componentRenderContext.ts)
@@ -3127,7 +3119,7 @@ var Vue = (function (exports) {
3127
3119
  openBlock();
3128
3120
  }
3129
3121
  s = s();
3130
- if (isCompiledSlot) {
3122
+ if (trackBlock) {
3131
3123
  s._d = true;
3132
3124
  block = currentBlock;
3133
3125
  closeBlock();
@@ -5283,7 +5275,7 @@ var Vue = (function (exports) {
5283
5275
  return vm;
5284
5276
  }
5285
5277
  }
5286
- Vue.version = "3.2.8";
5278
+ Vue.version = "3.2.12";
5287
5279
  Vue.config = singletonApp.config;
5288
5280
  Vue.use = (p, ...options) => {
5289
5281
  if (p && isFunction(p.install)) {
@@ -7931,7 +7923,11 @@ var Vue = (function (exports) {
7931
7923
  return Component;
7932
7924
  }
7933
7925
  if (warnMissing && !res) {
7934
- warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}`);
7926
+ const extra = type === COMPONENTS
7927
+ ? `\nIf this is a native custom element, make sure to exclude it from ` +
7928
+ `component resolution via compilerOptions.isCustomElement.`
7929
+ : ``;
7930
+ warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
7935
7931
  }
7936
7932
  return res;
7937
7933
  }
@@ -9373,17 +9369,19 @@ var Vue = (function (exports) {
9373
9369
  function exposeSetupStateOnRenderContext(instance) {
9374
9370
  const { ctx, setupState } = instance;
9375
9371
  Object.keys(toRaw(setupState)).forEach(key => {
9376
- if (!setupState.__isScriptSetup && (key[0] === '$' || key[0] === '_')) {
9377
- warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
9378
- `which are reserved prefixes for Vue internals.`);
9379
- return;
9372
+ if (!setupState.__isScriptSetup) {
9373
+ if (key[0] === '$' || key[0] === '_') {
9374
+ warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
9375
+ `which are reserved prefixes for Vue internals.`);
9376
+ return;
9377
+ }
9378
+ Object.defineProperty(ctx, key, {
9379
+ enumerable: true,
9380
+ configurable: true,
9381
+ get: () => setupState[key],
9382
+ set: NOOP
9383
+ });
9380
9384
  }
9381
- Object.defineProperty(ctx, key, {
9382
- enumerable: true,
9383
- configurable: true,
9384
- get: () => setupState[key],
9385
- set: NOOP
9386
- });
9387
9385
  });
9388
9386
  }
9389
9387
 
@@ -10142,11 +10140,18 @@ var Vue = (function (exports) {
10142
10140
  // 2. If a component is unmounted during a parent component's update,
10143
10141
  // its update can be skipped.
10144
10142
  queue.sort((a, b) => getId(a) - getId(b));
10143
+ // conditional usage of checkRecursiveUpdate must be determined out of
10144
+ // try ... catch block since Rollup by default de-optimizes treeshaking
10145
+ // inside try-catch. This can leave all warning code unshaked. Although
10146
+ // they would get eventually shaken by a minifier like terser, some minifiers
10147
+ // would fail to do that (e.g. https://github.com/evanw/esbuild/issues/1610)
10148
+ const check = (job) => checkRecursiveUpdates(seen, job)
10149
+ ;
10145
10150
  try {
10146
10151
  for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
10147
10152
  const job = queue[flushIndex];
10148
10153
  if (job && job.active !== false) {
10149
- if (true && checkRecursiveUpdates(seen, job)) {
10154
+ if (true && check(job)) {
10150
10155
  continue;
10151
10156
  }
10152
10157
  // console.log(`running:`, job.id)
@@ -10490,7 +10495,7 @@ var Vue = (function (exports) {
10490
10495
  }
10491
10496
  /**
10492
10497
  * Vue `<script setup>` compiler macro for providing props default values when
10493
- * using type-based `defineProps` decalration.
10498
+ * using type-based `defineProps` declaration.
10494
10499
  *
10495
10500
  * Example usage:
10496
10501
  * ```ts
@@ -10834,7 +10839,7 @@ var Vue = (function (exports) {
10834
10839
  }
10835
10840
 
10836
10841
  // Core API ------------------------------------------------------------------
10837
- const version = "3.2.8";
10842
+ const version = "3.2.12";
10838
10843
  /**
10839
10844
  * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
10840
10845
  * @internal
@@ -10963,19 +10968,13 @@ var Vue = (function (exports) {
10963
10968
 
10964
10969
  function patchStyle(el, prev, next) {
10965
10970
  const style = el.style;
10971
+ const currentDisplay = style.display;
10966
10972
  if (!next) {
10967
10973
  el.removeAttribute('style');
10968
10974
  }
10969
10975
  else if (isString(next)) {
10970
10976
  if (prev !== next) {
10971
- const current = style.display;
10972
10977
  style.cssText = next;
10973
- // indicates that the `display` of the element is controlled by `v-show`,
10974
- // so we always keep the current `display` value regardless of the `style` value,
10975
- // thus handing over control to `v-show`.
10976
- if ('_vod' in el) {
10977
- style.display = current;
10978
- }
10979
10978
  }
10980
10979
  }
10981
10980
  else {
@@ -10990,6 +10989,12 @@ var Vue = (function (exports) {
10990
10989
  }
10991
10990
  }
10992
10991
  }
10992
+ // indicates that the `display` of the element is controlled by `v-show`,
10993
+ // so we always keep the current `display` value regardless of the `style` value,
10994
+ // thus handing over control to `v-show`.
10995
+ if ('_vod' in el) {
10996
+ style.display = currentDisplay;
10997
+ }
10993
10998
  }
10994
10999
  const importantRE = /\s*!important$/;
10995
11000
  function setStyle(style, name, val) {
@@ -11360,6 +11365,7 @@ var Vue = (function (exports) {
11360
11365
  this._instance = null;
11361
11366
  this._connected = false;
11362
11367
  this._resolved = false;
11368
+ this._numberProps = null;
11363
11369
  if (this.shadowRoot && hydrate) {
11364
11370
  hydrate(this._createVNode(), this.shadowRoot);
11365
11371
  }
@@ -11375,18 +11381,17 @@ var Vue = (function (exports) {
11375
11381
  this._setAttr(this.attributes[i].name);
11376
11382
  }
11377
11383
  // watch future attr changes
11378
- const observer = new MutationObserver(mutations => {
11384
+ new MutationObserver(mutations => {
11379
11385
  for (const m of mutations) {
11380
11386
  this._setAttr(m.attributeName);
11381
11387
  }
11382
- });
11383
- observer.observe(this, { attributes: true });
11388
+ }).observe(this, { attributes: true });
11384
11389
  }
11385
11390
  connectedCallback() {
11386
11391
  this._connected = true;
11387
11392
  if (!this._instance) {
11388
11393
  this._resolveDef();
11389
- render(this._createVNode(), this.shadowRoot);
11394
+ this._update();
11390
11395
  }
11391
11396
  }
11392
11397
  disconnectedCallback() {
@@ -11407,15 +11412,31 @@ var Vue = (function (exports) {
11407
11412
  }
11408
11413
  const resolve = (def) => {
11409
11414
  this._resolved = true;
11415
+ const { props, styles } = def;
11416
+ const hasOptions = !isArray(props);
11417
+ const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
11418
+ // cast Number-type props set before resolve
11419
+ let numberProps;
11420
+ if (hasOptions) {
11421
+ for (const key in this._props) {
11422
+ const opt = props[key];
11423
+ if (opt === Number || (opt && opt.type === Number)) {
11424
+ this._props[key] = toNumber(this._props[key]);
11425
+ (numberProps || (numberProps = Object.create(null)))[key] = true;
11426
+ }
11427
+ }
11428
+ }
11429
+ if (numberProps) {
11430
+ this._numberProps = numberProps;
11431
+ this._update();
11432
+ }
11410
11433
  // check if there are props set pre-upgrade or connect
11411
11434
  for (const key of Object.keys(this)) {
11412
11435
  if (key[0] !== '_') {
11413
11436
  this._setProp(key, this[key]);
11414
11437
  }
11415
11438
  }
11416
- const { props, styles } = def;
11417
11439
  // defining getter/setters on prototype
11418
- const rawKeys = props ? (isArray(props) ? props : Object.keys(props)) : [];
11419
11440
  for (const key of rawKeys.map(camelize)) {
11420
11441
  Object.defineProperty(this, key, {
11421
11442
  get() {
@@ -11437,7 +11458,11 @@ var Vue = (function (exports) {
11437
11458
  }
11438
11459
  }
11439
11460
  _setAttr(key) {
11440
- this._setProp(camelize(key), toNumber(this.getAttribute(key)), false);
11461
+ let value = this.getAttribute(key);
11462
+ if (this._numberProps && this._numberProps[key]) {
11463
+ value = toNumber(value);
11464
+ }
11465
+ this._setProp(camelize(key), value, false);
11441
11466
  }
11442
11467
  /**
11443
11468
  * @internal
@@ -11452,7 +11477,7 @@ var Vue = (function (exports) {
11452
11477
  if (val !== this._props[key]) {
11453
11478
  this._props[key] = val;
11454
11479
  if (this._instance) {
11455
- render(this._createVNode(), this.shadowRoot);
11480
+ this._update();
11456
11481
  }
11457
11482
  // reflect
11458
11483
  if (shouldReflect) {
@@ -11468,6 +11493,9 @@ var Vue = (function (exports) {
11468
11493
  }
11469
11494
  }
11470
11495
  }
11496
+ _update() {
11497
+ render(this._createVNode(), this.shadowRoot);
11498
+ }
11471
11499
  _createVNode() {
11472
11500
  const vnode = createVNode(this._def, extend({}, this._props));
11473
11501
  if (!this._instance) {
@@ -11488,7 +11516,7 @@ var Vue = (function (exports) {
11488
11516
  if (!this._def.__asyncLoader) {
11489
11517
  // reload
11490
11518
  this._instance = null;
11491
- render(this._createVNode(), this.shadowRoot);
11519
+ this._update();
11492
11520
  }
11493
11521
  };
11494
11522
  }
@@ -13934,6 +13962,13 @@ var Vue = (function (exports) {
13934
13962
  emitError(context, 3 /* END_TAG_WITH_ATTRIBUTES */);
13935
13963
  }
13936
13964
  const attr = parseAttribute(context, attributeNames);
13965
+ // Trim whitespace between class
13966
+ // https://github.com/vuejs/vue-next/issues/4251
13967
+ if (attr.type === 6 /* ATTRIBUTE */ &&
13968
+ attr.value &&
13969
+ attr.name === 'class') {
13970
+ attr.value.content = attr.value.content.replace(/\s+/g, ' ').trim();
13971
+ }
13937
13972
  if (type === 0 /* Start */) {
13938
13973
  props.push(attr);
13939
13974
  }
@@ -13996,8 +14031,11 @@ var Vue = (function (exports) {
13996
14031
  isStatic = false;
13997
14032
  if (!content.endsWith(']')) {
13998
14033
  emitError(context, 27 /* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END */);
14034
+ content = content.substr(1);
14035
+ }
14036
+ else {
14037
+ content = content.substr(1, content.length - 2);
13999
14038
  }
14000
- content = content.substr(1, content.length - 2);
14001
14039
  }
14002
14040
  else if (isSlot) {
14003
14041
  // #1241 special case for v-slot: vuetify relies extensively on slot
@@ -15459,7 +15497,7 @@ var Vue = (function (exports) {
15459
15497
  // function params
15460
15498
  asParams = false,
15461
15499
  // v-on handler values may contain multiple statements
15462
- asRawStatements = false) {
15500
+ asRawStatements = false, localVars = Object.create(context.identifiers)) {
15463
15501
  {
15464
15502
  {
15465
15503
  // simple in-browser validation (same logic in 2.x)
@@ -16771,7 +16809,7 @@ var Vue = (function (exports) {
16771
16809
  };
16772
16810
  }
16773
16811
 
16774
- const fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^\s*function(?:\s+[\w$]+)?\s*\(/;
16812
+ const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
16775
16813
  const transformOn = (dir, node, context, augmentor) => {
16776
16814
  const { loc, modifiers, arg } = dir;
16777
16815
  if (!dir.exp && !modifiers.length) {
@@ -17832,10 +17870,6 @@ var Vue = (function (exports) {
17832
17870
  const Vue = createCompatVue$1();
17833
17871
  Vue.compile = compileToFunction;
17834
17872
 
17835
- exports.default = Vue;
17836
-
17837
- Object.defineProperty(exports, '__esModule', { value: true });
17838
-
17839
- return exports;
17873
+ return Vue;
17840
17874
 
17841
- }({}));
17875
+ }());