@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
  **/
@@ -750,7 +750,7 @@ class BaseReactiveHandler {
750
750
  return isShallow2;
751
751
  } else if (key === "__v_raw") {
752
752
  if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
753
- // this means the reciever is a user proxy of the reactive proxy
753
+ // this means the receiver is a user proxy of the reactive proxy
754
754
  Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
755
755
  return target;
756
756
  }
@@ -3400,7 +3400,7 @@ const KeepAliveImpl = {
3400
3400
  }
3401
3401
  function pruneCacheEntry(key) {
3402
3402
  const cached = cache.get(key);
3403
- if (!current || !isSameVNodeType(cached, current)) {
3403
+ if (cached && (!current || !isSameVNodeType(cached, current))) {
3404
3404
  unmount(cached);
3405
3405
  } else if (current) {
3406
3406
  resetShapeFlag(current);
@@ -3462,6 +3462,10 @@ const KeepAliveImpl = {
3462
3462
  return rawVNode;
3463
3463
  }
3464
3464
  let vnode = getInnerChild(rawVNode);
3465
+ if (vnode.type === Comment) {
3466
+ current = null;
3467
+ return vnode;
3468
+ }
3465
3469
  const comp = vnode.type;
3466
3470
  const name = getComponentName(
3467
3471
  isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
@@ -5179,7 +5183,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5179
5183
  return vm;
5180
5184
  }
5181
5185
  }
5182
- Vue.version = `2.6.14-compat:${"3.4.35"}`;
5186
+ Vue.version = `2.6.14-compat:${"3.4.37"}`;
5183
5187
  Vue.config = singletonApp.config;
5184
5188
  Vue.use = (plugin, ...options) => {
5185
5189
  if (plugin && isFunction(plugin.install)) {
@@ -5755,7 +5759,7 @@ function provide(key, value) {
5755
5759
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
5756
5760
  const instance = currentInstance || currentRenderingInstance;
5757
5761
  if (instance || currentApp) {
5758
- const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
5762
+ const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
5759
5763
  if (provides && key in provides) {
5760
5764
  return provides[key];
5761
5765
  } else if (arguments.length > 1) {
@@ -7021,6 +7025,7 @@ Server rendered element contains more child nodes than client vdom.`
7021
7025
  }
7022
7026
  if (props) {
7023
7027
  {
7028
+ const isCustomElement = el.tagName.includes("-");
7024
7029
  for (const key in props) {
7025
7030
  if (// #11189 skip if this node has directives that have created hooks
7026
7031
  // as it could have mutated the DOM in any possible way
@@ -7028,7 +7033,7 @@ Server rendered element contains more child nodes than client vdom.`
7028
7033
  logMismatchError();
7029
7034
  }
7030
7035
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7031
- key[0] === ".") {
7036
+ key[0] === "." || isCustomElement) {
7032
7037
  patchProp(el, key, null, props[key], void 0, parentComponent);
7033
7038
  }
7034
7039
  }
@@ -8760,13 +8765,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8760
8765
  namespace
8761
8766
  );
8762
8767
  }
8768
+ container._vnode = vnode;
8763
8769
  if (!isFlushing) {
8764
8770
  isFlushing = true;
8765
8771
  flushPreFlushCbs();
8766
8772
  flushPostFlushCbs();
8767
8773
  isFlushing = false;
8768
8774
  }
8769
- container._vnode = vnode;
8770
8775
  };
8771
8776
  const internals = {
8772
8777
  p: patch,
@@ -9184,7 +9189,8 @@ function useModel(props, name, options = EMPTY_OBJ) {
9184
9189
  return options.get ? options.get(localValue) : localValue;
9185
9190
  },
9186
9191
  set(value) {
9187
- if (!hasChanged(value, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
9192
+ const emittedValue = options.set ? options.set(value) : value;
9193
+ if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
9188
9194
  return;
9189
9195
  }
9190
9196
  const rawProps = i.vnode.props;
@@ -9193,7 +9199,6 @@ function useModel(props, name, options = EMPTY_OBJ) {
9193
9199
  localValue = value;
9194
9200
  trigger();
9195
9201
  }
9196
- const emittedValue = options.set ? options.set(value) : value;
9197
9202
  i.emit(`update:${name}`, emittedValue);
9198
9203
  if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
9199
9204
  trigger();
@@ -9231,9 +9236,9 @@ function emit(instance, event, ...rawArgs) {
9231
9236
  } = instance;
9232
9237
  if (emitsOptions) {
9233
9238
  if (!(event in emitsOptions) && !(event.startsWith("hook:") || event.startsWith(compatModelEventPrefix))) {
9234
- if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
9239
+ if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
9235
9240
  warn$1(
9236
- `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
9241
+ `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
9237
9242
  );
9238
9243
  }
9239
9244
  } else {
@@ -11366,7 +11371,7 @@ function isMemoSame(cached, memo) {
11366
11371
  return true;
11367
11372
  }
11368
11373
 
11369
- const version = "3.4.35";
11374
+ const version = "3.4.37";
11370
11375
  const warn = warn$1 ;
11371
11376
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11372
11377
  const devtools = devtools$1 ;
@@ -11833,8 +11838,10 @@ function useCssVars(getter) {
11833
11838
  setVarsOnVNode(instance.subTree, vars);
11834
11839
  updateTeleports(vars);
11835
11840
  };
11836
- onMounted(() => {
11841
+ onBeforeMount(() => {
11837
11842
  watchPostEffect(setVars);
11843
+ });
11844
+ onMounted(() => {
11838
11845
  const ob = new MutationObserver(setVars);
11839
11846
  ob.observe(instance.subTree.el.parentNode, { childList: true });
11840
11847
  onUnmounted(() => ob.disconnect());