@vue/compat 3.5.30 → 3.5.32

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.5.30
2
+ * @vue/compat v3.5.32
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1882,16 +1882,16 @@ var Vue = (function () {
1882
1882
  return ret;
1883
1883
  }
1884
1884
  class ObjectRefImpl {
1885
- constructor(_object, _key, _defaultValue) {
1885
+ constructor(_object, key, _defaultValue) {
1886
1886
  this._object = _object;
1887
- this._key = _key;
1888
1887
  this._defaultValue = _defaultValue;
1889
1888
  this["__v_isRef"] = true;
1890
1889
  this._value = void 0;
1890
+ this._key = isSymbol(key) ? key : String(key);
1891
1891
  this._raw = toRaw(_object);
1892
1892
  let shallow = true;
1893
1893
  let obj = _object;
1894
- if (!isArray(_object) || !isIntegerKey(String(_key))) {
1894
+ if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) {
1895
1895
  do {
1896
1896
  shallow = !isProxy(obj) || isShallow(obj);
1897
1897
  } while (shallow && (obj = obj["__v_raw"]));
@@ -2691,6 +2691,13 @@ var Vue = (function () {
2691
2691
  }
2692
2692
 
2693
2693
  let isHmrUpdating = false;
2694
+ const setHmrUpdating = (v) => {
2695
+ try {
2696
+ return isHmrUpdating;
2697
+ } finally {
2698
+ isHmrUpdating = v;
2699
+ }
2700
+ };
2694
2701
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2695
2702
  {
2696
2703
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
@@ -3625,6 +3632,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3625
3632
  };
3626
3633
  }
3627
3634
 
3635
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
3628
3636
  const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
3629
3637
  const isTeleport = (type) => type.__isTeleport;
3630
3638
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
@@ -3666,88 +3674,84 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3666
3674
  o: { insert, querySelector, createText, createComment }
3667
3675
  } = internals;
3668
3676
  const disabled = isTeleportDisabled(n2.props);
3669
- let { shapeFlag, children, dynamicChildren } = n2;
3677
+ let { dynamicChildren } = n2;
3670
3678
  if (isHmrUpdating) {
3671
3679
  optimized = false;
3672
3680
  dynamicChildren = null;
3673
3681
  }
3682
+ const mount = (vnode, container2, anchor2) => {
3683
+ if (vnode.shapeFlag & 16) {
3684
+ mountChildren(
3685
+ vnode.children,
3686
+ container2,
3687
+ anchor2,
3688
+ parentComponent,
3689
+ parentSuspense,
3690
+ namespace,
3691
+ slotScopeIds,
3692
+ optimized
3693
+ );
3694
+ }
3695
+ };
3696
+ const mountToTarget = (vnode = n2) => {
3697
+ const disabled2 = isTeleportDisabled(vnode.props);
3698
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
3699
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
3700
+ if (target) {
3701
+ if (namespace !== "svg" && isTargetSVG(target)) {
3702
+ namespace = "svg";
3703
+ } else if (namespace !== "mathml" && isTargetMathML(target)) {
3704
+ namespace = "mathml";
3705
+ }
3706
+ if (parentComponent && parentComponent.isCE) {
3707
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3708
+ }
3709
+ if (!disabled2) {
3710
+ mount(vnode, target, targetAnchor);
3711
+ updateCssVars(vnode, false);
3712
+ }
3713
+ } else if (!disabled2) {
3714
+ warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3715
+ }
3716
+ };
3717
+ const queuePendingMount = (vnode) => {
3718
+ const mountJob = () => {
3719
+ if (pendingMounts.get(vnode) !== mountJob) return;
3720
+ pendingMounts.delete(vnode);
3721
+ if (isTeleportDisabled(vnode.props)) {
3722
+ mount(vnode, container, vnode.anchor);
3723
+ updateCssVars(vnode, true);
3724
+ }
3725
+ mountToTarget(vnode);
3726
+ };
3727
+ pendingMounts.set(vnode, mountJob);
3728
+ queuePostRenderEffect(mountJob, parentSuspense);
3729
+ };
3674
3730
  if (n1 == null) {
3675
3731
  const placeholder = n2.el = createComment("teleport start") ;
3676
3732
  const mainAnchor = n2.anchor = createComment("teleport end") ;
3677
3733
  insert(placeholder, container, anchor);
3678
3734
  insert(mainAnchor, container, anchor);
3679
- const mount = (container2, anchor2) => {
3680
- if (shapeFlag & 16) {
3681
- mountChildren(
3682
- children,
3683
- container2,
3684
- anchor2,
3685
- parentComponent,
3686
- parentSuspense,
3687
- namespace,
3688
- slotScopeIds,
3689
- optimized
3690
- );
3691
- }
3692
- };
3693
- const mountToTarget = () => {
3694
- const target = n2.target = resolveTarget(n2.props, querySelector);
3695
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
3696
- if (target) {
3697
- if (namespace !== "svg" && isTargetSVG(target)) {
3698
- namespace = "svg";
3699
- } else if (namespace !== "mathml" && isTargetMathML(target)) {
3700
- namespace = "mathml";
3701
- }
3702
- if (parentComponent && parentComponent.isCE) {
3703
- (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3704
- }
3705
- if (!disabled) {
3706
- mount(target, targetAnchor);
3707
- updateCssVars(n2, false);
3708
- }
3709
- } else if (!disabled) {
3710
- warn$1(
3711
- "Invalid Teleport target on mount:",
3712
- target,
3713
- `(${typeof target})`
3714
- );
3715
- }
3716
- };
3735
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3736
+ queuePendingMount(n2);
3737
+ return;
3738
+ }
3717
3739
  if (disabled) {
3718
- mount(container, mainAnchor);
3740
+ mount(n2, container, mainAnchor);
3719
3741
  updateCssVars(n2, true);
3720
3742
  }
3721
- if (isTeleportDeferred(n2.props)) {
3722
- n2.el.__isMounted = false;
3723
- queuePostRenderEffect(() => {
3724
- mountToTarget();
3725
- delete n2.el.__isMounted;
3726
- }, parentSuspense);
3727
- } else {
3728
- mountToTarget();
3729
- }
3743
+ mountToTarget();
3730
3744
  } else {
3731
- if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
3732
- queuePostRenderEffect(() => {
3733
- TeleportImpl.process(
3734
- n1,
3735
- n2,
3736
- container,
3737
- anchor,
3738
- parentComponent,
3739
- parentSuspense,
3740
- namespace,
3741
- slotScopeIds,
3742
- optimized,
3743
- internals
3744
- );
3745
- }, parentSuspense);
3745
+ n2.el = n1.el;
3746
+ const mainAnchor = n2.anchor = n1.anchor;
3747
+ const pendingMount = pendingMounts.get(n1);
3748
+ if (pendingMount) {
3749
+ pendingMount.flags |= 8;
3750
+ pendingMounts.delete(n1);
3751
+ queuePendingMount(n2);
3746
3752
  return;
3747
3753
  }
3748
- n2.el = n1.el;
3749
3754
  n2.targetStart = n1.targetStart;
3750
- const mainAnchor = n2.anchor = n1.anchor;
3751
3755
  const target = n2.target = n1.target;
3752
3756
  const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3753
3757
  const wasDisabled = isTeleportDisabled(n1.props);
@@ -3840,13 +3844,19 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3840
3844
  target,
3841
3845
  props
3842
3846
  } = vnode;
3847
+ let shouldRemove = doRemove || !isTeleportDisabled(props);
3848
+ const pendingMount = pendingMounts.get(vnode);
3849
+ if (pendingMount) {
3850
+ pendingMount.flags |= 8;
3851
+ pendingMounts.delete(vnode);
3852
+ shouldRemove = false;
3853
+ }
3843
3854
  if (target) {
3844
3855
  hostRemove(targetStart);
3845
3856
  hostRemove(targetAnchor);
3846
3857
  }
3847
3858
  doRemove && hostRemove(anchor);
3848
3859
  if (shapeFlag & 16) {
3849
- const shouldRemove = doRemove || !isTeleportDisabled(props);
3850
3860
  for (let i = 0; i < children.length; i++) {
3851
3861
  const child = children[i];
3852
3862
  unmount(
@@ -4215,7 +4225,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4215
4225
  callHook(hook, [el]);
4216
4226
  },
4217
4227
  enter(el) {
4218
- if (leavingVNodesCache[key] === vnode) return;
4228
+ if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
4219
4229
  let hook = onEnter;
4220
4230
  let afterHook = onAfterEnter;
4221
4231
  let cancelHook = onEnterCancelled;
@@ -7404,7 +7414,7 @@ If this is a native custom element, make sure to exclude it from component resol
7404
7414
  return vm;
7405
7415
  }
7406
7416
  }
7407
- Vue.version = `2.6.14-compat:${"3.5.30"}`;
7417
+ Vue.version = `2.6.14-compat:${"3.5.32"}`;
7408
7418
  Vue.config = singletonApp.config;
7409
7419
  Vue.use = (plugin, ...options) => {
7410
7420
  if (plugin && isFunction(plugin.install)) {
@@ -8563,11 +8573,12 @@ If you want to remount the same app, move your app creation logic into a factory
8563
8573
  }
8564
8574
  return nextProp !== prevProp;
8565
8575
  }
8566
- function updateHOCHostEl({ vnode, parent }, el) {
8576
+ function updateHOCHostEl({ vnode, parent, suspense }, el) {
8567
8577
  while (parent) {
8568
8578
  const root = parent.subTree;
8569
8579
  if (root.suspense && root.suspense.activeBranch === vnode) {
8570
- root.el = vnode.el;
8580
+ root.suspense.vnode.el = root.el = el;
8581
+ vnode = root;
8571
8582
  }
8572
8583
  if (root === vnode) {
8573
8584
  (vnode = parent.vnode).el = el;
@@ -8576,6 +8587,9 @@ If you want to remount the same app, move your app creation logic into a factory
8576
8587
  break;
8577
8588
  }
8578
8589
  }
8590
+ if (suspense && suspense.activeBranch === vnode) {
8591
+ suspense.vnode.el = el;
8592
+ }
8579
8593
  }
8580
8594
 
8581
8595
  function createPropsDefaultThis(instance, rawProps, propKey) {
@@ -9489,10 +9503,17 @@ If you want to remount the same app, move your app creation logic into a factory
9489
9503
  }
9490
9504
  hostInsert(el, container, anchor);
9491
9505
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
9506
+ const isHmr = isHmrUpdating;
9492
9507
  queuePostRenderEffect(() => {
9493
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
9494
- needCallTransitionHooks && transition.enter(el);
9495
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
9508
+ let prev;
9509
+ prev = setHmrUpdating(isHmr);
9510
+ try {
9511
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
9512
+ needCallTransitionHooks && transition.enter(el);
9513
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
9514
+ } finally {
9515
+ setHmrUpdating(prev);
9516
+ }
9496
9517
  }, parentSuspense);
9497
9518
  }
9498
9519
  };
@@ -10438,7 +10459,8 @@ If you want to remount the same app, move your app creation logic into a factory
10438
10459
  shapeFlag,
10439
10460
  patchFlag,
10440
10461
  dirs,
10441
- cacheIndex
10462
+ cacheIndex,
10463
+ memo
10442
10464
  } = vnode;
10443
10465
  if (patchFlag === -2) {
10444
10466
  optimized = false;
@@ -10500,10 +10522,14 @@ If you want to remount the same app, move your app creation logic into a factory
10500
10522
  remove(vnode);
10501
10523
  }
10502
10524
  }
10503
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
10525
+ const shouldInvalidateMemo = memo != null && cacheIndex == null;
10526
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
10504
10527
  queuePostRenderEffect(() => {
10505
10528
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
10506
10529
  shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
10530
+ if (shouldInvalidateMemo) {
10531
+ vnode.el = null;
10532
+ }
10507
10533
  }, parentSuspense);
10508
10534
  }
10509
10535
  };
