@vue/runtime-core 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/runtime-core v3.5.35
2
+ * @vue/runtime-core v3.5.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2727,13 +2727,21 @@ function defineAsyncComponent(source) {
2727
2727
  const loaded = reactivity.ref(false);
2728
2728
  const error = reactivity.ref();
2729
2729
  const delayed = reactivity.ref(!!delay);
2730
+ let timeoutTimer;
2731
+ let delayTimer;
2732
+ onUnmounted(() => {
2733
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
2734
+ if (delayTimer != null) clearTimeout(delayTimer);
2735
+ });
2730
2736
  if (delay) {
2731
- setTimeout(() => {
2737
+ delayTimer = setTimeout(() => {
2738
+ if (instance.isUnmounted) return;
2732
2739
  delayed.value = false;
2733
2740
  }, delay);
2734
2741
  }
2735
2742
  if (timeout != null) {
2736
- setTimeout(() => {
2743
+ timeoutTimer = setTimeout(() => {
2744
+ if (instance.isUnmounted) return;
2737
2745
  if (!loaded.value && !error.value) {
2738
2746
  const err = new Error(
2739
2747
  `Async component timed out after ${timeout}ms.`
@@ -2744,11 +2752,16 @@ function defineAsyncComponent(source) {
2744
2752
  }, timeout);
2745
2753
  }
2746
2754
  load().then(() => {
2755
+ if (instance.isUnmounted) return;
2747
2756
  loaded.value = true;
2748
2757
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
2749
2758
  instance.parent.update();
2750
2759
  }
2751
2760
  }).catch((err) => {
2761
+ if (instance.isUnmounted) {
2762
+ pendingRequest = null;
2763
+ return;
2764
+ }
2752
2765
  onError(err);
2753
2766
  error.value = err;
2754
2767
  });
@@ -4324,13 +4337,20 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
4324
4337
  return;
4325
4338
  }
4326
4339
  const rawProps = i.vnode.props;
4327
- if (!(rawProps && // check if parent has passed v-model
4328
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
4340
+ const hasVModel = !!(rawProps && // check if parent has passed v-model
4341
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps));
4342
+ if (!hasVModel) {
4329
4343
  localValue = value;
4330
4344
  trigger();
4331
4345
  }
4332
4346
  i.emit(`update:${name}`, emittedValue);
4333
- if (shared.hasChanged(value, emittedValue) && shared.hasChanged(value, prevSetValue) && !shared.hasChanged(emittedValue, prevEmittedValue)) {
4347
+ if (shared.hasChanged(value, prevSetValue) && (shared.hasChanged(value, emittedValue) && !shared.hasChanged(emittedValue, prevEmittedValue) || // #13524: browsers differ in when they flush microtasks between
4348
+ // event listeners. If a v-model listener emits an intermediate value
4349
+ // and a following listener restores the model to its previous prop
4350
+ // value before parent updates are flushed, the parent render can be
4351
+ // deduped as having no prop change. Force a local update so DOM state
4352
+ // such as an input's value is synchronized back to the current model.
4353
+ hasVModel && prevSetValue !== shared.EMPTY_OBJ && !shared.hasChanged(emittedValue, localValue))) {
4334
4354
  trigger();
4335
4355
  }
4336
4356
  prevSetValue = value;
@@ -8564,7 +8584,7 @@ function isMemoSame(cached, memo) {
8564
8584
  return true;
8565
8585
  }
8566
8586
 
8567
- const version = "3.5.35";
8587
+ const version = "3.5.36";
8568
8588
  const warn = warn$1 ;
8569
8589
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8570
8590
  const devtools = devtools$1 ;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.35
2
+ * @vue/runtime-core v3.5.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2048,13 +2048,21 @@ function defineAsyncComponent(source) {
2048
2048
  const loaded = reactivity.ref(false);
2049
2049
  const error = reactivity.ref();
2050
2050
  const delayed = reactivity.ref(!!delay);
2051
+ let timeoutTimer;
2052
+ let delayTimer;
2053
+ onUnmounted(() => {
2054
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
2055
+ if (delayTimer != null) clearTimeout(delayTimer);
2056
+ });
2051
2057
  if (delay) {
2052
- setTimeout(() => {
2058
+ delayTimer = setTimeout(() => {
2059
+ if (instance.isUnmounted) return;
2053
2060
  delayed.value = false;
2054
2061
  }, delay);
2055
2062
  }
2056
2063
  if (timeout != null) {
2057
- setTimeout(() => {
2064
+ timeoutTimer = setTimeout(() => {
2065
+ if (instance.isUnmounted) return;
2058
2066
  if (!loaded.value && !error.value) {
2059
2067
  const err = new Error(
2060
2068
  `Async component timed out after ${timeout}ms.`
@@ -2065,11 +2073,16 @@ function defineAsyncComponent(source) {
2065
2073
  }, timeout);
2066
2074
  }
2067
2075
  load().then(() => {
2076
+ if (instance.isUnmounted) return;
2068
2077
  loaded.value = true;
2069
2078
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
2070
2079
  instance.parent.update();
2071
2080
  }
2072
2081
  }).catch((err) => {
2082
+ if (instance.isUnmounted) {
2083
+ pendingRequest = null;
2084
+ return;
2085
+ }
2073
2086
  onError(err);
2074
2087
  error.value = err;
2075
2088
  });
@@ -3307,13 +3320,20 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
3307
3320
  return;
3308
3321
  }
3309
3322
  const rawProps = i.vnode.props;
3310
- if (!(rawProps && // check if parent has passed v-model
3311
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
3323
+ const hasVModel = !!(rawProps && // check if parent has passed v-model
3324
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps));
3325
+ if (!hasVModel) {
3312
3326
  localValue = value;
3313
3327
  trigger();
3314
3328
  }
3315
3329
  i.emit(`update:${name}`, emittedValue);
3316
- if (shared.hasChanged(value, emittedValue) && shared.hasChanged(value, prevSetValue) && !shared.hasChanged(emittedValue, prevEmittedValue)) {
3330
+ if (shared.hasChanged(value, prevSetValue) && (shared.hasChanged(value, emittedValue) && !shared.hasChanged(emittedValue, prevEmittedValue) || // #13524: browsers differ in when they flush microtasks between
3331
+ // event listeners. If a v-model listener emits an intermediate value
3332
+ // and a following listener restores the model to its previous prop
3333
+ // value before parent updates are flushed, the parent render can be
3334
+ // deduped as having no prop change. Force a local update so DOM state
3335
+ // such as an input's value is synchronized back to the current model.
3336
+ hasVModel && prevSetValue !== shared.EMPTY_OBJ && !shared.hasChanged(emittedValue, localValue))) {
3317
3337
  trigger();
3318
3338
  }
3319
3339
  prevSetValue = value;
@@ -6705,7 +6725,7 @@ function isMemoSame(cached, memo) {
6705
6725
  return true;
6706
6726
  }
6707
6727
 
6708
- const version = "3.5.35";
6728
+ const version = "3.5.36";
6709
6729
  const warn$1 = shared.NOOP;
6710
6730
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
6711
6731
  const devtools = void 0;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.35
2
+ * @vue/runtime-core v3.5.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2742,13 +2742,21 @@ function defineAsyncComponent(source) {
2742
2742
  const loaded = ref(false);
2743
2743
  const error = ref();
2744
2744
  const delayed = ref(!!delay);
2745
+ let timeoutTimer;
2746
+ let delayTimer;
2747
+ onUnmounted(() => {
2748
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
2749
+ if (delayTimer != null) clearTimeout(delayTimer);
2750
+ });
2745
2751
  if (delay) {
2746
- setTimeout(() => {
2752
+ delayTimer = setTimeout(() => {
2753
+ if (instance.isUnmounted) return;
2747
2754
  delayed.value = false;
2748
2755
  }, delay);
2749
2756
  }
2750
2757
  if (timeout != null) {
2751
- setTimeout(() => {
2758
+ timeoutTimer = setTimeout(() => {
2759
+ if (instance.isUnmounted) return;
2752
2760
  if (!loaded.value && !error.value) {
2753
2761
  const err = new Error(
2754
2762
  `Async component timed out after ${timeout}ms.`
@@ -2759,11 +2767,16 @@ function defineAsyncComponent(source) {
2759
2767
  }, timeout);
2760
2768
  }
2761
2769
  load().then(() => {
2770
+ if (instance.isUnmounted) return;
2762
2771
  loaded.value = true;
2763
2772
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
2764
2773
  instance.parent.update();
2765
2774
  }
2766
2775
  }).catch((err) => {
2776
+ if (instance.isUnmounted) {
2777
+ pendingRequest = null;
2778
+ return;
2779
+ }
2767
2780
  onError(err);
2768
2781
  error.value = err;
2769
2782
  });
@@ -4346,13 +4359,20 @@ function useModel(props, name, options = EMPTY_OBJ) {
4346
4359
  return;
4347
4360
  }
4348
4361
  const rawProps = i.vnode.props;
4349
- if (!(rawProps && // check if parent has passed v-model
4350
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
4362
+ const hasVModel = !!(rawProps && // check if parent has passed v-model
4363
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps));
4364
+ if (!hasVModel) {
4351
4365
  localValue = value;
4352
4366
  trigger();
4353
4367
  }
4354
4368
  i.emit(`update:${name}`, emittedValue);
4355
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
4369
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || // #13524: browsers differ in when they flush microtasks between
4370
+ // event listeners. If a v-model listener emits an intermediate value
4371
+ // and a following listener restores the model to its previous prop
4372
+ // value before parent updates are flushed, the parent render can be
4373
+ // deduped as having no prop change. Force a local update so DOM state
4374
+ // such as an input's value is synchronized back to the current model.
4375
+ hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) {
4356
4376
  trigger();
4357
4377
  }
4358
4378
  prevSetValue = value;
@@ -8638,7 +8658,7 @@ function isMemoSame(cached, memo) {
8638
8658
  return true;
8639
8659
  }
8640
8660
 
8641
- const version = "3.5.35";
8661
+ const version = "3.5.36";
8642
8662
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
8643
8663
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8644
8664
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.5.35",
3
+ "version": "3.5.36",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
48
48
  "dependencies": {
49
- "@vue/shared": "3.5.35",
50
- "@vue/reactivity": "3.5.35"
49
+ "@vue/shared": "3.5.36",
50
+ "@vue/reactivity": "3.5.36"
51
51
  }
52
52
  }