@vue/compat 3.5.35 → 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.35
2
+ * @vue/compat v3.5.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2167,8 +2167,9 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2167
2167
  if (once && cb) {
2168
2168
  const _cb = cb;
2169
2169
  cb = (...args) => {
2170
- _cb(...args);
2170
+ const res = _cb(...args);
2171
2171
  watchHandle();
2172
+ return res;
2172
2173
  };
2173
2174
  }
2174
2175
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -2178,7 +2179,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2178
2179
  }
2179
2180
  if (cb) {
2180
2181
  const newValue = effect.run();
2181
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2182
+ if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2182
2183
  if (cleanup) {
2183
2184
  cleanup();
2184
2185
  }
@@ -5463,13 +5464,21 @@ function defineAsyncComponent(source) {
5463
5464
  const loaded = ref(false);
5464
5465
  const error = ref();
5465
5466
  const delayed = ref(!!delay);
5467
+ let timeoutTimer;
5468
+ let delayTimer;
5469
+ onUnmounted(() => {
5470
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
5471
+ if (delayTimer != null) clearTimeout(delayTimer);
5472
+ });
5466
5473
  if (delay) {
5467
- setTimeout(() => {
5474
+ delayTimer = setTimeout(() => {
5475
+ if (instance.isUnmounted) return;
5468
5476
  delayed.value = false;
5469
5477
  }, delay);
5470
5478
  }
5471
5479
  if (timeout != null) {
5472
- setTimeout(() => {
5480
+ timeoutTimer = setTimeout(() => {
5481
+ if (instance.isUnmounted) return;
5473
5482
  if (!loaded.value && !error.value) {
5474
5483
  const err = new Error(
5475
5484
  `Async component timed out after ${timeout}ms.`
@@ -5480,11 +5489,16 @@ function defineAsyncComponent(source) {
5480
5489
  }, timeout);
5481
5490
  }
5482
5491
  load().then(() => {
5492
+ if (instance.isUnmounted) return;
5483
5493
  loaded.value = true;
5484
5494
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
5485
5495
  instance.parent.update();
5486
5496
  }
5487
5497
  }).catch((err) => {
5498
+ if (instance.isUnmounted) {
5499
+ pendingRequest = null;
5500
+ return;
5501
+ }
5488
5502
  onError(err);
5489
5503
  error.value = err;
5490
5504
  });
@@ -7469,7 +7483,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7469
7483
  return vm;
7470
7484
  }
7471
7485
  }
7472
- Vue.version = `2.6.14-compat:${"3.5.35"}`;
7486
+ Vue.version = `2.6.14-compat:${"3.5.36"}`;
7473
7487
  Vue.config = singletonApp.config;
7474
7488
  Vue.use = (plugin, ...options) => {
7475
7489
  if (plugin && isFunction(plugin.install)) {
@@ -7809,6 +7823,9 @@ function defineReactive(obj, key, val) {
7809
7823
  try {
7810
7824
  defineReactiveSimple(val, key2, val[key2]);
7811
7825
  } catch (e) {
7826
+ {
7827
+ warn$1(`Failed making property "${key2}" reactive:`, e);
7828
+ }
7812
7829
  }
7813
7830
  });
7814
7831
  }
@@ -8147,13 +8164,20 @@ function useModel(props, name, options = EMPTY_OBJ) {
8147
8164
  return;
8148
8165
  }
8149
8166
  const rawProps = i.vnode.props;
8150
- if (!(rawProps && // check if parent has passed v-model
8151
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
8167
+ const hasVModel = !!(rawProps && // check if parent has passed v-model
8168
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps));
8169
+ if (!hasVModel) {
8152
8170
  localValue = value;
8153
8171
  trigger();
8154
8172
  }
8155
8173
  i.emit(`update:${name}`, emittedValue);
8156
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
8174
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || // #13524: browsers differ in when they flush microtasks between
8175
+ // event listeners. If a v-model listener emits an intermediate value
8176
+ // and a following listener restores the model to its previous prop
8177
+ // value before parent updates are flushed, the parent render can be
8178
+ // deduped as having no prop change. Force a local update so DOM state
8179
+ // such as an input's value is synchronized back to the current model.
8180
+ hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) {
8157
8181
  trigger();
8158
8182
  }
8159
8183
  prevSetValue = value;
@@ -12601,7 +12625,7 @@ function isMemoSame(cached, memo) {
12601
12625
  return true;
12602
12626
  }
12603
12627
 
12604
- const version = "3.5.35";
12628
+ const version = "3.5.36";
12605
12629
  const warn = warn$1 ;
12606
12630
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12607
12631
  const devtools = devtools$1 ;
@@ -14174,7 +14198,8 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
14174
14198
  if (children) {
14175
14199
  for (let i = 0; i < children.length; i++) {
14176
14200
  const child = children[i];
14177
- if (child.el && child.el instanceof Element) {
14201
+ if (child.el && child.el instanceof Element && // Hidden v-show nodes have no previous layout box to animate from.
14202
+ !child.el[vShowHidden]) {
14178
14203
  prevChildren.push(child);
14179
14204
  setTransitionHooks(
14180
14205
  child,