vue 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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.35
2
+ * vue v3.5.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.35
2
+ * vue v3.5.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.35
2
+ * vue v3.5.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2240,8 +2240,9 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2240
2240
  if (once && cb) {
2241
2241
  const _cb = cb;
2242
2242
  cb = (...args) => {
2243
- _cb(...args);
2243
+ const res = _cb(...args);
2244
2244
  watchHandle();
2245
+ return res;
2245
2246
  };
2246
2247
  }
2247
2248
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -2251,7 +2252,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2251
2252
  }
2252
2253
  if (cb) {
2253
2254
  const newValue = effect.run();
2254
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2255
+ if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2255
2256
  if (cleanup) {
2256
2257
  cleanup();
2257
2258
  }
@@ -5064,13 +5065,21 @@ function defineAsyncComponent(source) {
5064
5065
  const loaded = ref(false);
5065
5066
  const error = ref();
5066
5067
  const delayed = ref(!!delay);
5068
+ let timeoutTimer;
5069
+ let delayTimer;
5070
+ onUnmounted(() => {
5071
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
5072
+ if (delayTimer != null) clearTimeout(delayTimer);
5073
+ });
5067
5074
  if (delay) {
5068
- setTimeout(() => {
5075
+ delayTimer = setTimeout(() => {
5076
+ if (instance.isUnmounted) return;
5069
5077
  delayed.value = false;
5070
5078
  }, delay);
5071
5079
  }
5072
5080
  if (timeout != null) {
5073
- setTimeout(() => {
5081
+ timeoutTimer = setTimeout(() => {
5082
+ if (instance.isUnmounted) return;
5074
5083
  if (!loaded.value && !error.value) {
5075
5084
  const err = new Error(
5076
5085
  `Async component timed out after ${timeout}ms.`
@@ -5081,11 +5090,16 @@ function defineAsyncComponent(source) {
5081
5090
  }, timeout);
5082
5091
  }
5083
5092
  load().then(() => {
5093
+ if (instance.isUnmounted) return;
5084
5094
  loaded.value = true;
5085
5095
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
5086
5096
  instance.parent.update();
5087
5097
  }
5088
5098
  }).catch((err) => {
5099
+ if (instance.isUnmounted) {
5100
+ pendingRequest = null;
5101
+ return;
5102
+ }
5089
5103
  onError(err);
5090
5104
  error.value = err;
5091
5105
  });
@@ -6664,13 +6678,20 @@ function useModel(props, name, options = EMPTY_OBJ) {
6664
6678
  return;
6665
6679
  }
6666
6680
  const rawProps = i.vnode.props;
6667
- if (!(rawProps && // check if parent has passed v-model
6668
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
6681
+ const hasVModel = !!(rawProps && // check if parent has passed v-model
6682
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps));
6683
+ if (!hasVModel) {
6669
6684
  localValue = value;
6670
6685
  trigger();
6671
6686
  }
6672
6687
  i.emit(`update:${name}`, emittedValue);
6673
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
6688
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || // #13524: browsers differ in when they flush microtasks between
6689
+ // event listeners. If a v-model listener emits an intermediate value
6690
+ // and a following listener restores the model to its previous prop
6691
+ // value before parent updates are flushed, the parent render can be
6692
+ // deduped as having no prop change. Force a local update so DOM state
6693
+ // such as an input's value is synchronized back to the current model.
6694
+ hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) {
6674
6695
  trigger();
6675
6696
  }
6676
6697
  prevSetValue = value;
@@ -10904,7 +10925,7 @@ function isMemoSame(cached, memo) {
10904
10925
  return true;
10905
10926
  }
10906
10927
 
10907
- const version = "3.5.35";
10928
+ const version = "3.5.36";
10908
10929
  const warn = warn$1 ;
10909
10930
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10910
10931
  const devtools = devtools$1 ;
@@ -12380,7 +12401,8 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
12380
12401
  if (children) {
12381
12402
  for (let i = 0; i < children.length; i++) {
12382
12403
  const child = children[i];
12383
- if (child.el && child.el instanceof Element) {
12404
+ if (child.el && child.el instanceof Element && // Hidden v-show nodes have no previous layout box to animate from.
12405
+ !child.el[vShowHidden]) {
12384
12406
  prevChildren.push(child);
12385
12407
  setTransitionHooks(
12386
12408
  child,
@@ -14834,7 +14856,7 @@ const tokenizer = new Tokenizer(stack, {
14834
14856
  }
14835
14857
  },
14836
14858
  oncdata(start, end) {
14837
- if (stack[0].ns !== 0) {
14859
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) {
14838
14860
  onText(getSlice(start, end), start, end);
14839
14861
  } else {
14840
14862
  emitError(1, start - 9);
@@ -15534,6 +15556,7 @@ function createTransformContext(root, {
15534
15556
  imports: [],
15535
15557
  cached: [],
15536
15558
  constantCache: /* @__PURE__ */ new WeakMap(),
15559
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
15537
15560
  temps: 0,
15538
15561
  identifiers: /* @__PURE__ */ Object.create(null),
15539
15562
  scopes: {
@@ -16385,7 +16408,7 @@ const transformExpression = (node, context) => {
16385
16408
  const exp = dir.exp;
16386
16409
  const arg = dir.arg;
16387
16410
  if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor)
16388
- !(memo && arg && arg.type === 4 && arg.content === "key")) {
16411
+ !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) {
16389
16412
  dir.exp = processExpression(
16390
16413
  exp,
16391
16414
  context,