@vue/compat 3.4.35 → 3.4.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.4.35
2
+ * @vue/compat v3.4.37
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -817,7 +817,7 @@ class BaseReactiveHandler {
817
817
  return isShallow2;
818
818
  } else if (key === "__v_raw") {
819
819
  if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
820
- // this means the reciever is a user proxy of the reactive proxy
820
+ // this means the receiver is a user proxy of the reactive proxy
821
821
  Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
822
822
  return target;
823
823
  }
@@ -3480,7 +3480,7 @@ const KeepAliveImpl = {
3480
3480
  }
3481
3481
  function pruneCacheEntry(key) {
3482
3482
  const cached = cache.get(key);
3483
- if (!current || !isSameVNodeType(cached, current)) {
3483
+ if (cached && (!current || !isSameVNodeType(cached, current))) {
3484
3484
  unmount(cached);
3485
3485
  } else if (current) {
3486
3486
  resetShapeFlag(current);
@@ -3542,6 +3542,10 @@ const KeepAliveImpl = {
3542
3542
  return rawVNode;
3543
3543
  }
3544
3544
  let vnode = getInnerChild(rawVNode);
3545
+ if (vnode.type === Comment) {
3546
+ current = null;
3547
+ return vnode;
3548
+ }
3545
3549
  const comp = vnode.type;
3546
3550
  const name = getComponentName(
3547
3551
  isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
@@ -5261,7 +5265,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5261
5265
  return vm;
5262
5266
  }
5263
5267
  }
5264
- Vue.version = `2.6.14-compat:${"3.4.35"}`;
5268
+ Vue.version = `2.6.14-compat:${"3.4.37"}`;
5265
5269
  Vue.config = singletonApp.config;
5266
5270
  Vue.use = (plugin, ...options) => {
5267
5271
  if (plugin && isFunction(plugin.install)) {
@@ -5839,7 +5843,7 @@ function provide(key, value) {
5839
5843
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
5840
5844
  const instance = currentInstance || currentRenderingInstance;
5841
5845
  if (instance || currentApp) {
5842
- const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
5846
+ const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
5843
5847
  if (provides && key in provides) {
5844
5848
  return provides[key];
5845
5849
  } else if (arguments.length > 1) {
@@ -7105,6 +7109,7 @@ Server rendered element contains more child nodes than client vdom.`
7105
7109
  }
7106
7110
  if (props) {
7107
7111
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) {
7112
+ const isCustomElement = el.tagName.includes("-");
7108
7113
  for (const key in props) {
7109
7114
  if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && // #11189 skip if this node has directives that have created hooks
7110
7115
  // as it could have mutated the DOM in any possible way
@@ -7112,7 +7117,7 @@ Server rendered element contains more child nodes than client vdom.`
7112
7117
  logMismatchError();
7113
7118
  }
7114
7119
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7115
- key[0] === ".") {
7120
+ key[0] === "." || isCustomElement) {
7116
7121
  patchProp(el, key, null, props[key], void 0, parentComponent);
7117
7122
  }
7118
7123
  }
@@ -8893,13 +8898,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8893
8898
  namespace
8894
8899
  );
8895
8900
  }
8901
+ container._vnode = vnode;
8896
8902
  if (!isFlushing) {
8897
8903
  isFlushing = true;
8898
8904
  flushPreFlushCbs();
8899
8905
  flushPostFlushCbs();
8900
8906
  isFlushing = false;
8901
8907
  }
8902
- container._vnode = vnode;
8903
8908
  };
8904
8909
  const internals = {
8905
8910
  p: patch,
@@ -9337,7 +9342,8 @@ function useModel(props, name, options = EMPTY_OBJ) {
9337
9342
  return options.get ? options.get(localValue) : localValue;
9338
9343
  },
9339
9344
  set(value) {
9340
- if (!hasChanged(value, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
9345
+ const emittedValue = options.set ? options.set(value) : value;
9346
+ if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
9341
9347
  return;
9342
9348
  }
9343
9349
  const rawProps = i.vnode.props;
@@ -9346,7 +9352,6 @@ function useModel(props, name, options = EMPTY_OBJ) {
9346
9352
  localValue = value;
9347
9353
  trigger();
9348
9354
  }
9349
- const emittedValue = options.set ? options.set(value) : value;
9350
9355
  i.emit(`update:${name}`, emittedValue);
9351
9356
  if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
9352
9357
  trigger();
@@ -9384,9 +9389,9 @@ function emit(instance, event, ...rawArgs) {
9384
9389
  } = instance;
9385
9390
  if (emitsOptions) {
9386
9391
  if (!(event in emitsOptions) && !(event.startsWith("hook:") || event.startsWith(compatModelEventPrefix))) {
9387
- if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
9392
+ if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
9388
9393
  warn$1(
9389
- `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
9394
+ `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
9390
9395
  );
9391
9396
  }
9392
9397
  } else {
@@ -11547,7 +11552,7 @@ function isMemoSame(cached, memo) {
11547
11552
  return true;
11548
11553
  }
11549
11554
 
11550
- const version = "3.4.35";
11555
+ const version = "3.4.37";
11551
11556
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
11552
11557
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11553
11558
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -11559,7 +11564,8 @@ const _ssrUtils = {
11559
11564
  setCurrentRenderingInstance,
11560
11565
  isVNode: isVNode,
11561
11566
  normalizeVNode,
11562
- getComponentPublicInstance
11567
+ getComponentPublicInstance,
11568
+ ensureValidVNode
11563
11569
  };
11564
11570
  const ssrUtils = _ssrUtils ;
11565
11571
  const resolveFilter = resolveFilter$1 ;
@@ -12030,8 +12036,10 @@ function useCssVars(getter) {
12030
12036
  setVarsOnVNode(instance.subTree, vars);
12031
12037
  updateTeleports(vars);
12032
12038
  };
12033
- onMounted(() => {
12039
+ onBeforeMount(() => {
12034
12040
  watchPostEffect(setVars);
12041
+ });
12042
+ onMounted(() => {
12035
12043
  const ob = new MutationObserver(setVars);
12036
12044
  ob.observe(instance.subTree.el.parentNode, { childList: true });
12037
12045
  onUnmounted(() => ob.disconnect());
@@ -17701,7 +17709,7 @@ function resolveComponentType(node, context, ssr = false) {
17701
17709
  } else {
17702
17710
  exp = isProp.exp;
17703
17711
  if (!exp) {
17704
- exp = createSimpleExpression(`is`, false, isProp.loc);
17712
+ exp = createSimpleExpression(`is`, false, isProp.arg.loc);
17705
17713
  }
17706
17714
  }
17707
17715
  if (exp) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.4.35
2
+ * @vue/compat v3.4.37
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -820,7 +820,7 @@ var Vue = (function () {
820
820
  return isShallow2;
821
821
  } else if (key === "__v_raw") {
822
822
  if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
823
- // this means the reciever is a user proxy of the reactive proxy
823
+ // this means the receiver is a user proxy of the reactive proxy
824
824
  Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
825
825
  return target;
826
826
  }
@@ -3470,7 +3470,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3470
3470
  }
3471
3471
  function pruneCacheEntry(key) {
3472
3472
  const cached = cache.get(key);
3473
- if (!current || !isSameVNodeType(cached, current)) {
3473
+ if (cached && (!current || !isSameVNodeType(cached, current))) {
3474
3474
  unmount(cached);
3475
3475
  } else if (current) {
3476
3476
  resetShapeFlag(current);
@@ -3532,6 +3532,10 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3532
3532
  return rawVNode;
3533
3533
  }
3534
3534
  let vnode = getInnerChild(rawVNode);
3535
+ if (vnode.type === Comment) {
3536
+ current = null;
3537
+ return vnode;
3538
+ }
3535
3539
  const comp = vnode.type;
3536
3540
  const name = getComponentName(
3537
3541
  isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
@@ -5249,7 +5253,7 @@ If this is a native custom element, make sure to exclude it from component resol
5249
5253
  return vm;
5250
5254
  }
5251
5255
  }
5252
- Vue.version = `2.6.14-compat:${"3.4.35"}`;
5256
+ Vue.version = `2.6.14-compat:${"3.4.37"}`;
5253
5257
  Vue.config = singletonApp.config;
5254
5258
  Vue.use = (plugin, ...options) => {
5255
5259
  if (plugin && isFunction(plugin.install)) {
@@ -5825,7 +5829,7 @@ If you want to remount the same app, move your app creation logic into a factory
5825
5829
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
5826
5830
  const instance = currentInstance || currentRenderingInstance;
5827
5831
  if (instance || currentApp) {
5828
- const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
5832
+ const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
5829
5833
  if (provides && key in provides) {
5830
5834
  return provides[key];
5831
5835
  } else if (arguments.length > 1) {
@@ -7091,6 +7095,7 @@ Server rendered element contains more child nodes than client vdom.`
7091
7095
  }
7092
7096
  if (props) {
7093
7097
  {
7098
+ const isCustomElement = el.tagName.includes("-");
7094
7099
  for (const key in props) {
7095
7100
  if (// #11189 skip if this node has directives that have created hooks
7096
7101
  // as it could have mutated the DOM in any possible way
@@ -7098,7 +7103,7 @@ Server rendered element contains more child nodes than client vdom.`
7098
7103
  logMismatchError();
7099
7104
  }
7100
7105
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7101
- key[0] === ".") {
7106
+ key[0] === "." || isCustomElement) {
7102
7107
  patchProp(el, key, null, props[key], void 0, parentComponent);
7103
7108
  }
7104
7109
  }
@@ -8830,13 +8835,13 @@ Server rendered element contains fewer child nodes than client vdom.`
8830
8835
  namespace
8831
8836
  );
8832
8837
  }
8838
+ container._vnode = vnode;
8833
8839
  if (!isFlushing) {
8834
8840
  isFlushing = true;
8835
8841
  flushPreFlushCbs();
8836
8842
  flushPostFlushCbs();
8837
8843
  isFlushing = false;
8838
8844
  }
8839
- container._vnode = vnode;
8840
8845
  };
8841
8846
  const internals = {
8842
8847
  p: patch,
@@ -9248,7 +9253,8 @@ Server rendered element contains fewer child nodes than client vdom.`
9248
9253
  return options.get ? options.get(localValue) : localValue;
9249
9254
  },
9250
9255
  set(value) {
9251
- if (!hasChanged(value, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
9256
+ const emittedValue = options.set ? options.set(value) : value;
9257
+ if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
9252
9258
  return;
9253
9259
  }
9254
9260
  const rawProps = i.vnode.props;
@@ -9257,7 +9263,6 @@ Server rendered element contains fewer child nodes than client vdom.`
9257
9263
  localValue = value;
9258
9264
  trigger();
9259
9265
  }
9260
- const emittedValue = options.set ? options.set(value) : value;
9261
9266
  i.emit(`update:${name}`, emittedValue);
9262
9267
  if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
9263
9268
  trigger();
@@ -9295,9 +9300,9 @@ Server rendered element contains fewer child nodes than client vdom.`
9295
9300
  } = instance;
9296
9301
  if (emitsOptions) {
9297
9302
  if (!(event in emitsOptions) && !(event.startsWith("hook:") || event.startsWith(compatModelEventPrefix))) {
9298
- if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
9303
+ if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
9299
9304
  warn$1(
9300
- `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
9305
+ `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
9301
9306
  );
9302
9307
  }
9303
9308
  } else {
@@ -11430,7 +11435,7 @@ Component that was made reactive: `,
11430
11435
  return true;
11431
11436
  }
11432
11437
 
11433
- const version = "3.4.35";
11438
+ const version = "3.4.37";
11434
11439
  const warn = warn$1 ;
11435
11440
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11436
11441
  const devtools = devtools$1 ;
@@ -11897,8 +11902,10 @@ Component that was made reactive: `,
11897
11902
  setVarsOnVNode(instance.subTree, vars);
11898
11903
  updateTeleports(vars);
11899
11904
  };
11900
- onMounted(() => {
11905
+ onBeforeMount(() => {
11901
11906
  watchPostEffect(setVars);
11907
+ });
11908
+ onMounted(() => {
11902
11909
  const ob = new MutationObserver(setVars);
11903
11910
  ob.observe(instance.subTree.el.parentNode, { childList: true });
11904
11911
  onUnmounted(() => ob.disconnect());
@@ -17518,7 +17525,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17518
17525
  } else {
17519
17526
  exp = isProp.exp;
17520
17527
  if (!exp) {
17521
- exp = createSimpleExpression(`is`, false, isProp.loc);
17528
+ exp = createSimpleExpression(`is`, false, isProp.arg.loc);
17522
17529
  }
17523
17530
  }
17524
17531
  if (exp) {