@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
  **/
@@ -2250,8 +2250,9 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2250
2250
  if (once && cb) {
2251
2251
  const _cb = cb;
2252
2252
  cb = (...args) => {
2253
- _cb(...args);
2253
+ const res = _cb(...args);
2254
2254
  watchHandle();
2255
+ return res;
2255
2256
  };
2256
2257
  }
2257
2258
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -2261,7 +2262,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2261
2262
  }
2262
2263
  if (cb) {
2263
2264
  const newValue = effect.run();
2264
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2265
+ if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2265
2266
  if (cleanup) {
2266
2267
  cleanup();
2267
2268
  }
@@ -5566,13 +5567,21 @@ function defineAsyncComponent(source) {
5566
5567
  const loaded = ref(false);
5567
5568
  const error = ref();
5568
5569
  const delayed = ref(!!delay);
5570
+ let timeoutTimer;
5571
+ let delayTimer;
5572
+ onUnmounted(() => {
5573
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
5574
+ if (delayTimer != null) clearTimeout(delayTimer);
5575
+ });
5569
5576
  if (delay) {
5570
- setTimeout(() => {
5577
+ delayTimer = setTimeout(() => {
5578
+ if (instance.isUnmounted) return;
5571
5579
  delayed.value = false;
5572
5580
  }, delay);
5573
5581
  }
5574
5582
  if (timeout != null) {
5575
- setTimeout(() => {
5583
+ timeoutTimer = setTimeout(() => {
5584
+ if (instance.isUnmounted) return;
5576
5585
  if (!loaded.value && !error.value) {
5577
5586
  const err = new Error(
5578
5587
  `Async component timed out after ${timeout}ms.`
@@ -5583,11 +5592,16 @@ function defineAsyncComponent(source) {
5583
5592
  }, timeout);
5584
5593
  }
5585
5594
  load().then(() => {
5595
+ if (instance.isUnmounted) return;
5586
5596
  loaded.value = true;
5587
5597
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
5588
5598
  instance.parent.update();
5589
5599
  }
5590
5600
  }).catch((err) => {
5601
+ if (instance.isUnmounted) {
5602
+ pendingRequest = null;
5603
+ return;
5604
+ }
5591
5605
  onError(err);
5592
5606
  error.value = err;
5593
5607
  });
@@ -7574,7 +7588,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7574
7588
  return vm;
7575
7589
  }
7576
7590
  }
7577
- Vue.version = `2.6.14-compat:${"3.5.35"}`;
7591
+ Vue.version = `2.6.14-compat:${"3.5.37"}`;
7578
7592
  Vue.config = singletonApp.config;
7579
7593
  Vue.use = (plugin, ...options) => {
7580
7594
  if (plugin && isFunction(plugin.install)) {
@@ -7914,6 +7928,9 @@ function defineReactive(obj, key, val) {
7914
7928
  try {
7915
7929
  defineReactiveSimple(val, key2, val[key2]);
7916
7930
  } catch (e) {
7931
+ if (!!(process.env.NODE_ENV !== "production")) {
7932
+ warn$1(`Failed making property "${key2}" reactive:`, e);
7933
+ }
7917
7934
  }
7918
7935
  });
7919
7936
  }
@@ -8254,13 +8271,20 @@ function useModel(props, name, options = EMPTY_OBJ) {
8254
8271
  return;
8255
8272
  }
8256
8273
  const rawProps = i.vnode.props;
8257
- if (!(rawProps && // check if parent has passed v-model
8258
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
8274
+ const hasVModel = !!(rawProps && // check if parent has passed v-model
8275
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps));
8276
+ if (!hasVModel) {
8259
8277
  localValue = value;
8260
8278
  trigger();
8261
8279
  }
8262
8280
  i.emit(`update:${name}`, emittedValue);
8263
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
8281
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || // #13524: browsers differ in when they flush microtasks between
8282
+ // event listeners. If a v-model listener emits an intermediate value
8283
+ // and a following listener restores the model to its previous prop
8284
+ // value before parent updates are flushed, the parent render can be
8285
+ // deduped as having no prop change. Force a local update so DOM state
8286
+ // such as an input's value is synchronized back to the current model.
8287
+ hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) {
8264
8288
  trigger();
8265
8289
  }
8266
8290
  prevSetValue = value;
@@ -12760,7 +12784,7 @@ function isMemoSame(cached, memo) {
12760
12784
  return true;
12761
12785
  }
12762
12786
 
12763
- const version = "3.5.35";
12787
+ const version = "3.5.37";
12764
12788
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12765
12789
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12766
12790
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -14333,7 +14357,8 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
14333
14357
  if (children) {
14334
14358
  for (let i = 0; i < children.length; i++) {
14335
14359
  const child = children[i];
14336
- if (child.el && child.el instanceof Element) {
14360
+ if (child.el && child.el instanceof Element && // Hidden v-show nodes have no previous layout box to animate from.
14361
+ !child.el[vShowHidden]) {
14337
14362
  prevChildren.push(child);
14338
14363
  setTransitionHooks(
14339
14364
  child,
@@ -16928,7 +16953,7 @@ const tokenizer = new Tokenizer(stack, {
16928
16953
  }
16929
16954
  },
16930
16955
  oncdata(start, end) {
16931
- if (stack[0].ns !== 0) {
16956
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) {
16932
16957
  onText(getSlice(start, end), start, end);
16933
16958
  } else {
16934
16959
  emitError(1, start - 9);
@@ -17700,6 +17725,7 @@ function createTransformContext(root, {
17700
17725
  imports: [],
17701
17726
  cached: [],
17702
17727
  constantCache: /* @__PURE__ */ new WeakMap(),
17728
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
17703
17729
  temps: 0,
17704
17730
  identifiers: /* @__PURE__ */ Object.create(null),
17705
17731
  scopes: {
@@ -18567,7 +18593,7 @@ const transformExpression = (node, context) => {
18567
18593
  const exp = dir.exp;
18568
18594
  const arg = dir.arg;
18569
18595
  if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor)
18570
- !(memo && arg && arg.type === 4 && arg.content === "key")) {
18596
+ !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) {
18571
18597
  dir.exp = processExpression(
18572
18598
  exp,
18573
18599
  context,
@@ -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
  **/
@@ -2243,8 +2243,9 @@ var Vue = (function () {
2243
2243
  if (once && cb) {
2244
2244
  const _cb = cb;
2245
2245
  cb = (...args) => {
2246
- _cb(...args);
2246
+ const res = _cb(...args);
2247
2247
  watchHandle();
2248
+ return res;
2248
2249
  };
2249
2250
  }
2250
2251
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -2254,7 +2255,7 @@ var Vue = (function () {
2254
2255
  }
2255
2256
  if (cb) {
2256
2257
  const newValue = effect.run();
2257
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2258
+ if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2258
2259
  if (cleanup) {
2259
2260
  cleanup();
2260
2261
  }
@@ -5511,13 +5512,21 @@ Server rendered element contains fewer child nodes than client vdom.`
5511
5512
  const loaded = ref(false);
5512
5513
  const error = ref();
5513
5514
  const delayed = ref(!!delay);
5515
+ let timeoutTimer;
5516
+ let delayTimer;
5517
+ onUnmounted(() => {
5518
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
5519
+ if (delayTimer != null) clearTimeout(delayTimer);
5520
+ });
5514
5521
  if (delay) {
5515
- setTimeout(() => {
5522
+ delayTimer = setTimeout(() => {
5523
+ if (instance.isUnmounted) return;
5516
5524
  delayed.value = false;
5517
5525
  }, delay);
5518
5526
  }
5519
5527
  if (timeout != null) {
5520
- setTimeout(() => {
5528
+ timeoutTimer = setTimeout(() => {
5529
+ if (instance.isUnmounted) return;
5521
5530
  if (!loaded.value && !error.value) {
5522
5531
  const err = new Error(
5523
5532
  `Async component timed out after ${timeout}ms.`
@@ -5528,11 +5537,16 @@ Server rendered element contains fewer child nodes than client vdom.`
5528
5537
  }, timeout);
5529
5538
  }
5530
5539
  load().then(() => {
5540
+ if (instance.isUnmounted) return;
5531
5541
  loaded.value = true;
5532
5542
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
5533
5543
  instance.parent.update();
5534
5544
  }
5535
5545
  }).catch((err) => {
5546
+ if (instance.isUnmounted) {
5547
+ pendingRequest = null;
5548
+ return;
5549
+ }
5536
5550
  onError(err);
5537
5551
  error.value = err;
5538
5552
  });
@@ -7508,7 +7522,7 @@ If this is a native custom element, make sure to exclude it from component resol
7508
7522
  return vm;
7509
7523
  }
7510
7524
  }
7511
- Vue.version = `2.6.14-compat:${"3.5.35"}`;
7525
+ Vue.version = `2.6.14-compat:${"3.5.37"}`;
7512
7526
  Vue.config = singletonApp.config;
7513
7527
  Vue.use = (plugin, ...options) => {
7514
7528
  if (plugin && isFunction(plugin.install)) {
@@ -7848,6 +7862,9 @@ If this is a native custom element, make sure to exclude it from component resol
7848
7862
  try {
7849
7863
  defineReactiveSimple(val, key2, val[key2]);
7850
7864
  } catch (e) {
7865
+ {
7866
+ warn$1(`Failed making property "${key2}" reactive:`, e);
7867
+ }
7851
7868
  }
7852
7869
  });
7853
7870
  }
@@ -8186,13 +8203,20 @@ If you want to remount the same app, move your app creation logic into a factory
8186
8203
  return;
8187
8204
  }
8188
8205
  const rawProps = i.vnode.props;
8189
- if (!(rawProps && // check if parent has passed v-model
8190
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
8206
+ const hasVModel = !!(rawProps && // check if parent has passed v-model
8207
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps));
8208
+ if (!hasVModel) {
8191
8209
  localValue = value;
8192
8210
  trigger();
8193
8211
  }
8194
8212
  i.emit(`update:${name}`, emittedValue);
8195
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
8213
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || // #13524: browsers differ in when they flush microtasks between
8214
+ // event listeners. If a v-model listener emits an intermediate value
8215
+ // and a following listener restores the model to its previous prop
8216
+ // value before parent updates are flushed, the parent render can be
8217
+ // deduped as having no prop change. Force a local update so DOM state
8218
+ // such as an input's value is synchronized back to the current model.
8219
+ hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) {
8196
8220
  trigger();
8197
8221
  }
8198
8222
  prevSetValue = value;
@@ -12626,7 +12650,7 @@ Component that was made reactive: `,
12626
12650
  return true;
12627
12651
  }
12628
12652
 
12629
- const version = "3.5.35";
12653
+ const version = "3.5.37";
12630
12654
  const warn = warn$1 ;
12631
12655
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12632
12656
  const devtools = devtools$1 ;
@@ -14168,7 +14192,8 @@ Expected function or array of functions, received type ${typeof value}.`
14168
14192
  if (children) {
14169
14193
  for (let i = 0; i < children.length; i++) {
14170
14194
  const child = children[i];
14171
- if (child.el && child.el instanceof Element) {
14195
+ if (child.el && child.el instanceof Element && // Hidden v-show nodes have no previous layout box to animate from.
14196
+ !child.el[vShowHidden]) {
14172
14197
  prevChildren.push(child);
14173
14198
  setTransitionHooks(
14174
14199
  child,
@@ -16728,7 +16753,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
16728
16753
  }
16729
16754
  },
16730
16755
  oncdata(start, end) {
16731
- if (stack[0].ns !== 0) {
16756
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) {
16732
16757
  onText(getSlice(start, end), start, end);
16733
16758
  } else {
16734
16759
  emitError(1, start - 9);
@@ -17499,6 +17524,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17499
17524
  imports: [],
17500
17525
  cached: [],
17501
17526
  constantCache: /* @__PURE__ */ new WeakMap(),
17527
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
17502
17528
  temps: 0,
17503
17529
  identifiers: /* @__PURE__ */ Object.create(null),
17504
17530
  scopes: {
@@ -18364,7 +18390,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
18364
18390
  const exp = dir.exp;
18365
18391
  const arg = dir.arg;
18366
18392
  if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor)
18367
- !(memo && arg && arg.type === 4 && arg.content === "key")) {
18393
+ !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) {
18368
18394
  dir.exp = processExpression(
18369
18395
  exp,
18370
18396
  context,