@vue/compat 3.5.20 → 3.5.21

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,9 +1,8 @@
1
1
  /**
2
- * @vue/compat v3.5.20
2
+ * @vue/compat v3.5.21
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
- /*! #__NO_SIDE_EFFECTS__ */
7
6
  // @__NO_SIDE_EFFECTS__
8
7
  function makeMap(str) {
9
8
  const map = /* @__PURE__ */ Object.create(null);
@@ -61,10 +60,10 @@ const cacheStringFunction = (fn) => {
61
60
  return hit || (cache[str] = fn(str));
62
61
  });
63
62
  };
64
- const camelizeRE = /-(\w)/g;
63
+ const camelizeRE = /-\w/g;
65
64
  const camelize = cacheStringFunction(
66
65
  (str) => {
67
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
66
+ return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
68
67
  }
69
68
  );
70
69
  const hyphenateRE = /\B([A-Z])/g;
@@ -2154,11 +2153,11 @@ function traverse(value, depth = Infinity, seen) {
2154
2153
  if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
2155
2154
  return value;
2156
2155
  }
2157
- seen = seen || /* @__PURE__ */ new Set();
2158
- if (seen.has(value)) {
2156
+ seen = seen || /* @__PURE__ */ new Map();
2157
+ if ((seen.get(value) || 0) >= depth) {
2159
2158
  return value;
2160
2159
  }
2161
- seen.add(value);
2160
+ seen.set(value, depth);
2162
2161
  depth--;
2163
2162
  if (isRef(value)) {
2164
2163
  traverse(value.value, depth, seen);
@@ -2620,11 +2619,14 @@ function checkRecursiveUpdates(seen, fn) {
2620
2619
  let isHmrUpdating = false;
2621
2620
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2622
2621
  {
2623
- getGlobalThis().__VUE_HMR_RUNTIME__ = {
2624
- createRecord: tryWrap(createRecord),
2625
- rerender: tryWrap(rerender),
2626
- reload: tryWrap(reload)
2627
- };
2622
+ const g = getGlobalThis();
2623
+ if (!g.__VUE_HMR_RUNTIME__) {
2624
+ g.__VUE_HMR_RUNTIME__ = {
2625
+ createRecord: tryWrap(createRecord),
2626
+ rerender: tryWrap(rerender),
2627
+ reload: tryWrap(reload)
2628
+ };
2629
+ }
2628
2630
  }
2629
2631
  const map = /* @__PURE__ */ new Map();
2630
2632
  function registerHMR(instance) {
@@ -2697,10 +2699,12 @@ function reload(id, newComp) {
2697
2699
  dirtyInstances.delete(instance);
2698
2700
  } else if (instance.parent) {
2699
2701
  queueJob(() => {
2700
- isHmrUpdating = true;
2701
- instance.parent.update();
2702
- isHmrUpdating = false;
2703
- dirtyInstances.delete(instance);
2702
+ if (!(instance.job.flags & 8)) {
2703
+ isHmrUpdating = true;
2704
+ instance.parent.update();
2705
+ isHmrUpdating = false;
2706
+ dirtyInstances.delete(instance);
2707
+ }
2704
2708
  });
2705
2709
  } else if (instance.appContext.reload) {
2706
2710
  instance.appContext.reload();
@@ -2804,7 +2808,6 @@ const devtoolsComponentRemoved = (component) => {
2804
2808
  _devtoolsComponentRemoved(component);
2805
2809
  }
2806
2810
  };
2807
- /*! #__NO_SIDE_EFFECTS__ */
2808
2811
  // @__NO_SIDE_EFFECTS__
2809
2812
  function createDevtoolsComponentHook(hook) {
2810
2813
  return (component) => {
@@ -3730,26 +3733,34 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3730
3733
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
3731
3734
  o: { nextSibling, parentNode, querySelector, insert, createText }
3732
3735
  }, hydrateChildren) {
3736
+ function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
3737
+ vnode2.anchor = hydrateChildren(
3738
+ nextSibling(node2),
3739
+ vnode2,
3740
+ parentNode(node2),
3741
+ parentComponent,
3742
+ parentSuspense,
3743
+ slotScopeIds,
3744
+ optimized
3745
+ );
3746
+ vnode2.targetStart = targetStart;
3747
+ vnode2.targetAnchor = targetAnchor;
3748
+ }
3733
3749
  const target = vnode.target = resolveTarget(
3734
3750
  vnode.props,
3735
3751
  querySelector
3736
3752
  );
3753
+ const disabled = isTeleportDisabled(vnode.props);
3737
3754
  if (target) {
3738
- const disabled = isTeleportDisabled(vnode.props);
3739
3755
  const targetNode = target._lpa || target.firstChild;
3740
3756
  if (vnode.shapeFlag & 16) {
3741
3757
  if (disabled) {
3742
- vnode.anchor = hydrateChildren(
3743
- nextSibling(node),
3758
+ hydrateDisabledTeleport(
3759
+ node,
3744
3760
  vnode,
3745
- parentNode(node),
3746
- parentComponent,
3747
- parentSuspense,
3748
- slotScopeIds,
3749
- optimized
3761
+ targetNode,
3762
+ targetNode && nextSibling(targetNode)
3750
3763
  );
3751
- vnode.targetStart = targetNode;
3752
- vnode.targetAnchor = targetNode && nextSibling(targetNode);
3753
3764
  } else {
3754
3765
  vnode.anchor = nextSibling(node);
3755
3766
  let targetAnchor = targetNode;
@@ -3780,6 +3791,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3780
3791
  }
3781
3792
  }
3782
3793
  updateCssVars(vnode, disabled);
3794
+ } else if (disabled) {
3795
+ if (vnode.shapeFlag & 16) {
3796
+ hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
3797
+ }
3783
3798
  }
3784
3799
  return vnode.anchor && nextSibling(vnode.anchor);
3785
3800
  }
@@ -3891,7 +3906,7 @@ const BaseTransitionImpl = {
3891
3906
  setTransitionHooks(innerChild, enterHooks);
3892
3907
  }
3893
3908
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3894
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3909
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3895
3910
  let leavingHooks = resolveTransitionHooks(
3896
3911
  oldInnerChild,
3897
3912
  rawProps,
@@ -4174,7 +4189,6 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4174
4189
  return ret;
4175
4190
  }
4176
4191
 
4177
- /*! #__NO_SIDE_EFFECTS__ */
4178
4192
  // @__NO_SIDE_EFFECTS__
4179
4193
  function defineComponent(options, extraOptions) {
4180
4194
  return isFunction(options) ? (
@@ -4227,6 +4241,7 @@ function useTemplateRef(key) {
4227
4241
  return ret;
4228
4242
  }
4229
4243
 
4244
+ const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
4230
4245
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4231
4246
  if (isArray(rawRef)) {
4232
4247
  rawRef.forEach(
@@ -4276,6 +4291,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4276
4291
  return !knownTemplateRefs.has(ref2);
4277
4292
  };
4278
4293
  if (oldRef != null && oldRef !== ref) {
4294
+ invalidatePendingSetRef(oldRawRef);
4279
4295
  if (isString(oldRef)) {
4280
4296
  refs[oldRef] = null;
4281
4297
  if (canSetSetupRef(oldRef)) {
@@ -4333,9 +4349,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4333
4349
  }
4334
4350
  };
4335
4351
  if (value) {
4336
- doSet.id = -1;
4337
- queuePostRenderEffect(doSet, parentSuspense);
4352
+ const job = () => {
4353
+ doSet();
4354
+ pendingSetRefMap.delete(rawRef);
4355
+ };
4356
+ job.id = -1;
4357
+ pendingSetRefMap.set(rawRef, job);
4358
+ queuePostRenderEffect(job, parentSuspense);
4338
4359
  } else {
4360
+ invalidatePendingSetRef(rawRef);
4339
4361
  doSet();
4340
4362
  }
4341
4363
  } else {
@@ -4343,6 +4365,13 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4343
4365
  }
4344
4366
  }
4345
4367
  }
4368
+ function invalidatePendingSetRef(rawRef) {
4369
+ const pendingSetRef = pendingSetRefMap.get(rawRef);
4370
+ if (pendingSetRef) {
4371
+ pendingSetRef.flags |= 8;
4372
+ pendingSetRefMap.delete(rawRef);
4373
+ }
4374
+ }
4346
4375
 
4347
4376
  let hasLoggedMismatchError = false;
4348
4377
  const logMismatchError = () => {
@@ -5075,7 +5104,6 @@ function forEachElement(node, cb) {
5075
5104
  }
5076
5105
 
5077
5106
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
5078
- /*! #__NO_SIDE_EFFECTS__ */
5079
5107
  // @__NO_SIDE_EFFECTS__
5080
5108
  function defineAsyncComponent(source) {
5081
5109
  if (isFunction(source)) {
@@ -7172,7 +7200,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7172
7200
  return vm;
7173
7201
  }
7174
7202
  }
7175
- Vue.version = `2.6.14-compat:${"3.5.20"}`;
7203
+ Vue.version = `2.6.14-compat:${"3.5.21"}`;
7176
7204
  Vue.config = singletonApp.config;
7177
7205
  Vue.use = (plugin, ...options) => {
7178
7206
  if (plugin && isFunction(plugin.install)) {
@@ -7430,7 +7458,7 @@ function installCompatMount(app, context, render) {
7430
7458
  {
7431
7459
  for (let i = 0; i < container.attributes.length; i++) {
7432
7460
  const attr = container.attributes[i];
7433
- if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
7461
+ if (attr.name !== "v-cloak" && /^(?:v-|:|@)/.test(attr.name)) {
7434
7462
  warnDeprecation("GLOBAL_MOUNT_CONTAINER", null);
7435
7463
  break;
7436
7464
  }
@@ -10242,8 +10270,9 @@ function emit(instance, event, ...rawArgs) {
10242
10270
  return emit$1(instance, event, args);
10243
10271
  }
10244
10272
  }
10273
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
10245
10274
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
10246
- const cache = appContext.emitsCache;
10275
+ const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
10247
10276
  const cached = cache.get(comp);
10248
10277
  if (cached !== void 0) {
10249
10278
  return cached;
@@ -10715,7 +10744,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
10715
10744
  const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
10716
10745
  if (pendingBranch) {
10717
10746
  suspense.pendingBranch = newBranch;
10718
- if (isSameVNodeType(newBranch, pendingBranch)) {
10747
+ if (isSameVNodeType(pendingBranch, newBranch)) {
10719
10748
  patch(
10720
10749
  pendingBranch,
10721
10750
  newBranch,
@@ -10786,7 +10815,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
10786
10815
  );
10787
10816
  setActiveBranch(suspense, newFallback);
10788
10817
  }
10789
- } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
10818
+ } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
10790
10819
  patch(
10791
10820
  activeBranch,
10792
10821
  newBranch,
@@ -10817,7 +10846,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
10817
10846
  }
10818
10847
  }
10819
10848
  } else {
10820
- if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
10849
+ if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
10821
10850
  patch(
10822
10851
  activeBranch,
10823
10852
  newBranch,
@@ -12053,7 +12082,7 @@ function getComponentPublicInstance(instance) {
12053
12082
  return instance.proxy;
12054
12083
  }
12055
12084
  }
12056
- const classifyRE = /(?:^|[-_])(\w)/g;
12085
+ const classifyRE = /(?:^|[-_])\w/g;
12057
12086
  const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
12058
12087
  function getComponentName(Component, includeInferred = true) {
12059
12088
  return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
@@ -12096,15 +12125,23 @@ const computed = (getterOrOptions, debugOptions) => {
12096
12125
  };
12097
12126
 
12098
12127
  function h(type, propsOrChildren, children) {
12128
+ const doCreateVNode = (type2, props, children2) => {
12129
+ setBlockTracking(-1);
12130
+ try {
12131
+ return createVNode(type2, props, children2);
12132
+ } finally {
12133
+ setBlockTracking(1);
12134
+ }
12135
+ };
12099
12136
  const l = arguments.length;
12100
12137
  if (l === 2) {
12101
12138
  if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
12102
12139
  if (isVNode(propsOrChildren)) {
12103
- return createVNode(type, null, [propsOrChildren]);
12140
+ return doCreateVNode(type, null, [propsOrChildren]);
12104
12141
  }
12105
- return createVNode(type, propsOrChildren);
12142
+ return doCreateVNode(type, propsOrChildren);
12106
12143
  } else {
12107
- return createVNode(type, null, propsOrChildren);
12144
+ return doCreateVNode(type, null, propsOrChildren);
12108
12145
  }
12109
12146
  } else {
12110
12147
  if (l > 3) {
@@ -12112,7 +12149,7 @@ function h(type, propsOrChildren, children) {
12112
12149
  } else if (l === 3 && isVNode(children)) {
12113
12150
  children = [children];
12114
12151
  }
12115
- return createVNode(type, propsOrChildren, children);
12152
+ return doCreateVNode(type, propsOrChildren, children);
12116
12153
  }
12117
12154
  }
12118
12155
 
@@ -12322,7 +12359,7 @@ function isMemoSame(cached, memo) {
12322
12359
  return true;
12323
12360
  }
12324
12361
 
12325
- const version = "3.5.20";
12362
+ const version = "3.5.21";
12326
12363
  const warn = warn$1 ;
12327
12364
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12328
12365
  const devtools = devtools$1 ;
@@ -12725,7 +12762,7 @@ function getTransitionInfo(el, expectedType) {
12725
12762
  type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
12726
12763
  propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
12727
12764
  }
12728
- const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
12765
+ const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
12729
12766
  getStyleProperties(`${TRANSITION}Property`).toString()
12730
12767
  );
12731
12768
  return {
@@ -12886,7 +12923,7 @@ function setVarsOnNode(el, vars) {
12886
12923
  }
12887
12924
  }
12888
12925
 
12889
- const displayRE = /(^|;)\s*display\s*:/;
12926
+ const displayRE = /(?:^|;)\s*display\s*:/;
12890
12927
  function patchStyle(el, prev, next) {
12891
12928
  const style = el.style;
12892
12929
  const isCssString = isString(next);
@@ -13253,11 +13290,10 @@ function shouldSetAsProp(el, key, value, isSVG) {
13253
13290
  }
13254
13291
 
13255
13292
  const REMOVAL = {};
13256
- /*! #__NO_SIDE_EFFECTS__ */
13257
13293
  // @__NO_SIDE_EFFECTS__
13258
13294
  function defineCustomElement(options, extraOptions, _createApp) {
13259
- const Comp = defineComponent(options, extraOptions);
13260
- if (isPlainObject(Comp)) extend(Comp, extraOptions);
13295
+ let Comp = defineComponent(options, extraOptions);
13296
+ if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
13261
13297
  class VueCustomElement extends VueElement {
13262
13298
  constructor(initialProps) {
13263
13299
  super(Comp, initialProps, _createApp);
@@ -13266,7 +13302,6 @@ function defineCustomElement(options, extraOptions, _createApp) {
13266
13302
  VueCustomElement.def = Comp;
13267
13303
  return VueCustomElement;
13268
13304
  }
13269
-
13270
13305
  const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
13271
13306
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
13272
13307
  });
@@ -13742,7 +13777,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
13742
13777
  if (e && e.target !== el) {
13743
13778
  return;
13744
13779
  }
13745
- if (!e || /transform$/.test(e.propertyName)) {
13780
+ if (!e || e.propertyName.endsWith("transform")) {
13746
13781
  el.removeEventListener("transitionend", cb);
13747
13782
  el[moveCbKey] = null;
13748
13783
  removeTransitionClass(el, moveClass);
@@ -14241,7 +14276,7 @@ const createApp = ((...args) => {
14241
14276
  if (container.nodeType === 1) {
14242
14277
  for (let i = 0; i < container.attributes.length; i++) {
14243
14278
  const attr = container.attributes[i];
14244
- if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
14279
+ if (attr.name !== "v-cloak" && /^(?:v-|:|@)/.test(attr.name)) {
14245
14280
  compatUtils.warnDeprecation(
14246
14281
  "GLOBAL_MOUNT_CONTAINER",
14247
14282
  null