@vue/compat 3.4.24 → 3.4.26

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.24
2
+ * @vue/compat v3.4.26
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -81,10 +81,11 @@ const invokeArrayFns = (fns, arg) => {
81
81
  fns[i](arg);
82
82
  }
83
83
  };
84
- const def = (obj, key, value) => {
84
+ const def = (obj, key, value, writable = false) => {
85
85
  Object.defineProperty(obj, key, {
86
86
  configurable: true,
87
87
  enumerable: false,
88
+ writable,
88
89
  value
89
90
  });
90
91
  };
@@ -476,11 +477,10 @@ class ReactiveEffect {
476
477
  }
477
478
  }
478
479
  stop() {
479
- var _a;
480
480
  if (this.active) {
481
481
  preCleanupEffect(this);
482
482
  postCleanupEffect(this);
483
- (_a = this.onStop) == null ? void 0 : _a.call(this);
483
+ this.onStop && this.onStop();
484
484
  this.active = false;
485
485
  }
486
486
  }
@@ -693,8 +693,8 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
693
693
  resetScheduling();
694
694
  }
695
695
  function getDepFromReactive(object, key) {
696
- var _a;
697
- return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
696
+ const depsMap = targetMap.get(object);
697
+ return depsMap && depsMap.get(key);
698
698
  }
699
699
 
700
700
  const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
@@ -2906,7 +2906,7 @@ function renderComponentRoot(instance) {
2906
2906
  true ? {
2907
2907
  get attrs() {
2908
2908
  markAttrsAccessed();
2909
- return attrs;
2909
+ return shallowReadonly(attrs);
2910
2910
  },
2911
2911
  slots,
2912
2912
  emit
@@ -2939,7 +2939,7 @@ function renderComponentRoot(instance) {
2939
2939
  propsOptions
2940
2940
  );
2941
2941
  }
2942
- root = cloneVNode(root, fallthroughAttrs);
2942
+ root = cloneVNode(root, fallthroughAttrs, false, true);
2943
2943
  } else if (!accessedAttrs && root.type !== Comment) {
2944
2944
  const allAttrs = Object.keys(attrs);
2945
2945
  const eventAttrs = [];
@@ -2977,10 +2977,15 @@ function renderComponentRoot(instance) {
2977
2977
  getComponentName(instance.type)
2978
2978
  );
2979
2979
  }
2980
- root = cloneVNode(root, {
2981
- class: cls,
2982
- style
2983
- });
2980
+ root = cloneVNode(
2981
+ root,
2982
+ {
2983
+ class: cls,
2984
+ style
2985
+ },
2986
+ false,
2987
+ true
2988
+ );
2984
2989
  }
2985
2990
  }
2986
2991
  if (vnode.dirs) {
@@ -2989,7 +2994,7 @@ function renderComponentRoot(instance) {
2989
2994
  `Runtime directive used on component with non-element root node. The directives will not function as intended.`
2990
2995
  );
2991
2996
  }
2992
- root = cloneVNode(root);
2997
+ root = cloneVNode(root, null, false, true);
2993
2998
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2994
2999
  }
