@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
  }
@@ -3467,7 +3467,7 @@ const KeepAliveImpl = {
3467
3467
  }
3468
3468
  function pruneCacheEntry(key) {
3469
3469
  const cached = cache.get(key);
3470
- if (!current || !isSameVNodeType(cached, current)) {
3470
+ if (cached && (!current || !isSameVNodeType(cached, current))) {
3471
3471
  unmount(cached);
3472
3472
  } else if (current) {
3473
3473
  resetShapeFlag(current);
@@ -3529,6 +3529,10 @@ const KeepAliveImpl = {
3529
3529
  return rawVNode;
3530
3530
  }
3531
3531
  let vnode = getInnerChild(rawVNode);
3532
+ if (vnode.type === Comment) {
3533
+ current = null;
3534
+ return vnode;
3535
+ }
3532
3536
  const comp = vnode.type;
3533
3537
  const name = getComponentName(
3534
3538
  isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
@@ -5246,7 +5250,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5246
5250
  return vm;
5247
5251
  }
5248
5252
  }
5249
- Vue.version = `2.6.14-compat:${"3.4.35"}`;
5253
+ Vue.version = `2.6.14-compat:${"3.4.37"}`;
5250
5254
  Vue.config = singletonApp.config;
5251
5255
  Vue.use = (plugin, ...options) => {
5252
5256
  if (plugin && isFunction(plugin.install)) {
@@ -5822,7 +5826,7 @@ function provide(key, value) {
5822
5826
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
5823
5827
  const instance = currentInstance || currentRenderingInstance;
5824
5828
  if (instance || currentApp) {
5825
- const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
5829
+ const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
5826
5830
  if (provides && key in provides) {
5827
5831
  return provides[key];
5828
5832
  } else if (arguments.length > 1) {
@@ -7088,6 +7092,7 @@ Server rendered element contains more child nodes than client vdom.`
7088
7092
  }
7089
7093
  if (props) {
7090
7094
  {
7095
+ const isCustomElement = el.tagName.includes("-");
7091
7096
  for (const key in props) {
7092
7097
  if (// #11189 skip if this node has directives that have created hooks
7093
7098
  // as it could have mutated the DOM in any possible way
@@ -7095,7 +7100,7 @@ Server rendered element contains more child nodes than client vdom.`
7095
7100
  logMismatchError();
7096
7101
  }
7097
7102
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7098
- key[0] === ".") {
7103
+ key[0] === "." || isCustomElement) {
7099
7104
  patchProp(el, key, null, props[key], void 0, parentComponent);
7100
7105
  }
7101
7106
  }
@@ -8827,13 +8832,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8827
8832
  namespace
8828
8833
  );
8829
8834
  }
8835
+ container._vnode = vnode;
8830
8836
  if (!isFlushing) {
8831
8837
  isFlushing = true;
8832
8838
  flushPreFlushCbs();
8833
8839
  flushPostFlushCbs();
8834
8840
  isFlushing = false;
8835
8841
  }
8836
- container._vnode = vnode;
8837
8842
  };
8838
8843
  const internals = {
8839
8844
  p: patch,
@@ -9251,7 +9256,8 @@ function useModel(props, name, options = EMPTY_OBJ) {
9251
9256
  return options.get ? options.get(localValue) : localValue;
9252
9257
  },
9253
9258
  set(value) {
9254
- if (!hasChanged(value, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
9259
+ const emittedValue = options.set ? options.set(value) : value;
9260
+ if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
9255
9261
  return;
9256
9262
  }
9257
9263
  const rawProps = i.vnode.props;
@@ -9260,7 +9266,6 @@ function useModel(props, name, options = EMPTY_OBJ) {
9260
9266
  localValue = value;
9261
9267
  trigger();
9262
9268
  }
9263
- const emittedValue = options.set ? options.set(value) : value;
9264
9269
  i.emit(`update:${name}`, emittedValue);
9265
9270
  if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
9266
9271
  trigger();
@@ -9298,9 +9303,9 @@ function emit(instance, event, ...rawArgs) {
9298
9303
  } = instance;
9299
9304
  if (emitsOptions) {
9300
9305
  if (!(event in emitsOptions) && !(event.startsWith("hook:") || event.startsWith(compatModelEventPrefix))) {
9301
- if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
9306
+ if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
9302
9307
  warn$1(
9303
- `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
9308
+ `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
9304
9309
  );
9305
9310
  }
9306
9311
  } else {
@@ -11433,7 +11438,7 @@ function isMemoSame(cached, memo) {
11433
11438
  return true;
11434
11439
  }
11435
11440
 
11436
- const version = "3.4.35";
11441
+ const version = "3.4.37";
11437
11442
  const warn = warn$1 ;
11438
11443
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11439
11444
  const devtools = devtools$1 ;
@@ -11900,8 +11905,10 @@ function useCssVars(getter) {
11900
11905
  setVarsOnVNode(instance.subTree, vars);
11901
11906
  updateTeleports(vars);
11902
11907
  };
11903
- onMounted(() => {
11908
+ onBeforeMount(() => {
11904
11909
  watchPostEffect(setVars);
11910
+ });
11911
+ onMounted(() => {
11905
11912
  const ob = new MutationObserver(setVars);
11906
11913
  ob.observe(instance.subTree.el.parentNode, { childList: true });
11907
11914
  onUnmounted(() => ob.disconnect());
@@ -17533,7 +17540,7 @@ function resolveComponentType(node, context, ssr = false) {
17533
17540
  } else {
17534
17541
  exp = isProp.exp;
17535
17542
  if (!exp) {
17536
- exp = createSimpleExpression(`is`, false, isProp.loc);
17543
+ exp = createSimpleExpression(`is`, false, isProp.arg.loc);
17537
17544
  }
17538
17545
  }
17539
17546
  if (exp) {