@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;
@@ -2164,11 +2163,11 @@ function traverse(value, depth = Infinity, seen) {
2164
2163
  if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
2165
2164
  return value;
2166
2165
  }
2167
- seen = seen || /* @__PURE__ */ new Set();
2168
- if (seen.has(value)) {
2166
+ seen = seen || /* @__PURE__ */ new Map();
2167
+ if ((seen.get(value) || 0) >= depth) {
2169
2168
  return value;
2170
2169
  }
2171
- seen.add(value);
2170
+ seen.set(value, depth);
2172
2171
  depth--;
2173
2172
  if (isRef(value)) {
2174
2173
  traverse(value.value, depth, seen);
@@ -2635,11 +2634,14 @@ function checkRecursiveUpdates(seen, fn) {
2635
2634
  let isHmrUpdating = false;
2636
2635
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2637
2636
  if (!!(process.env.NODE_ENV !== "production")) {
2638
- getGlobalThis().__VUE_HMR_RUNTIME__ = {
2639
- createRecord: tryWrap(createRecord),
2640
- rerender: tryWrap(rerender),
2641
- reload: tryWrap(reload)
2642
- };
2637
+ const g = getGlobalThis();
2638
+ if (!g.__VUE_HMR_RUNTIME__) {
2639
+ g.__VUE_HMR_RUNTIME__ = {
2640
+ createRecord: tryWrap(createRecord),
2641
+ rerender: tryWrap(rerender),
2642
+ reload: tryWrap(reload)
2643
+ };
2644
+ }
2643
2645
  }
2644
2646
  const map = /* @__PURE__ */ new Map();
2645
2647
  function registerHMR(instance) {
@@ -2712,10 +2714,12 @@ function reload(id, newComp) {
2712
2714
  dirtyInstances.delete(instance);
2713
2715
  } else if (instance.parent) {
2714
2716
  queueJob(() => {
2715
- isHmrUpdating = true;
2716
- instance.parent.update();
2717
- isHmrUpdating = false;
2718
- dirtyInstances.delete(instance);
2717
+ if (!(instance.job.flags & 8)) {
2718
+ isHmrUpdating = true;
2719
+ instance.parent.update();
2720
+ isHmrUpdating = false;
2721
+ dirtyInstances.delete(instance);
2722
+ }
2719
2723
  });
2720
2724
  } else if (instance.appContext.reload) {
2721
2725
  instance.appContext.reload();
@@ -2819,7 +2823,6 @@ const devtoolsComponentRemoved = (component) => {
2819
2823
  _devtoolsComponentRemoved(component);
2820
2824
  }
2821
2825
  };
2822
- /*! #__NO_SIDE_EFFECTS__ */
2823
2826
  // @__NO_SIDE_EFFECTS__
2824
2827
  function createDevtoolsComponentHook(hook) {
2825
2828
  return (component) => {
@@ -3748,26 +3751,34 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3748
3751
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
3749
3752
  o: { nextSibling, parentNode, querySelector, insert, createText }
3750
3753
  }, hydrateChildren) {
3754
+ function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
3755
+ vnode2.anchor = hydrateChildren(
3756
+ nextSibling(node2),
3757
+ vnode2,
3758
+ parentNode(node2),
3759
+ parentComponent,
3760
+ parentSuspense,
3761
+ slotScopeIds,
3762
+ optimized
3763
+ );
3764
+ vnode2.targetStart = targetStart;
3765
+ vnode2.targetAnchor = targetAnchor;
3766
+ }
3751
3767
  const target = vnode.target = resolveTarget(
3752
3768
  vnode.props,
3753
3769
  querySelector
3754
3770
  );
3771
+ const disabled = isTeleportDisabled(vnode.props);
3755
3772
  if (target) {
3756
- const disabled = isTeleportDisabled(vnode.props);
3757
3773
  const targetNode = target._lpa || target.firstChild;
3758
3774
  if (vnode.shapeFlag & 16) {
3759
3775
  if (disabled) {
3760
- vnode.anchor = hydrateChildren(
3761
- nextSibling(node),
3776
+ hydrateDisabledTeleport(
3777
+ node,
3762
3778
  vnode,
3763
- parentNode(node),
3764
- parentComponent,
3765
- parentSuspense,
3766
- slotScopeIds,
3767
- optimized
3779
+ targetNode,
3780
+ targetNode && nextSibling(targetNode)
3768
3781
  );
3769
- vnode.targetStart = targetNode;
3770
- vnode.targetAnchor = targetNode && nextSibling(targetNode);
3771
3782
  } else {
3772
3783
  vnode.anchor = nextSibling(node);
3773
3784
  let targetAnchor = targetNode;
@@ -3798,6 +3809,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3798
3809
  }
3799
3810
  }
3800
3811
  updateCssVars(vnode, disabled);
3812
+ } else if (disabled) {
3813
+ if (vnode.shapeFlag & 16) {
3814
+ hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
3815
+ }
3801
3816
  }
3802
3817
  return vnode.anchor && nextSibling(vnode.anchor);
3803
3818
  }
@@ -3909,7 +3924,7 @@ const BaseTransitionImpl = {
3909
3924
  setTransitionHooks(innerChild, enterHooks);
3910
3925
  }
3911
3926
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3912
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3927
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3913
3928
  let leavingHooks = resolveTransitionHooks(
3914
3929
  oldInnerChild,
3915
3930
  rawProps,
@@ -4193,7 +4208,6 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4193
4208
  return ret;
4194
4209
  }
4195
4210
 
4196
- /*! #__NO_SIDE_EFFECTS__ */
4197
4211
  // @__NO_SIDE_EFFECTS__
4198
4212
  function defineComponent(options, extraOptions) {
4199
4213
  return isFunction(options) ? (
@@ -4246,6 +4260,7 @@ function useTemplateRef(key) {
4246
4260
  return ret;
4247
4261
  }
4248
4262
 
4263
+ const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
4249
4264
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4250
4265
  if (isArray(rawRef)) {
4251
4266
  rawRef.forEach(
@@ -4295,6 +4310,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4295
4310
  return !!!(process.env.NODE_ENV !== "production") || !knownTemplateRefs.has(ref2);
4296
4311
  };
4297
4312
  if (oldRef != null && oldRef !== ref) {
4313
+ invalidatePendingSetRef(oldRawRef);
4298
4314
  if (isString(oldRef)) {
4299
4315
  refs[oldRef] = null;
4300
4316
  if (canSetSetupRef(oldRef)) {
@@ -4352,9 +4368,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4352
4368
  }
4353
4369
  };
4354
4370
  if (value) {
4355
- doSet.id = -1;
4356
- queuePostRenderEffect(doSet, parentSuspense);
4371
+ const job = () => {
4372
+ doSet();
4373
+ pendingSetRefMap.delete(rawRef);
4374
+ };
4375
+ job.id = -1;
4376
+ pendingSetRefMap.set(rawRef, job);
4377
+ queuePostRenderEffect(job, parentSuspense);
4357
4378
  } else {
4379
+ invalidatePendingSetRef(rawRef);
4358
4380
  doSet();
4359
4381
  }
4360
4382
  } else if (!!(process.env.NODE_ENV !== "production")) {
@@ -4362,6 +4384,13 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4362
4384
  }
4363
4385
  }
4364
4386
  }
4387
+ function invalidatePendingSetRef(rawRef) {
4388
+ const pendingSetRef = pendingSetRefMap.get(rawRef);
4389
+ if (pendingSetRef) {
4390
+ pendingSetRef.flags |= 8;
4391
+ pendingSetRefMap.delete(rawRef);
4392
+ }
4393
+ }
4365
4394
 
4366
4395
  let hasLoggedMismatchError = false;
4367
4396
  const logMismatchError = () => {
@@ -5105,7 +5134,6 @@ function forEachElement(node, cb) {
5105
5134
  }
5106
5135
 
5107
5136
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
5108
- /*! #__NO_SIDE_EFFECTS__ */
5109
5137
  // @__NO_SIDE_EFFECTS__
5110
5138
  function defineAsyncComponent(source) {
5111
5139
  if (isFunction(source)) {
@@ -7204,7 +7232,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7204
7232
  return vm;
7205
7233
  }
7206
7234
  }
7207
- Vue.version = `2.6.14-compat:${"3.5.20"}`;
7235
+ Vue.version = `2.6.14-compat:${"3.5.21"}`;
7208
7236
  Vue.config = singletonApp.config;
7209
7237
  Vue.use = (plugin, ...options) => {
7210
7238
  if (plugin && isFunction(plugin.install)) {
@@ -7462,7 +7490,7 @@ function installCompatMount(app, context, render) {
7462
7490
  if (!!(process.env.NODE_ENV !== "production")) {
7463
7491
  for (let i = 0; i < container.attributes.length; i++) {
7464
7492
  const attr = container.attributes[i];
7465
- if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
7493
+ if (attr.name !== "v-cloak" && /^(?:v-|:|@)/.test(attr.name)) {
7466
7494
  warnDeprecation("GLOBAL_MOUNT_CONTAINER", null);
7467
7495
  break;
7468
7496
  }
@@ -10314,8 +10342,9 @@ function emit(instance, event, ...rawArgs) {
10314
10342
  return emit$1(instance, event, args);
10315
10343
  }
10316
10344
  }
10345
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
10317
10346
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
10318
- const cache = appContext.emitsCache;
10347
+ const cache = __VUE_OPTIONS_API__ && asMixin ? mixinEmitsCache : appContext.emitsCache;
10319
10348
  const cached = cache.get(comp);
10320
10349
  if (cached !== void 0) {
10321
10350
  return cached;
@@ -10787,7 +10816,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
10787
10816
  const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
10788
10817
  if (pendingBranch) {
10789
10818
  suspense.pendingBranch = newBranch;
10790
- if (isSameVNodeType(newBranch, pendingBranch)) {
10819
+ if (isSameVNodeType(pendingBranch, newBranch)) {
10791
10820
  patch(
10792
10821
  pendingBranch,
10793
10822
  newBranch,
@@ -10858,7 +10887,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
10858
10887
  );
10859
10888
  setActiveBranch(suspense, newFallback);
10860
10889
  }
10861
- } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
10890
+ } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
10862
10891
  patch(
10863
10892
  activeBranch,
10864
10893
  newBranch,
@@ -10889,7 +10918,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
10889
10918
  }
10890
10919
  }
10891
10920
  } else {
10892
- if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
10921
+ if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
10893
10922
  patch(
10894
10923
  activeBranch,
10895
10924
  newBranch,
@@ -12139,7 +12168,7 @@ function getComponentPublicInstance(instance) {
12139
12168
  return instance.proxy;
12140
12169
  }
12141
12170
  }
12142
- const classifyRE = /(?:^|[-_])(\w)/g;
12171
+ const classifyRE = /(?:^|[-_])\w/g;
12143
12172
  const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
12144
12173
  function getComponentName(Component, includeInferred = true) {
12145
12174
  return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
@@ -12182,15 +12211,23 @@ const computed = (getterOrOptions, debugOptions) => {
12182
12211
  };
12183
12212
 
12184
12213
  function h(type, propsOrChildren, children) {
12214
+ const doCreateVNode = (type2, props, children2) => {
12215
+ setBlockTracking(-1);
12216
+ try {
12217
+ return createVNode(type2, props, children2);
12218
+ } finally {
12219
+ setBlockTracking(1);
12220
+ }
12221
+ };
12185
12222
  const l = arguments.length;
12186
12223
  if (l === 2) {
12187
12224
  if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
12188
12225
  if (isVNode(propsOrChildren)) {
12189
- return createVNode(type, null, [propsOrChildren]);
12226
+ return doCreateVNode(type, null, [propsOrChildren]);
12190
12227
  }
12191
- return createVNode(type, propsOrChildren);
12228
+ return doCreateVNode(type, propsOrChildren);
12192
12229
  } else {
12193
- return createVNode(type, null, propsOrChildren);
12230
+ return doCreateVNode(type, null, propsOrChildren);
12194
12231
  }
12195
12232
  } else {
12196
12233
  if (l > 3) {
@@ -12198,7 +12235,7 @@ function h(type, propsOrChildren, children) {
12198
12235
  } else if (l === 3 && isVNode(children)) {
12199
12236
  children = [children];
12200
12237
  }
12201
- return createVNode(type, propsOrChildren, children);
12238
+ return doCreateVNode(type, propsOrChildren, children);
12202
12239
  }
12203
12240
  }
12204
12241
 
@@ -12408,7 +12445,7 @@ function isMemoSame(cached, memo) {
12408
12445
  return true;
12409
12446
  }
12410
12447
 
12411
- const version = "3.5.20";
12448
+ const version = "3.5.21";
12412
12449
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12413
12450
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12414
12451
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -12811,7 +12848,7 @@ function getTransitionInfo(el, expectedType) {
12811
12848
  type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
12812
12849
  propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
12813
12850
  }
12814
- const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
12851
+ const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
12815
12852
  getStyleProperties(`${TRANSITION}Property`).toString()
12816
12853
  );
12817
12854
  return {
@@ -12972,7 +13009,7 @@ function setVarsOnNode(el, vars) {
12972
13009
  }
12973
13010
  }
12974
13011
 
12975
- const displayRE = /(^|;)\s*display\s*:/;
13012
+ const displayRE = /(?:^|;)\s*display\s*:/;
12976
13013
  function patchStyle(el, prev, next) {
12977
13014
  const style = el.style;
12978
13015
  const isCssString = isString(next);
@@ -13339,11 +13376,10 @@ function shouldSetAsProp(el, key, value, isSVG) {
13339
13376
  }
13340
13377
 
13341
13378
  const REMOVAL = {};
13342
- /*! #__NO_SIDE_EFFECTS__ */
13343
13379
  // @__NO_SIDE_EFFECTS__
13344
13380
  function defineCustomElement(options, extraOptions, _createApp) {
13345
- const Comp = defineComponent(options, extraOptions);
13346
- if (isPlainObject(Comp)) extend(Comp, extraOptions);
13381
+ let Comp = defineComponent(options, extraOptions);
13382
+ if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
13347
13383
  class VueCustomElement extends VueElement {
13348
13384
  constructor(initialProps) {
13349
13385
  super(Comp, initialProps, _createApp);
@@ -13352,7 +13388,6 @@ function defineCustomElement(options, extraOptions, _createApp) {
13352
13388
  VueCustomElement.def = Comp;
13353
13389
  return VueCustomElement;
13354
13390
  }
13355
-
13356
13391
  const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
13357
13392
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
13358
13393
  });
@@ -13828,7 +13863,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
13828
13863
  if (e && e.target !== el) {
13829
13864
  return;
13830
13865
  }
13831
- if (!e || /transform$/.test(e.propertyName)) {
13866
+ if (!e || e.propertyName.endsWith("transform")) {
13832
13867
  el.removeEventListener("transitionend", cb);
13833
13868
  el[moveCbKey] = null;
13834
13869
  removeTransitionClass(el, moveClass);
@@ -14327,7 +14362,7 @@ const createApp = ((...args) => {
14327
14362
  if (!!(process.env.NODE_ENV !== "production") && container.nodeType === 1) {
14328
14363
  for (let i = 0; i < container.attributes.length; i++) {
14329
14364
  const attr = container.attributes[i];
14330
- if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
14365
+ if (attr.name !== "v-cloak" && /^(?:v-|:|@)/.test(attr.name)) {
14331
14366
  compatUtils.warnDeprecation(
14332
14367
  "GLOBAL_MOUNT_CONTAINER",
14333
14368
  null