@vue/compat 3.5.35 → 3.5.37

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.37
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2177,8 +2177,9 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2177
2177
  if (once && cb) {
2178
2178
  const _cb = cb;
2179
2179
  cb = (...args) => {
2180
- _cb(...args);
2180
+ const res = _cb(...args);
2181
2181
  watchHandle();
2182
+ return res;
2182
2183
  };
2183
2184
  }
2184
2185
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -2188,7 +2189,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2188
2189
  }
2189
2190
  if (cb) {
2190
2191
  const newValue = effect.run();
2191
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2192
+ if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2192
2193
  if (cleanup) {
2193
2194
  cleanup();
2194
2195
  }
@@ -5493,13 +5494,21 @@ function defineAsyncComponent(source) {
5493
5494
  const loaded = ref(false);
5494
5495
  const error = ref();
5495
5496
  const delayed = ref(!!delay);
5497
+ let timeoutTimer;
5498
+ let delayTimer;
5499
+ onUnmounted(() => {
5500
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
5501
+ if (delayTimer != null) clearTimeout(delayTimer);
5502
+ });
5496
5503
  if (delay) {
5497
- setTimeout(() => {
5504
+ delayTimer = setTimeout(() => {
5505
+ if (instance.isUnmounted) return;
5498
5506
  delayed.value = false;
5499
5507
  }, delay);
5500
5508
  }
5501
5509
  if (timeout != null) {
5502
- setTimeout(() => {
5510
+ timeoutTimer = setTimeout(() => {
5511
+ if (instance.isUnmounted) return;
5503
5512
  if (!loaded.value && !error.value) {
5504
5513
  const err = new Error(
5505
5514
  `Async component timed out after ${timeout}ms.`
@@ -5510,11 +5519,16 @@ function defineAsyncComponent(source) {
5510
5519
  }, timeout);
5511
5520
  }
5512
5521
  load().then(() => {
5522
+ if (instance.isUnmounted) return;
5513
5523
  loaded.value = true;
5514
5524
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
5515
5525
  instance.parent.update();
5516
5526
  }
5517
5527
  }).catch((err) => {
5528
+ if (instance.isUnmounted) {
5529
+ pendingRequest = null;
5530
+ return;
5531
+ }
5518
5532
  onError(err);
5519
5533
  error.value = err;
5520
5534
  });
@@ -7501,7 +7515,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7501
7515
  return vm;
7502
7516
  }
7503
7517
  }
7504
- Vue.version = `2.6.14-compat:${"3.5.35"}`;
7518
+ Vue.version = `2.6.14-compat:${"3.5.37"}`;
7505
7519
  Vue.config = singletonApp.config;
7506
7520
  Vue.use = (plugin, ...options) => {
7507
7521
  if (plugin && isFunction(plugin.install)) {
@@ -7841,6 +7855,9 @@ function defineReactive(obj, key, val) {
7841
7855
  try {
7842
7856
  defineReactiveSimple(val, key2, val[key2]);
7843
7857
  } catch (e) {
7858
+ if (!!(process.env.NODE_ENV !== "production")) {
7859
+ warn$1(`Failed making property "${key2}" reactive:`, e);
7860
+ }
7844
7861
  }
7845
7862
  });
7846
7863
  }
@@ -8181,13 +8198,20 @@ function useModel(props, name, options = EMPTY_OBJ) {
8181
8198
  return;
8182
8199
  }
8183
8200
  const rawProps = i.vnode.props;
8184
- if (!(rawProps && // check if parent has passed v-model
8185
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
8201
+ const hasVModel = !!(rawProps && // check if parent has passed v-model
8202
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps));
8203
+ if (!hasVModel) {
8186
8204
  localValue = value;
8187
8205
  trigger();
8188
8206
  }
8189
8207
  i.emit(`update:${name}`, emittedValue);
8190
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
8208
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || // #13524: browsers differ in when they flush microtasks between
8209
+ // event listeners. If a v-model listener emits an intermediate value
8210
+ // and a following listener restores the model to its previous prop
8211
+ // value before parent updates are flushed, the parent render can be
8212
+ // deduped as having no prop change. Force a local update so DOM state
8213
+ // such as an input's value is synchronized back to the current model.
8214
+ hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) {
8191
8215
  trigger();
8192
8216
  }
8193
8217
  prevSetValue = value;
@@ -12687,7 +12711,7 @@ function isMemoSame(cached, memo) {
12687
12711
  return true;
12688
12712
  }
12689
12713
 
12690
- const version = "3.5.35";
12714
+ const version = "3.5.37";
12691
12715
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12692
12716
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12693
12717
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -14260,7 +14284,8 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
14260
14284
  if (children) {
14261
14285
  for (let i = 0; i < children.length; i++) {
14262
14286
  const child = children[i];
14263
- if (child.el && child.el instanceof Element) {
14287
+ if (child.el && child.el instanceof Element && // Hidden v-show nodes have no previous layout box to animate from.
14288
+ !child.el[vShowHidden]) {
14264
14289
  prevChildren.push(child);
14265
14290
  setTransitionHooks(
14266
14291
  child,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.35
2
+ * @vue/compat v3.5.37
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -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
  }
@@ -5438,13 +5439,21 @@ Server rendered element contains fewer child nodes than client vdom.`
5438
5439
  const loaded = ref(false);
5439
5440
  const error = ref();
5440
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
+ });
5441
5448
  if (delay) {
5442
- setTimeout(() => {
5449
+ delayTimer = setTimeout(() => {
5450
+ if (instance.isUnmounted) return;
5443
5451
  delayed.value = false;
5444
5452
  }, delay);
5445
5453
  }
5446
5454
  if (timeout != null) {
5447
- setTimeout(() => {
5455
+ timeoutTimer = setTimeout(() => {
5456
+ if (instance.isUnmounted) return;
5448
5457
  if (!loaded.value && !error.value) {
5449
5458
  const err = new Error(
5450
5459
  `Async component timed out after ${timeout}ms.`
@@ -5455,11 +5464,16 @@ Server rendered element contains fewer child nodes than client vdom.`
5455
5464
  }, timeout);
5456
5465
  }
5457
5466
  load().then(() => {
5467
+ if (instance.isUnmounted) return;
5458
5468
  loaded.value = true;
5459
5469
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
5460
5470
  instance.parent.update();
5461
5471
  }
5462
5472
  }).catch((err) => {
5473
+ if (instance.isUnmounted) {
5474
+ pendingRequest = null;
5475
+ return;
5476
+ }
5463
5477
  onError(err);
5464
5478
  error.value = err;
5465
5479
  });
@@ -7435,7 +7449,7 @@ If this is a native custom element, make sure to exclude it from component resol
7435
7449
  return vm;
7436
7450
  }
7437
7451
  }
7438
- Vue.version = `2.6.14-compat:${"3.5.35"}`;
7452
+ Vue.version = `2.6.14-compat:${"3.5.37"}`;
7439
7453
  Vue.config = singletonApp.config;
7440
7454
  Vue.use = (plugin, ...options) => {
7441
7455
  if (plugin && isFunction(plugin.install)) {
@@ -7775,6 +7789,9 @@ If this is a native custom element, make sure to exclude it from component resol
7775
7789
  try {
7776
7790
  defineReactiveSimple(val, key2, val[key2]);
7777
7791
  } catch (e) {
7792
+ {
7793
+ warn$1(`Failed making property "${key2}" reactive:`, e);
7794
+ }
7778
7795
  }
7779
7796
  });
7780
7797
  }
@@ -8113,13 +8130,20 @@ If you want to remount the same app, move your app creation logic into a factory
8113
8130
  return;
8114
8131
  }
8115
8132
  const rawProps = i.vnode.props;
8116
- if (!(rawProps && // check if parent has passed v-model
8117
- (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) {
8118
8136
  localValue = value;
8119
8137
  trigger();
8120
8138
  }
8121
8139
  i.emit(`update:${name}`, emittedValue);
8122
- 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))) {
8123
8147
  trigger();
8124
8148
  }
8125
8149
  prevSetValue = value;
@@ -12553,7 +12577,7 @@ Component that was made reactive: `,
12553
12577
  return true;
12554
12578
  }
12555
12579
 
12556
- const version = "3.5.35";
12580
+ const version = "3.5.37";
12557
12581
  const warn = warn$1 ;
12558
12582
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12559
12583
  const devtools = devtools$1 ;
@@ -14095,7 +14119,8 @@ Expected function or array of functions, received type ${typeof value}.`
14095
14119
  if (children) {
14096
14120
  for (let i = 0; i < children.length; i++) {
14097
14121
  const child = children[i];
14098
- 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]) {
14099
14124
  prevChildren.push(child);
14100
14125
  setTransitionHooks(
14101
14126
  child,