@vue/compat 3.4.36 → 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.36
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.36"}`;
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) {
@@ -8761,13 +8765,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8761
8765
  namespace
8762
8766
  );
8763
8767
  }
8768
+ container._vnode = vnode;
8764
8769
  if (!isFlushing) {
8765
8770
  isFlushing = true;
8766
8771
  flushPreFlushCbs();
8767
8772
  flushPostFlushCbs();
8768
8773
  isFlushing = false;
8769
8774
  }
8770
- container._vnode = vnode;
8771
8775
  };
8772
8776
  const internals = {
8773
8777
  p: patch,
@@ -9185,7 +9189,8 @@ function useModel(props, name, options = EMPTY_OBJ) {
9185
9189
  return options.get ? options.get(localValue) : localValue;
9186
9190
  },
9187
9191
  set(value) {
9188
- 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))) {
9189
9194
  return;
9190
9195
  }
9191
9196
  const rawProps = i.vnode.props;
@@ -9194,7 +9199,6 @@ function useModel(props, name, options = EMPTY_OBJ) {
9194
9199
  localValue = value;
9195
9200
  trigger();
9196
9201
  }
9197
- const emittedValue = options.set ? options.set(value) : value;
9198
9202
  i.emit(`update:${name}`, emittedValue);
9199
9203
  if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
9200
9204
  trigger();
@@ -9232,9 +9236,9 @@ function emit(instance, event, ...rawArgs) {
9232
9236
  } = instance;
9233
9237
  if (emitsOptions) {
9234
9238
  if (!(event in emitsOptions) && !(event.startsWith("hook:") || event.startsWith(compatModelEventPrefix))) {
9235
- if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
9239
+ if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
9236
9240
  warn$1(
9237
- `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.`
9238
9242
  );
9239
9243
  }
9240
9244
  } else {
@@ -11367,7 +11371,7 @@ function isMemoSame(cached, memo) {
11367
11371
  return true;
11368
11372
  }
11369
11373
 
11370
- const version = "3.4.36";
11374
+ const version = "3.4.37";
11371
11375
  const warn = warn$1 ;
11372
11376
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11373
11377
  const devtools = devtools$1 ;
@@ -11834,8 +11838,10 @@ function useCssVars(getter) {
11834
11838
  setVarsOnVNode(instance.subTree, vars);
11835
11839
  updateTeleports(vars);
11836
11840
  };
11837
- onMounted(() => {
11841
+ onBeforeMount(() => {
11838
11842
  watchPostEffect(setVars);
11843
+ });
11844
+ onMounted(() => {
11839
11845
  const ob = new MutationObserver(setVars);
11840
11846
  ob.observe(instance.subTree.el.parentNode, { childList: true });
11841
11847
  onUnmounted(() => ob.disconnect());