@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,12 +1,11 @@
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
6
  var Vue = (function () {
7
7
  'use strict';
8
8
 
9
- /*! #__NO_SIDE_EFFECTS__ */
10
9
  // @__NO_SIDE_EFFECTS__
11
10
  function makeMap(str) {
12
11
  const map = /* @__PURE__ */ Object.create(null);
@@ -64,10 +63,10 @@ var Vue = (function () {
64
63
  return hit || (cache[str] = fn(str));
65
64
  });
66
65
  };
67
- const camelizeRE = /-(\w)/g;
66
+ const camelizeRE = /-\w/g;
68
67
  const camelize = cacheStringFunction(
69
68
  (str) => {
70
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
69
+ return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
71
70
  }
72
71
  );
73
72
  const hyphenateRE = /\B([A-Z])/g;
@@ -2157,11 +2156,11 @@ var Vue = (function () {
2157
2156
  if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
2158
2157
  return value;
2159
2158
  }
2160
- seen = seen || /* @__PURE__ */ new Set();
2161
- if (seen.has(value)) {
2159
+ seen = seen || /* @__PURE__ */ new Map();
2160
+ if ((seen.get(value) || 0) >= depth) {
2162
2161
  return value;
2163
2162
  }
2164
- seen.add(value);
2163
+ seen.set(value, depth);
2165
2164
  depth--;
2166
2165
  if (isRef(value)) {
2167
2166
  traverse(value.value, depth, seen);
@@ -2623,11 +2622,14 @@ var Vue = (function () {
2623
2622
  let isHmrUpdating = false;
2624
2623
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2625
2624
  {
2626
- getGlobalThis().__VUE_HMR_RUNTIME__ = {
2627
- createRecord: tryWrap(createRecord),
2628
- rerender: tryWrap(rerender),
2629
- reload: tryWrap(reload)
2630
- };
2625
+ const g = getGlobalThis();
2626
+ if (!g.__VUE_HMR_RUNTIME__) {
2627
+ g.__VUE_HMR_RUNTIME__ = {
2628
+ createRecord: tryWrap(createRecord),
2629
+ rerender: tryWrap(rerender),
2630
+ reload: tryWrap(reload)
2631
+ };
2632
+ }
2631
2633
  }
2632
2634
  const map = /* @__PURE__ */ new Map();
2633
2635
  function registerHMR(instance) {
@@ -2700,10 +2702,12 @@ var Vue = (function () {
2700
2702
  dirtyInstances.delete(instance);
2701
2703
  } else if (instance.parent) {
2702
2704
  queueJob(() => {
2703
- isHmrUpdating = true;
2704
- instance.parent.update();
2705
- isHmrUpdating = false;
2706
- dirtyInstances.delete(instance);
2705
+ if (!(instance.job.flags & 8)) {
2706
+ isHmrUpdating = true;
2707
+ instance.parent.update();
2708
+ isHmrUpdating = false;
2709
+ dirtyInstances.delete(instance);
2710
+ }
2707
2711
  });
2708
2712
  } else if (instance.appContext.reload) {
2709
2713
  instance.appContext.reload();
@@ -2807,7 +2811,6 @@ var Vue = (function () {
2807
2811
  _devtoolsComponentRemoved(component);
2808
2812
  }
2809
2813
  };
2810
- /*! #__NO_SIDE_EFFECTS__ */
2811
2814
  // @__NO_SIDE_EFFECTS__
2812
2815
  function createDevtoolsComponentHook(hook) {
2813
2816
  return (component) => {
@@ -3733,26 +3736,34 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3733
3736
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
3734
3737
  o: { nextSibling, parentNode, querySelector, insert, createText }
3735
3738
  }, hydrateChildren) {
3739
+ function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
3740
+ vnode2.anchor = hydrateChildren(
3741
+ nextSibling(node2),
3742
+ vnode2,
3743
+ parentNode(node2),
3744
+ parentComponent,
3745
+ parentSuspense,
3746
+ slotScopeIds,
3747
+ optimized
3748
+ );
3749
+ vnode2.targetStart = targetStart;
3750
+ vnode2.targetAnchor = targetAnchor;
3751
+ }
3736
3752
  const target = vnode.target = resolveTarget(
3737
3753
  vnode.props,
3738
3754
  querySelector
3739
3755
  );
3756
+ const disabled = isTeleportDisabled(vnode.props);
3740
3757
  if (target) {
3741
- const disabled = isTeleportDisabled(vnode.props);
3742
3758
  const targetNode = target._lpa || target.firstChild;
3743
3759
  if (vnode.shapeFlag & 16) {
3744
3760
  if (disabled) {
3745
- vnode.anchor = hydrateChildren(
3746
- nextSibling(node),
3761
+ hydrateDisabledTeleport(
3762
+ node,
3747
3763
  vnode,
3748
- parentNode(node),
3749
- parentComponent,
3750
- parentSuspense,
3751
- slotScopeIds,
3752
- optimized
3764
+ targetNode,
3765
+ targetNode && nextSibling(targetNode)
3753
3766
  );
3754
- vnode.targetStart = targetNode;
3755
- vnode.targetAnchor = targetNode && nextSibling(targetNode);
3756
3767
  } else {
3757
3768
  vnode.anchor = nextSibling(node);
3758
3769
  let targetAnchor = targetNode;
@@ -3783,6 +3794,10 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3783
3794
  }
3784
3795
  }
3785
3796
  updateCssVars(vnode, disabled);
3797
+ } else if (disabled) {
3798
+ if (vnode.shapeFlag & 16) {
3799
+ hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
3800
+ }
3786
3801
  }
3787
3802
  return vnode.anchor && nextSibling(vnode.anchor);
3788
3803
  }
@@ -3894,7 +3909,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3894
3909
  setTransitionHooks(innerChild, enterHooks);
3895
3910
  }
3896
3911
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3897
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3912
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3898
3913
  let leavingHooks = resolveTransitionHooks(
3899
3914
  oldInnerChild,
3900
3915
  rawProps,
@@ -4177,7 +4192,6 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4177
4192
  return ret;
4178
4193
  }
4179
4194
 
4180
- /*! #__NO_SIDE_EFFECTS__ */
4181
4195
  // @__NO_SIDE_EFFECTS__
4182
4196
  function defineComponent(options, extraOptions) {
4183
4197
  return isFunction(options) ? (
@@ -4230,6 +4244,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4230
4244
  return ret;
4231
4245
  }
4232
4246
 
4247
+ const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
4233
4248
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4234
4249
  if (isArray(rawRef)) {
4235
4250
  rawRef.forEach(
@@ -4279,6 +4294,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4279
4294
  return !knownTemplateRefs.has(ref2);
4280
4295
  };
4281
4296
  if (oldRef != null && oldRef !== ref) {
4297
+ invalidatePendingSetRef(oldRawRef);
4282
4298
  if (isString(oldRef)) {
4283
4299
  refs[oldRef] = null;
4284
4300
  if (canSetSetupRef(oldRef)) {
@@ -4336,9 +4352,15 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4336
4352
  }
4337
4353
  };
4338
4354
  if (value) {
4339
- doSet.id = -1;
4340
- queuePostRenderEffect(doSet, parentSuspense);
4355
+ const job = () => {
4356
+ doSet();
4357
+ pendingSetRefMap.delete(rawRef);
4358
+ };
4359
+ job.id = -1;
4360
+ pendingSetRefMap.set(rawRef, job);
4361
+ queuePostRenderEffect(job, parentSuspense);
4341
4362
  } else {
4363
+ invalidatePendingSetRef(rawRef);
4342
4364
  doSet();
4343
4365
  }
4344
4366
  } else {
@@ -4346,6 +4368,13 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4346
4368
  }
4347
4369
  }
4348
4370
  }
4371
+ function invalidatePendingSetRef(rawRef) {
4372
+ const pendingSetRef = pendingSetRefMap.get(rawRef);
4373
+ if (pendingSetRef) {
4374
+ pendingSetRef.flags |= 8;
4375
+ pendingSetRefMap.delete(rawRef);
4376
+ }
4377
+ }
4349
4378
 
4350
4379
  let hasLoggedMismatchError = false;
4351
4380
  const logMismatchError = () => {
@@ -5078,7 +5107,6 @@ Server rendered element contains fewer child nodes than client vdom.`
5078
5107
  }
5079
5108
 
5080
5109
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
5081
- /*! #__NO_SIDE_EFFECTS__ */
5082
5110
  // @__NO_SIDE_EFFECTS__
5083
5111
  function defineAsyncComponent(source) {
5084
5112
  if (isFunction(source)) {
@@ -7166,7 +7194,7 @@ If this is a native custom element, make sure to exclude it from component resol
7166
7194
  return vm;
7167
7195
  }
7168
7196
  }
7169
- Vue.version = `2.6.14-compat:${"3.5.20"}`;
7197
+ Vue.version = `2.6.14-compat:${"3.5.21"}`;
7170
7198
  Vue.config = singletonApp.config;
7171
7199
  Vue.use = (plugin, ...options) => {
7172
7200
  if (plugin && isFunction(plugin.install)) {
@@ -7424,7 +7452,7 @@ If this is a native custom element, make sure to exclude it from component resol
7424
7452
  {
7425
7453
  for (let i = 0; i < container.attributes.length; i++) {
7426
7454
  const attr = container.attributes[i];
7427
- if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
7455
+ if (attr.name !== "v-cloak" && /^(?:v-|:|@)/.test(attr.name)) {
7428
7456
  warnDeprecation("GLOBAL_MOUNT_CONTAINER", null);
7429
7457
  break;
7430
7458
  }
@@ -10208,8 +10236,9 @@ If you want to remount the same app, move your app creation logic into a factory
10208
10236
  return emit$1(instance, event, args);
10209
10237
  }
10210
10238
  }
10239
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
10211
10240
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
10212
- const cache = appContext.emitsCache;
10241
+ const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
10213
10242
  const cached = cache.get(comp);
10214
10243
  if (cached !== void 0) {
10215
10244
  return cached;
@@ -10681,7 +10710,7 @@ If you want to remount the same app, move your app creation logic into a factory
10681
10710
  const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
10682
10711
  if (pendingBranch) {
10683
10712
  suspense.pendingBranch = newBranch;
10684
- if (isSameVNodeType(newBranch, pendingBranch)) {
10713
+ if (isSameVNodeType(pendingBranch, newBranch)) {
10685
10714
  patch(
10686
10715
  pendingBranch,
10687
10716
  newBranch,
@@ -10752,7 +10781,7 @@ If you want to remount the same app, move your app creation logic into a factory
10752
10781
  );
10753
10782
  setActiveBranch(suspense, newFallback);
10754
10783
  }
10755
- } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
10784
+ } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
10756
10785
  patch(
10757
10786
  activeBranch,
10758
10787
  newBranch,
@@ -10783,7 +10812,7 @@ If you want to remount the same app, move your app creation logic into a factory
10783
10812
  }
10784
10813
  }
10785
10814
  } else {
10786
- if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
10815
+ if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
10787
10816
  patch(
10788
10817
  activeBranch,
10789
10818
  newBranch,
@@ -12005,7 +12034,7 @@ Component that was made reactive: `,
12005
12034
  return instance.proxy;
12006
12035
  }
12007
12036
  }
12008
- const classifyRE = /(?:^|[-_])(\w)/g;
12037
+ const classifyRE = /(?:^|[-_])\w/g;
12009
12038
  const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
12010
12039
  function getComponentName(Component, includeInferred = true) {
12011
12040
  return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
@@ -12048,15 +12077,23 @@ Component that was made reactive: `,
12048
12077
  };
12049
12078
 
12050
12079
  function h(type, propsOrChildren, children) {
12080
+ const doCreateVNode = (type2, props, children2) => {
12081
+ setBlockTracking(-1);
12082
+ try {
12083
+ return createVNode(type2, props, children2);
12084
+ } finally {
12085
+ setBlockTracking(1);
12086
+ }
12087
+ };
12051
12088
  const l = arguments.length;
12052
12089
  if (l === 2) {
12053
12090
  if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
12054
12091
  if (isVNode(propsOrChildren)) {
12055
- return createVNode(type, null, [propsOrChildren]);
12092
+ return doCreateVNode(type, null, [propsOrChildren]);
12056
12093
  }
12057
- return createVNode(type, propsOrChildren);
12094
+ return doCreateVNode(type, propsOrChildren);
12058
12095
  } else {
12059
- return createVNode(type, null, propsOrChildren);
12096
+ return doCreateVNode(type, null, propsOrChildren);
12060
12097
  }
12061
12098
  } else {
12062
12099
  if (l > 3) {
@@ -12064,7 +12101,7 @@ Component that was made reactive: `,
12064
12101
  } else if (l === 3 && isVNode(children)) {
12065
12102
  children = [children];
12066
12103
  }
12067
- return createVNode(type, propsOrChildren, children);
12104
+ return doCreateVNode(type, propsOrChildren, children);
12068
12105
  }
12069
12106
  }
12070
12107
 
@@ -12274,7 +12311,7 @@ Component that was made reactive: `,
12274
12311
  return true;
12275
12312
  }
12276
12313
 
12277
- const version = "3.5.20";
12314
+ const version = "3.5.21";
12278
12315
  const warn = warn$1 ;
12279
12316
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12280
12317
  const devtools = devtools$1 ;
@@ -12665,7 +12702,7 @@ Component that was made reactive: `,
12665
12702
  type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
12666
12703
  propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
12667
12704
  }
12668
- const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
12705
+ const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
12669
12706
  getStyleProperties(`${TRANSITION}Property`).toString()
12670
12707
  );
12671
12708
  return {
@@ -12819,7 +12856,7 @@ Component that was made reactive: `,
12819
12856
  }
12820
12857
  }
12821
12858
 
12822
- const displayRE = /(^|;)\s*display\s*:/;
12859
+ const displayRE = /(?:^|;)\s*display\s*:/;
12823
12860
  function patchStyle(el, prev, next) {
12824
12861
  const style = el.style;
12825
12862
  const isCssString = isString(next);
@@ -13186,11 +13223,10 @@ Expected function or array of functions, received type ${typeof value}.`
13186
13223
  }
13187
13224
 
13188
13225
  const REMOVAL = {};
13189
- /*! #__NO_SIDE_EFFECTS__ */
13190
13226
  // @__NO_SIDE_EFFECTS__
13191
13227
  function defineCustomElement(options, extraOptions, _createApp) {
13192
- const Comp = defineComponent(options, extraOptions);
13193
- if (isPlainObject(Comp)) extend(Comp, extraOptions);
13228
+ let Comp = defineComponent(options, extraOptions);
13229
+ if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
13194
13230
  class VueCustomElement extends VueElement {
13195
13231
  constructor(initialProps) {
13196
13232
  super(Comp, initialProps, _createApp);
@@ -13199,7 +13235,6 @@ Expected function or array of functions, received type ${typeof value}.`
13199
13235
  VueCustomElement.def = Comp;
13200
13236
  return VueCustomElement;
13201
13237
  }
13202
-
13203
13238
  const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
13204
13239
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
13205
13240
  });
@@ -13663,7 +13698,7 @@ Expected function or array of functions, received type ${typeof value}.`
13663
13698
  if (e && e.target !== el) {
13664
13699
  return;
13665
13700
  }
13666
- if (!e || /transform$/.test(e.propertyName)) {
13701
+ if (!e || e.propertyName.endsWith("transform")) {
13667
13702
  el.removeEventListener("transitionend", cb);
13668
13703
  el[moveCbKey] = null;
13669
13704
  removeTransitionClass(el, moveClass);
@@ -14128,7 +14163,7 @@ Expected function or array of functions, received type ${typeof value}.`
14128
14163
  if (container.nodeType === 1) {
14129
14164
  for (let i = 0; i < container.attributes.length; i++) {
14130
14165
  const attr = container.attributes[i];
14131
- if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
14166
+ if (attr.name !== "v-cloak" && /^(?:v-|:|@)/.test(attr.name)) {
14132
14167
  compatUtils.warnDeprecation(
14133
14168
  "GLOBAL_MOUNT_CONTAINER",
14134
14169
  null