vue 3.5.38 → 3.5.39

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 v3.5.38
2
+ * vue v3.5.39
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1374,7 +1374,7 @@ var Vue = (function (exports) {
1374
1374
  value,
1375
1375
  isRef(target) ? target : receiver
1376
1376
  );
1377
- if (target === toRaw(receiver)) {
1377
+ if (target === toRaw(receiver) && result) {
1378
1378
  if (!hadKey) {
1379
1379
  trigger(target, "add", key, value);
1380
1380
  } else if (hasChanged(value, oldValue)) {
@@ -3356,11 +3356,9 @@ var Vue = (function (exports) {
3356
3356
  }
3357
3357
  } else {
3358
3358
  if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
3359
- const nextTarget = n2.target = resolveTarget(
3360
- n2.props,
3361
- querySelector
3362
- );
3359
+ const nextTarget = resolveTarget(n2.props, querySelector);
3363
3360
  if (nextTarget) {
3361
+ n2.target = nextTarget;
3364
3362
  moveTeleport(
3365
3363
  n2,
3366
3364
  nextTarget,
@@ -3398,7 +3396,8 @@ var Vue = (function (exports) {
3398
3396
  target,
3399
3397
  props
3400
3398
  } = vnode;
3401
- const shouldRemove = doRemove || !isTeleportDisabled(props);
3399
+ const disabled = isTeleportDisabled(props);
3400
+ const shouldRemove = doRemove || !disabled;
3402
3401
  const pendingMount = pendingMounts.get(vnode);
3403
3402
  if (pendingMount) {
3404
3403
  pendingMount.flags |= 8;
@@ -3409,7 +3408,7 @@ var Vue = (function (exports) {
3409
3408
  hostRemove(targetAnchor);
3410
3409
  }
3411
3410
  doRemove && hostRemove(anchor);
3412
- if (!pendingMount && shapeFlag & 16) {
3411
+ if (!pendingMount && (disabled || target) && shapeFlag & 16) {
3413
3412
  for (let i = 0; i < children.length; i++) {
3414
3413
  const child = children[i];
3415
3414
  unmount(
@@ -4052,7 +4051,12 @@ var Vue = (function (exports) {
4052
4051
  }
4053
4052
  }
4054
4053
  if (isFunction(ref)) {
4055
- callWithErrorHandling(ref, owner, 12, [value, refs]);
4054
+ pauseTracking();
4055
+ try {
4056
+ callWithErrorHandling(ref, owner, 12, [value, refs]);
4057
+ } finally {
4058
+ resetTracking();
4059
+ }
4056
4060
  } else {
4057
4061
  const _isString = isString(ref);
4058
4062
  const _isRef = isRef(ref);
@@ -4344,7 +4348,15 @@ var Vue = (function (exports) {
4344
4348
  };
4345
4349
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
4346
4350
  optimized = optimized || !!vnode.dynamicChildren;
4347
- const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
4351
+ const {
4352
+ type,
4353
+ dynamicProps,
4354
+ props,
4355
+ patchFlag,
4356
+ shapeFlag,
4357
+ dirs,
4358
+ transition
4359
+ } = vnode;
4348
4360
  const forcePatch = type === "input" || type === "option";
4349
4361
  {
4350
4362
  if (dirs) {
@@ -4422,7 +4434,7 @@ Server rendered element contains more child nodes than client vdom.`
4422
4434
  logMismatchError();
4423
4435
  }
4424
4436
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4425
- key[0] === "." || isCustomElement && !isReservedProp(key)) {
4437
+ key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4426
4438
  patchProp(el, key, null, props[key], void 0, parentComponent);
4427
4439
  }
4428
4440
  }
@@ -4527,7 +4539,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4527
4539
  }
4528
4540
  };
4529
4541
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
4530
- if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
4542
+ if (!isNodeMismatchAllowed(node, vnode)) {
4531
4543
  warn$1(
4532
4544
  `Hydration node mismatch:
4533
4545
  - rendered on server:`,
@@ -4742,7 +4754,12 @@ Server rendered element contains fewer child nodes than client vdom.`
4742
4754
  el = el.parentElement;
4743
4755
  }
4744
4756
  }
4745
- const allowedAttr = el && el.getAttribute(allowMismatchAttr);
4757
+ return isMismatchAllowedByAttr(
4758
+ el && el.getAttribute(allowMismatchAttr),
4759
+ allowedType
4760
+ );
4761
+ }
4762
+ function isMismatchAllowedByAttr(allowedAttr, allowedType) {
4746
4763
  if (allowedAttr == null) {
4747
4764
  return false;
4748
4765
  } else if (allowedAttr === "") {
@@ -4755,6 +4772,19 @@ Server rendered element contains fewer child nodes than client vdom.`
4755
4772
  return list.includes(MismatchTypeString[allowedType]);
4756
4773
  }
4757
4774
  }
4775
+ function isNodeMismatchAllowed(node, vnode) {
4776
+ return isMismatchAllowed(node.parentElement, 1 /* CHILDREN */) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
4777
+ }
4778
+ function isMismatchAllowedByNode(node) {
4779
+ return node.nodeType === 1 && isMismatchAllowedByAttr(
4780
+ node.getAttribute(allowMismatchAttr),
4781
+ 1 /* CHILDREN */
4782
+ );
4783
+ }
4784
+ function isMismatchAllowedByVNode({ props }) {
4785
+ const allowedAttr = props && props[allowMismatchAttr];
4786
+ return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1 /* CHILDREN */);
4787
+ }
4758
4788
 
4759
4789
  const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
4760
4790
  const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
@@ -6743,7 +6773,8 @@ If you want to remount the same app, move your app creation logic into a factory
6743
6773
  if (!options || !isOn(key)) {
6744
6774
  return false;
6745
6775
  }
6746
- key = key.slice(2).replace(/Once$/, "");
6776
+ key = key.slice(2);
6777
+ key = key === "Once" ? key : key.replace(/Once$/, "");
6747
6778
  return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
6748
6779
  }
6749
6780
 
@@ -7967,7 +7998,12 @@ If you want to remount the same app, move your app creation logic into a factory
7967
7998
  invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
7968
7999
  }
7969
8000
  parentComponent && toggleRecurse(parentComponent, true);
7970
- if (isHmrUpdating) {
8001
+ if (
8002
+ // HMR updated, force full diff
8003
+ isHmrUpdating || // #6385 the old vnode may be a user-wrapped non-isomorphic block
8004
+ // Force full diff when block metadata is unstable.
8005
+ dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)
8006
+ ) {
7971
8007
  patchFlag = 0;
7972
8008
  optimized = false;
7973
8009
  dynamicChildren = null;
@@ -10100,6 +10136,10 @@ Component that was made reactive: `,
10100
10136
  }
10101
10137
  }
10102
10138
  } else if (isFunction(children)) {
10139
+ if (shapeFlag & (1 | 64)) {
10140
+ normalizeChildren(vnode, { default: children });
10141
+ return;
10142
+ }
10103
10143
  children = { default: children, _ctx: currentRenderingInstance };
10104
10144
  type = 32;
10105
10145
  } else {
@@ -10804,7 +10844,7 @@ Component that was made reactive: `,
10804
10844
  return true;
10805
10845
  }
10806
10846
 
10807
- const version = "3.5.38";
10847
+ const version = "3.5.39";
10808
10848
  const warn = warn$1 ;
10809
10849
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10810
10850
  const devtools = devtools$1 ;
@@ -11518,16 +11558,15 @@ Component that was made reactive: `,
11518
11558
  }
11519
11559
  }
11520
11560
  }
11521
- const optionsModifierRE = /(?:Once|Passive|Capture)$/;
11561
+ const optionsModifierRE = /(Once|Passive|Capture)$/;
11562
+ const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
11522
11563
  function parseName(name) {
11523
11564
  let options;
11524
- if (optionsModifierRE.test(name)) {
11525
- options = {};
11526
- let m;
11527
- while (m = name.match(optionsModifierRE)) {
11528
- name = name.slice(0, name.length - m[0].length);
11529
- options[m[0].toLowerCase()] = true;
11530
- }
11565
+ let m;
11566
+ while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
11567
+ if (!options) options = {};
11568
+ name = name.slice(0, name.length - m[1].length);
11569
+ options[m[1].toLowerCase()] = true;
11531
11570
  }
11532
11571
  const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
11533
11572
  return [event, options];