2995
3000
  if (vnode.transition) {
@@ -3484,7 +3489,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3484
3489
  let parentSuspenseId;
3485
3490
  const isSuspensible = isVNodeSuspensible(vnode);
3486
3491
  if (isSuspensible) {
3487
- if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
3492
+ if (parentSuspense && parentSuspense.pendingBranch) {
3488
3493
  parentSuspenseId = parentSuspense.pendingId;
3489
3494
  parentSuspense.deps++;
3490
3495
  }
@@ -3796,8 +3801,8 @@ function setActiveBranch(suspense, branch) {
3796
3801
  }
3797
3802
  }
3798
3803
  function isVNodeSuspensible(vnode) {
3799
- var _a;
3800
- return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
3804
+ const suspensible = vnode.props && vnode.props.suspensible;
3805
+ return suspensible != null && suspensible !== false;
3801
3806
  }
3802
3807
 
3803
3808
  const legacyDirectiveHookMap = {
@@ -4078,34 +4083,29 @@ function createPathGetter(ctx, path) {
4078
4083
  return cur;
4079
4084
  };
4080
4085
  }
4081
- function traverse(value, depth, currentDepth = 0, seen) {
4082
- if (!isObject(value) || value["__v_skip"]) {
4086
+ function traverse(value, depth = Infinity, seen) {
4087
+ if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
4083
4088
  return value;
4084
4089
  }
4085
- if (depth && depth > 0) {
4086
- if (currentDepth >= depth) {
4087
- return value;
4088
- }
4089
- currentDepth++;
4090
- }
4091
4090
  seen = seen || /* @__PURE__ */ new Set();
4092
4091
  if (seen.has(value)) {
4093
4092
  return value;
4094
4093
  }
4095
4094
  seen.add(value);
4095
+ depth--;
4096
4096
  if (isRef(value)) {
4097
- traverse(value.value, depth, currentDepth, seen);
4097
+ traverse(value.value, depth, seen);
4098
4098
  } else if (isArray(value)) {
4099
4099
  for (let i = 0; i < value.length; i++) {
4100
- traverse(value[i], depth, currentDepth, seen);
4100
+ traverse(value[i], depth, seen);
4101
4101
  }
4102
4102
  } else if (isSet(value) || isMap(value)) {
4103
4103
  value.forEach((v) => {
4104
- traverse(v, depth, currentDepth, seen);
4104
+ traverse(v, depth, seen);
4105
4105
  });
4106
4106
  } else if (isPlainObject(value)) {
4107
4107
  for (const key in value) {
4108
- traverse(value[key], depth, currentDepth, seen);
4108
+ traverse(value[key], depth, seen);
4109
4109
  }
4110
4110
  }
4111
4111
  return value;
@@ -4266,7 +4266,7 @@ const BaseTransitionImpl = {
4266
4266
  instance
4267
4267
  );
4268
4268
  setTransitionHooks(oldInnerChild, leavingHooks);
4269
- if (mode === "out-in") {
4269
+ if (mode === "out-in" && innerChild.type !== Comment) {
4270
4270
  state.isLeaving = true;
4271
4271
  leavingHooks.afterLeave = () => {
4272
4272
  state.isLeaving = false;
@@ -4461,11 +4461,13 @@ function getKeepAliveChild(vnode) {
4461
4461
  return vnode.component.subTree;
4462
4462
  }
4463
4463
  const { shapeFlag, children } = vnode;
4464
- if (shapeFlag & 16) {
4465
- return children[0];
4466
- }
4467
- if (shapeFlag & 32 && isFunction(children.default)) {
4468
- return children.default();
4464
+ if (children) {
4465
+ if (shapeFlag & 16) {
4466
+ return children[0];
4467
+ }
4468
+ if (shapeFlag & 32 && isFunction(children.default)) {
4469
+ return children.default();
4470
+ }
4469
4471
  }
4470
4472
  }
4471
4473
  function setTransitionHooks(vnode, hooks) {
@@ -4782,7 +4784,7 @@ const KeepAliveImpl = {
4782
4784
  return () => {
4783
4785
  pendingCacheKey = null;
4784
4786
  if (!slots.default) {
4785
- return current = null;
4787
+ return null;
4786
4788
  }
4787
4789
  const children = slots.default();
4788
4790
  const rawVNode = children[0];
@@ -6478,13 +6480,13 @@ function createCompatVue$1(createApp, createSingletonApp) {
6478
6480
  return vm;
6479
6481
  }
6480
6482
  }
6481
- Vue.version = `2.6.14-compat:${"3.4.24"}`;
6483
+ Vue.version = `2.6.14-compat:${"3.4.26"}`;
6482
6484
  Vue.config = singletonApp.config;
6483
- Vue.use = (p, ...options) => {
6484
- if (p && isFunction(p.install)) {
6485
- p.install(Vue, ...options);
6486
- } else if (isFunction(p)) {
6487
- p(Vue, ...options);
6485
+ Vue.use = (plugin, ...options) => {
6486
+ if (plugin && isFunction(plugin.install)) {
6487
+ plugin.install(Vue, ...options);
6488
+ } else if (isFunction(plugin)) {
6489
+ plugin(Vue, ...options);
6488
6490
  }
6489
6491
  return Vue;
6490
6492
  };
@@ -7115,7 +7117,7 @@ function shouldSkipAttr(key, instance) {
7115
7117
  return false;
7116
7118
  }
7117
7119
 
7118
- const internalObjectProto = /* @__PURE__ */ Object.create(null);
7120
+ const internalObjectProto = {};
7119
7121
  const createInternalObject = () => Object.create(internalObjectProto);
7120
7122
  const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
7121
7123
 
@@ -7602,7 +7604,7 @@ const initSlots = (instance, children) => {
7602
7604
  const type = children._;
7603
7605
  if (type) {
7604
7606
  extend(slots, children);
7605
- def(slots, "_", type);
7607
+ def(slots, "_", type, true);
7606
7608
  } else {
7607
7609
  normalizeObjectSlots(children, slots, instance);
7608
7610
  }
@@ -10441,8 +10443,8 @@ function guardReactiveProps(props) {
10441
10443
  return null;
10442
10444
  return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
10443
10445
  }
10444
- function cloneVNode(vnode, extraProps, mergeRef = false) {
10445
- const { props, ref, patchFlag, children } = vnode;
10446
+ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
10447
+ const { props, ref, patchFlag, children, transition } = vnode;
10446
10448
  const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
10447
10449
  const cloned = {
10448
10450
  __v_isVNode: true,
@@ -10472,7 +10474,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
10472
10474
  dynamicChildren: vnode.dynamicChildren,
10473
10475
  appContext: vnode.appContext,
10474
10476
  dirs: vnode.dirs,
10475
- transition: vnode.transition,
10477
+ transition,
10476
10478
  // These should technically only be non-null on mounted VNodes. However,
10477
10479
  // they *should* be copied for kept-alive vnodes. So we just always copy
10478
10480
  // them since them being non-null during a mount doesn't affect the logic as
@@ -10486,6 +10488,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
10486
10488
  ctx: vnode.ctx,
10487
10489
  ce: vnode.ce
10488
10490
  };
10491
+ if (transition && cloneTransition) {
10492
+ cloned.transition = transition.clone(cloned);
10493
+ }
10489
10494
  {
10490
10495
  defineLegacyVNodeProperties(cloned);
10491
10496
  }
@@ -11308,7 +11313,7 @@ function isMemoSame(cached, memo) {
11308
11313
  return true;
11309
11314
  }
11310
11315
 
11311
- const version = "3.4.24";
11316
+ const version = "3.4.26";
11312
11317
  const warn = warn$1 ;
11313
11318
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11314
11319
  const devtools = devtools$1 ;