@vue/compat 3.5.34 → 3.5.36

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,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.34
2
+ * @vue/compat v3.5.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1675,9 +1675,6 @@ var Vue = (function () {
1675
1675
  return 0 /* INVALID */;
1676
1676
  }
1677
1677
  }
1678
- function getTargetType(value) {
1679
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
1680
- }
1681
1678
  // @__NO_SIDE_EFFECTS__
1682
1679
  function reactive(target) {
1683
1680
  if (/* @__PURE__ */ isReadonly(target)) {
@@ -1735,14 +1732,17 @@ var Vue = (function () {
1735
1732
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1736
1733
  return target;
1737
1734
  }
1738
- const targetType = getTargetType(target);
1739
- if (targetType === 0 /* INVALID */) {
1735
+ if (target["__v_skip"] || !Object.isExtensible(target)) {
1740
1736
  return target;
1741
1737
  }
1742
1738
  const existingProxy = proxyMap.get(target);
1743
1739
  if (existingProxy) {
1744
1740
  return existingProxy;
1745
1741
  }
1742
+ const targetType = targetTypeMap(toRawType(target));
1743
+ if (targetType === 0 /* INVALID */) {
1744
+ return target;
1745
+ }
1746
1746
  const proxy = new Proxy(
1747
1747
  target,
1748
1748
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -2170,8 +2170,9 @@ var Vue = (function () {
2170
2170
  if (once && cb) {
2171
2171
  const _cb = cb;
2172
2172
  cb = (...args) => {
2173
- _cb(...args);
2173
+ const res = _cb(...args);
2174
2174
  watchHandle();
2175
+ return res;
2175
2176
  };
2176
2177
  }
2177
2178
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -2181,7 +2182,7 @@ var Vue = (function () {
2181
2182
  }
2182
2183
  if (cb) {
2183
2184
  const newValue = effect.run();
2184
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2185
+ if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2185
2186
  if (cleanup) {
2186
2187
  cleanup();
2187
2188
  }
@@ -3866,19 +3867,18 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3866
3867
  target,
3867
3868
  props
3868
3869
  } = vnode;
3869
- let shouldRemove = doRemove || !isTeleportDisabled(props);
3870
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
3870
3871
  const pendingMount = pendingMounts.get(vnode);
3871
3872
  if (pendingMount) {
3872
3873
  pendingMount.flags |= 8;
3873
3874
  pendingMounts.delete(vnode);
3874
- shouldRemove = false;
3875
3875
  }
3876
3876
  if (target) {
3877
3877
  hostRemove(targetStart);
3878
3878
  hostRemove(targetAnchor);
3879
3879
  }
3880
3880
  doRemove && hostRemove(anchor);
3881
- if (shapeFlag & 16) {
3881
+ if (!pendingMount && shapeFlag & 16) {
3882
3882
  for (let i = 0; i < children.length; i++) {
3883
3883
  const child = children[i];
3884
3884
  unmount(
@@ -4849,20 +4849,16 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4849
4849
  slotScopeIds,
4850
4850
  optimized
4851
4851
  );
4852
- let hasWarned = false;
4853
- while (next) {
4854
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
4855
- if (!hasWarned) {
4856
- warn$1(
4857
- `Hydration children mismatch on`,
4858
- el,
4859
- `
4852
+ if (next && !isMismatchAllowed(el, 1 /* CHILDREN */)) {
4853
+ warn$1(
4854
+ `Hydration children mismatch on`,
4855
+ el,
4856
+ `
4860
4857
  Server rendered element contains more child nodes than client vdom.`
4861
- );
4862
- hasWarned = true;
4863
- }
4864
- logMismatchError();
4865
- }
4858
+ );
4859
+ logMismatchError();
4860
+ }
4861
+ while (next) {
4866
4862
  const cur = next;
4867
4863
  next = next.nextSibling;
4868
4864
  remove(cur);
@@ -4925,7 +4921,7 @@ Server rendered element contains more child nodes than client vdom.`
4925
4921
  optimized = optimized || !!parentVNode.dynamicChildren;
4926
4922
  const children = parentVNode.children;
4927
4923
  const l = children.length;
4928
- let hasWarned = false;
4924
+ let hasCheckedMismatch = false;
4929
4925
  for (let i = 0; i < l; i++) {
4930
4926
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4931
4927
  const isText = vnode.type === Text;
@@ -4953,17 +4949,17 @@ Server rendered element contains more child nodes than client vdom.`
4953
4949
  } else if (isText && !vnode.children) {
4954
4950
  insert(vnode.el = createText(""), container);
4955
4951
  } else {
4956
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4957
- if (!hasWarned) {
4952
+ if (!hasCheckedMismatch) {
4953
+ hasCheckedMismatch = true;
4954
+ if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4958
4955
  warn$1(
4959
4956
  `Hydration children mismatch on`,
4960
4957
  container,
4961
4958
  `
4962
4959
  Server rendered element contains fewer child nodes than client vdom.`
4963
4960
  );
4964
- hasWarned = true;
4961
+ logMismatchError();
4965
4962
  }
4966
- logMismatchError();
4967
4963
  }
4968
4964
  patch(
4969
4965
  null,
@@ -5443,13 +5439,21 @@ Server rendered element contains fewer child nodes than client vdom.`
5443
5439
  const loaded = ref(false);
5444
5440
  const error = ref();
5445
5441
  const delayed = ref(!!delay);
5442
+ let timeoutTimer;
5443
+ let delayTimer;
5444
+ onUnmounted(() => {
5445
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
5446
+ if (delayTimer != null) clearTimeout(delayTimer);
5447
+ });
5446
5448
  if (delay) {
5447
- setTimeout(() => {
5449
+ delayTimer = setTimeout(() => {
5450
+ if (instance.isUnmounted) return;
5448
5451
  delayed.value = false;
5449
5452
  }, delay);
5450
5453
  }
5451
5454
  if (timeout != null) {
5452
- setTimeout(() => {
5455
+ timeoutTimer = setTimeout(() => {
5456
+ if (instance.isUnmounted) return;
5453
5457
  if (!loaded.value && !error.value) {
5454
5458
  const err = new Error(
5455
5459
  `Async component timed out after ${timeout}ms.`
@@ -5460,11 +5464,16 @@ Server rendered element contains fewer child nodes than client vdom.`
5460
5464
  }, timeout);
5461
5465
  }
5462
5466
  load().then(() => {
5467
+ if (instance.isUnmounted) return;
5463
5468
  loaded.value = true;
5464
5469
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
5465
5470
  instance.parent.update();
5466
5471
  }
5467
5472
  }).catch((err) => {
5473
+ if (instance.isUnmounted) {
5474
+ pendingRequest = null;
5475
+ return;
5476
+ }
5468
5477
  onError(err);
5469
5478
  error.value = err;
5470
5479
  });
@@ -7440,7 +7449,7 @@ If this is a native custom element, make sure to exclude it from component resol
7440
7449
  return vm;
7441
7450
  }
7442
7451
  }
7443
- Vue.version = `2.6.14-compat:${"3.5.34"}`;
7452
+ Vue.version = `2.6.14-compat:${"3.5.36"}`;
7444
7453
  Vue.config = singletonApp.config;
7445
7454
  Vue.use = (plugin, ...options) => {
7446
7455
  if (plugin && isFunction(plugin.install)) {
@@ -7780,6 +7789,9 @@ If this is a native custom element, make sure to exclude it from component resol
7780
7789
  try {
7781
7790
  defineReactiveSimple(val, key2, val[key2]);
7782
7791
  } catch (e) {
7792
+ {
7793
+ warn$1(`Failed making property "${key2}" reactive:`, e);
7794
+ }
7783
7795
  }
7784
7796
  });
7785
7797
  }
@@ -8118,13 +8130,20 @@ If you want to remount the same app, move your app creation logic into a factory
8118
8130
  return;
8119
8131
  }
8120
8132
  const rawProps = i.vnode.props;
8121
- if (!(rawProps && // check if parent has passed v-model
8122
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
8133
+ const hasVModel = !!(rawProps && // check if parent has passed v-model
8134
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps));
8135
+ if (!hasVModel) {
8123
8136
  localValue = value;
8124
8137
  trigger();
8125
8138
  }
8126
8139
  i.emit(`update:${name}`, emittedValue);
8127
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
8140
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || // #13524: browsers differ in when they flush microtasks between
8141
+ // event listeners. If a v-model listener emits an intermediate value
8142
+ // and a following listener restores the model to its previous prop
8143
+ // value before parent updates are flushed, the parent render can be
8144
+ // deduped as having no prop change. Force a local update so DOM state
8145
+ // such as an input's value is synchronized back to the current model.
8146
+ hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) {
8128
8147
  trigger();
8129
8148
  }
8130
8149
  prevSetValue = value;
@@ -10446,9 +10465,13 @@ If you want to remount the same app, move your app creation logic into a factory
10446
10465
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
10447
10466
  if (needTransition2) {
10448
10467
  if (moveType === 0) {
10449
- transition.beforeEnter(el);
10450
- hostInsert(el, container, anchor);
10451
- queuePostRenderEffect(() => transition.enter(el), parentSuspense);
10468
+ if (transition.persisted && !el[leaveCbKey]) {
10469
+ hostInsert(el, container, anchor);
10470
+ } else {
10471
+ transition.beforeEnter(el);
10472
+ hostInsert(el, container, anchor);
10473
+ queuePostRenderEffect(() => transition.enter(el), parentSuspense);
10474
+ }
10452
10475
  } else {
10453
10476
  const { leave, delayLeave, afterLeave } = transition;
10454
10477
  const remove2 = () => {
@@ -10459,16 +10482,21 @@ If you want to remount the same app, move your app creation logic into a factory
10459
10482
  }
10460
10483
  };
10461
10484
  const performLeave = () => {
10485
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
10462
10486
  if (el._isLeaving) {
10463
10487
  el[leaveCbKey](
10464
10488
  true
10465
10489
  /* cancelled */
10466
10490
  );
10467
10491
  }
10468
- leave(el, () => {
10492
+ if (transition.persisted && !wasLeaving) {
10469
10493
  remove2();
10470
- afterLeave && afterLeave();
10471
- });
10494
+ } else {
10495
+ leave(el, () => {
10496
+ remove2();
10497
+ afterLeave && afterLeave();
10498
+ });
10499
+ }
10472
10500
  };
10473
10501
  if (delayLeave) {
10474
10502
  delayLeave(el, remove2, performLeave);
@@ -12549,7 +12577,7 @@ Component that was made reactive: `,
12549
12577
  return true;
12550
12578
  }
12551
12579
 
12552
- const version = "3.5.34";
12580
+ const version = "3.5.36";
12553
12581
  const warn = warn$1 ;
12554
12582
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12555
12583
  const devtools = devtools$1 ;
@@ -13375,12 +13403,37 @@ Component that was made reactive: `,
13375
13403
  } else if (e._vts <= invoker.attached) {
13376
13404
  return;
13377
13405
  }
13378
- callWithAsyncErrorHandling(
13379
- patchStopImmediatePropagation(e, invoker.value),
13380
- instance,
13381
- 5,
13382
- [e]
13383
- );
13406
+ const value = invoker.value;
13407
+ if (isArray(value)) {
13408
+ const originalStop = e.stopImmediatePropagation;
13409
+ e.stopImmediatePropagation = () => {
13410
+ originalStop.call(e);
13411
+ e._stopped = true;
13412
+ };
13413
+ const handlers = value.slice();
13414
+ const args = [e];
13415
+ for (let i = 0; i < handlers.length; i++) {
13416
+ if (e._stopped) {
13417
+ break;
13418
+ }
13419
+ const handler = handlers[i];
13420
+ if (handler) {
13421
+ callWithAsyncErrorHandling(
13422
+ handler,
13423
+ instance,
13424
+ 5,
13425
+ args
13426
+ );
13427
+ }
13428
+ }
13429
+ } else {
13430
+ callWithAsyncErrorHandling(
13431
+ value,
13432
+ instance,
13433
+ 5,
13434
+ [e]
13435
+ );
13436
+ }
13384
13437
  };
13385
13438
  invoker.value = initialValue;
13386
13439
  invoker.attached = getNow();
@@ -13396,20 +13449,6 @@ Expected function or array of functions, received type ${typeof value}.`
13396
13449
  );
13397
13450
  return NOOP;
13398
13451
  }
13399
- function patchStopImmediatePropagation(e, value) {
13400
- if (isArray(value)) {
13401
- const originalStop = e.stopImmediatePropagation;
13402
- e.stopImmediatePropagation = () => {
13403
- originalStop.call(e);
13404
- e._stopped = true;
13405
- };
13406
- return value.map(
13407
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
13408
- );
13409
- } else {
13410
- return value;
13411
- }
13412
- }
13413
13452
 
13414
13453
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
13415
13454
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
@@ -14080,7 +14119,8 @@ Expected function or array of functions, received type ${typeof value}.`
14080
14119
  if (children) {
14081
14120
  for (let i = 0; i < children.length; i++) {
14082
14121
  const child = children[i];
14083
- if (child.el && child.el instanceof Element) {
14122
+ if (child.el && child.el instanceof Element && // Hidden v-show nodes have no previous layout box to animate from.
14123
+ !child.el[vShowHidden]) {
14084
14124
  prevChildren.push(child);
14085
14125
  setTransitionHooks(
14086
14126
  child,