@@ -11066,6 +11092,7 @@ If you want to remount the same app, move your app creation logic into a factory
11066
11092
  pendingId: suspenseId++,
11067
11093
  timeout: typeof timeout === "number" ? timeout : -1,
11068
11094
  activeBranch: null,
11095
+ isFallbackMountPending: false,
11069
11096
  pendingBranch: null,
11070
11097
  isInFallback: !isHydrating,
11071
11098
  isHydrating,
@@ -11115,7 +11142,7 @@ If you want to remount the same app, move your app creation logic into a factory
11115
11142
  }
11116
11143
  };
11117
11144
  }
11118
- if (activeBranch) {
11145
+ if (activeBranch && !suspense.isFallbackMountPending) {
11119
11146
  if (parentNode(activeBranch.el) === container2) {
11120
11147
  anchor = next(activeBranch);
11121
11148
  }
@@ -11128,6 +11155,7 @@ If you want to remount the same app, move your app creation logic into a factory
11128
11155
  move(pendingBranch, container2, anchor, 0);
11129
11156
  }
11130
11157
  }
11158
+ suspense.isFallbackMountPending = false;
11131
11159
  setActiveBranch(suspense, pendingBranch);
11132
11160
  suspense.pendingBranch = null;
11133
11161
  suspense.isInFallback = false;
@@ -11163,6 +11191,7 @@ If you want to remount the same app, move your app creation logic into a factory
11163
11191
  triggerEvent(vnode2, "onFallback");
11164
11192
  const anchor2 = next(activeBranch);
11165
11193
  const mountFallback = () => {
11194
+ suspense.isFallbackMountPending = false;
11166
11195
  if (!suspense.isInFallback) {
11167
11196
  return;
11168
11197
  }
@@ -11182,6 +11211,7 @@ If you want to remount the same app, move your app creation logic into a factory
11182
11211
  };
11183
11212
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
11184
11213
  if (delayEnter) {
11214
+ suspense.isFallbackMountPending = true;
11185
11215
  activeBranch.transition.afterLeave = mountFallback;
11186
11216
  }
11187
11217
  suspense.isInFallback = true;
@@ -11216,6 +11246,7 @@ If you want to remount the same app, move your app creation logic into a factory
11216
11246
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
11217
11247
  return;
11218
11248
  }
11249
+ unsetCurrentInstance();
11219
11250
  instance.asyncResolved = true;
11220
11251
  const { vnode: vnode2 } = instance;
11221
11252
  {
@@ -11799,6 +11830,10 @@ Component that was made reactive: `,
11799
11830
  const incoming = toMerge[key];
11800
11831
  if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
11801
11832
  ret[key] = existing ? [].concat(existing, incoming) : incoming;
11833
+ } else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
11834
+ // the model listener.
11835
+ !isModelListener(key)) {
11836
+ ret[key] = incoming;
11802
11837
  }
11803
11838
  } else if (key !== "") {
11804
11839
  ret[key] = toMerge[key];
@@ -12481,7 +12516,7 @@ Component that was made reactive: `,
12481
12516
  return true;
12482
12517
  }
12483
12518
 
12484
- const version = "3.5.30";
12519
+ const version = "3.5.32";
12485
12520
  const warn = warn$1 ;
12486
12521
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12487
12522
  const devtools = devtools$1 ;
@@ -14138,7 +14173,8 @@ Expected function or array of functions, received type ${typeof value}.`
14138
14173
  if (elValue === newValue) {
14139
14174
  return;
14140
14175
  }
14141
- if (document.activeElement === el && el.type !== "range") {
14176
+ const rootNode = el.getRootNode();
14177
+ if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
14142
14178
  if (lazy && value === oldValue) {
14143
14179
  return;
14144
14180
  }