vue 3.4.29 → 3.4.31

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.4.29
2
+ * vue v3.4.31
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.4.29
2
+ * vue v3.4.31
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -330,11 +330,14 @@ var Vue = (function (exports) {
330
330
  return arr.findIndex((item) => looseEqual(item, val));
331
331
  }
332
332
 
333
+ const isRef$1 = (val) => {
334
+ return !!(val && val.__v_isRef === true);
335
+ };
333
336
  const toDisplayString = (val) => {
334
- return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
337
+ return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
335
338
  };
336
339
  const replacer = (_key, val) => {
337
- if (val && val.__v_isRef) {
340
+ if (isRef$1(val)) {
338
341
  return replacer(_key, val.value);
339
342
  } else if (isMap(val)) {
340
343
  return {
@@ -481,7 +484,7 @@ var Vue = (function (exports) {
481
484
  /**
482
485
  * @internal
483
486
  */
484
- this._dirtyLevel = 5;
487
+ this._dirtyLevel = 4;
485
488
  /**
486
489
  * @internal
487
490
  */
@@ -501,18 +504,14 @@ var Vue = (function (exports) {
501
504
  recordEffectScope(this, scope);
502
505
  }
503
506
  get dirty() {
504
- if (this._dirtyLevel === 2)
505
- return false;
506
- if (this._dirtyLevel === 3 || this._dirtyLevel === 4) {
507
+ if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
507
508
  this._dirtyLevel = 1;
508
509
  pauseTracking();
509
510
  for (let i = 0; i < this._depsLength; i++) {
510
511
  const dep = this.deps[i];
511
512
  if (dep.computed) {
512
- if (dep.computed.effect._dirtyLevel === 2)
513
- return true;
514
513
  triggerComputed(dep.computed);
515
- if (this._dirtyLevel >= 5) {
514
+ if (this._dirtyLevel >= 4) {
516
515
  break;
517
516
  }
518
517
  }
@@ -522,10 +521,10 @@ var Vue = (function (exports) {
522
521
  }
523
522
  resetTracking();
524
523
  }
525
- return this._dirtyLevel >= 5;
524
+ return this._dirtyLevel >= 4;
526
525
  }
527
526
  set dirty(v) {
528
- this._dirtyLevel = v ? 5 : 0;
527
+ this._dirtyLevel = v ? 4 : 0;
529
528
  }
530
529
  run() {
531
530
  this._dirtyLevel = 0;
@@ -646,18 +645,9 @@ var Vue = (function (exports) {
646
645
  var _a;
647
646
  pauseScheduling();
648
647
  for (const effect2 of dep.keys()) {
649
- if (!dep.computed && effect2.computed) {
650
- if (dep.get(effect2) === effect2._trackId && effect2._runnings > 0) {
651
- effect2._dirtyLevel = 2;
652
- continue;
653
- }
654
- }
655
648
  let tracking;
656
649
  if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
657
650
  effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
658
- if (effect2.computed && effect2._dirtyLevel === 2) {
659
- effect2._shouldSchedule = true;
660
- }
661
651
  effect2._dirtyLevel = dirtyLevel;
662
652
  }
663
653
  if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
@@ -665,7 +655,7 @@ var Vue = (function (exports) {
665
655
  (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
666
656
  }
667
657
  effect2.trigger();
668
- if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 3) {
658
+ if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
669
659
  effect2._shouldSchedule = false;
670
660
  if (effect2.scheduler) {
671
661
  queueEffectSchedulers.push(effect2.scheduler);
@@ -757,7 +747,7 @@ var Vue = (function (exports) {
757
747
  if (dep) {
758
748
  triggerEffects(
759
749
  dep,
760
- 5,
750
+ 4,
761
751
  {
762
752
  target,
763
753
  type,
@@ -1360,7 +1350,7 @@ var Vue = (function (exports) {
1360
1350
  () => getter(this._value),
1361
1351
  () => triggerRefValue(
1362
1352
  this,
1363
- this.effect._dirtyLevel === 3 ? 3 : 4
1353
+ this.effect._dirtyLevel === 2 ? 2 : 3
1364
1354
  )
1365
1355
  );
1366
1356
  this.effect.computed = this;
@@ -1370,7 +1360,7 @@ var Vue = (function (exports) {
1370
1360
  get value() {
1371
1361
  const self = toRaw(this);
1372
1362
  if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
1373
- triggerRefValue(self, 5);
1363
+ triggerRefValue(self, 4);
1374
1364
  }
1375
1365
  trackRefValue(self);
1376
1366
  if (self.effect._dirtyLevel >= 2) {
@@ -1379,7 +1369,7 @@ var Vue = (function (exports) {
1379
1369
 
1380
1370
  getter: `, this.getter);
1381
1371
  }
1382
- triggerRefValue(self, 3);
1372
+ triggerRefValue(self, 2);
1383
1373
  }
1384
1374
  return self._value;
1385
1375
  }
@@ -1434,7 +1424,7 @@ getter: `, this.getter);
1434
1424
  );
1435
1425
  }
1436
1426
  }
1437
- function triggerRefValue(ref2, dirtyLevel = 5, newVal, oldVal) {
1427
+ function triggerRefValue(ref2, dirtyLevel = 4, newVal, oldVal) {
1438
1428
  ref2 = toRaw(ref2);
1439
1429
  const dep = ref2.dep;
1440
1430
  if (dep) {
@@ -1485,12 +1475,12 @@ getter: `, this.getter);
1485
1475
  const oldVal = this._rawValue;
1486
1476
  this._rawValue = newVal;
1487
1477
  this._value = useDirectValue ? newVal : toReactive(newVal);
1488
- triggerRefValue(this, 5, newVal, oldVal);
1478
+ triggerRefValue(this, 4, newVal, oldVal);
1489
1479
  }
1490
1480
  }
1491
1481
  }
1492
1482
  function triggerRef(ref2) {
1493
- triggerRefValue(ref2, 5, ref2.value );
1483
+ triggerRefValue(ref2, 4, ref2.value );
1494
1484
  }
1495
1485
  function unref(ref2) {
1496
1486
  return isRef(ref2) ? ref2.value : ref2;
@@ -2818,7 +2808,6 @@ If this is a native custom element, make sure to exclude it from component resol
2818
2808
  }
2819
2809
  },
2820
2810
  hydrate: hydrateSuspense,
2821
- create: createSuspenseBoundary,
2822
2811
  normalize: normalizeSuspenseChildren
2823
2812
  };
2824
2813
  const Suspense = SuspenseImpl ;
@@ -5376,18 +5365,8 @@ If you want to remount the same app, move your app creation logic into a factory
5376
5365
  let domType = node.nodeType;
5377
5366
  vnode.el = node;
5378
5367
  {
5379
- if (!("__vnode" in node)) {
5380
- Object.defineProperty(node, "__vnode", {
5381
- value: vnode,
5382
- enumerable: false
5383
- });
5384
- }
5385
- if (!("__vueParentComponent" in node)) {
5386
- Object.defineProperty(node, "__vueParentComponent", {
5387
- value: parentComponent,
5388
- enumerable: false
5389
- });
5390
- }
5368
+ def(node, "__vnode", vnode, true);
5369
+ def(node, "__vueParentComponent", parentComponent, true);
5391
5370
  }
5392
5371
  if (patchFlag === -2) {
5393
5372
  optimized = false;
@@ -5610,7 +5589,9 @@ Server rendered element contains more child nodes than client vdom.`
5610
5589
  if (props) {
5611
5590
  {
5612
5591
  for (const key in props) {
5613
- if (propHasMismatch(el, key, props[key], vnode, parentComponent)) {
5592
+ if (// #11189 skip if this node has directives that have created hooks
5593
+ // as it could have mutated the DOM in any possible way
5594
+ !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
5614
5595
  logMismatchError();
5615
5596
  }
5616
5597
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
@@ -5785,7 +5766,6 @@ Server rendered element contains fewer child nodes than client vdom.`
5785
5766
  return [hydrate, hydrateNode];
5786
5767
  }
5787
5768
  function propHasMismatch(el, key, clientValue, vnode, instance) {
5788
- var _a;
5789
5769
  let mismatchType;
5790
5770
  let mismatchKey;
5791
5771
  let actual;
@@ -5808,13 +5788,8 @@ Server rendered element contains fewer child nodes than client vdom.`
5808
5788
  }
5809
5789
  }
5810
5790
  }
5811
- const root = instance == null ? void 0 : instance.subTree;
5812
- if (vnode === root || // eslint-disable-next-line no-restricted-syntax
5813
- (root == null ? void 0 : root.type) === Fragment && root.children.includes(vnode)) {
5814
- const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
5815
- for (const key2 in cssVars) {
5816
- expectedMap.set(`--${key2}`, String(cssVars[key2]));
5817
- }
5791
+ if (instance) {
5792
+ resolveCssVars(instance, vnode, expectedMap);
5818
5793
  }
5819
5794
  if (!isMapEqual(actualMap, expectedMap)) {
5820
5795
  mismatchType = mismatchKey = "style";
@@ -5874,8 +5849,8 @@ Server rendered element contains fewer child nodes than client vdom.`
5874
5849
  const styleMap = /* @__PURE__ */ new Map();
5875
5850
  for (const item of str.split(";")) {
5876
5851
  let [key, value] = item.split(":");
5877
- key = key == null ? void 0 : key.trim();
5878
- value = value == null ? void 0 : value.trim();
5852
+ key = key.trim();
5853
+ value = value && value.trim();
5879
5854
  if (key && value) {
5880
5855
  styleMap.set(key, value);
5881
5856
  }
@@ -5893,6 +5868,18 @@ Server rendered element contains fewer child nodes than client vdom.`
5893
5868
  }
5894
5869
  return true;
5895
5870
  }
5871
+ function resolveCssVars(instance, vnode, expectedMap) {
5872
+ const root = instance.subTree;
5873
+ if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
5874
+ const cssVars = instance.getCssVars();
5875
+ for (const key in cssVars) {
5876
+ expectedMap.set(`--${key}`, String(cssVars[key]));
5877
+ }
5878
+ }
5879
+ if (vnode === root && instance.parent) {
5880
+ resolveCssVars(instance.parent, instance.vnode, expectedMap);
5881
+ }
5882
+ }
5896
5883
 
5897
5884
  let supported;
5898
5885
  let perf;
@@ -6210,14 +6197,8 @@ Server rendered element contains fewer child nodes than client vdom.`
6210
6197
  }
6211
6198
  }
6212
6199
  {
6213
- Object.defineProperty(el, "__vnode", {
6214
- value: vnode,
6215
- enumerable: false
6216
- });
6217
- Object.defineProperty(el, "__vueParentComponent", {
6218
- value: parentComponent,
6219
- enumerable: false
6220
- });
6200
+ def(el, "__vnode", vnode, true);
6201
+ def(el, "__vueParentComponent", parentComponent, true);
6221
6202
  }
6222
6203
  if (dirs) {
6223
6204
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
@@ -6279,6 +6260,9 @@ Server rendered element contains fewer child nodes than client vdom.`
6279
6260
  };
6280
6261
  const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6281
6262
  const el = n2.el = n1.el;
6263
+ {
6264
+ el.__vnode = n2;
6265
+ }
6282
6266
  let { patchFlag, dynamicChildren, dirs } = n2;
6283
6267
  patchFlag |= n1.patchFlag & 16;
6284
6268
  const oldProps = n1.props || EMPTY_OBJ;
@@ -7173,6 +7157,9 @@ Server rendered element contains fewer child nodes than client vdom.`
7173
7157
  dirs,
7174
7158
  memoIndex
7175
7159
  } = vnode;
7160
+ if (patchFlag === -2) {
7161
+ optimized = false;
7162
+ }
7176
7163
  if (ref != null) {
7177
7164
  setRef(ref, null, parentSuspense, vnode, true);
7178
7165
  }
@@ -7204,7 +7191,6 @@ Server rendered element contains fewer child nodes than client vdom.`
7204
7191
  vnode,
7205
7192
  parentComponent,
7206
7193
  parentSuspense,
7207
- optimized,
7208
7194
  internals,
7209
7195
  doRemove
7210
7196
  );
@@ -8474,7 +8460,7 @@ Server rendered element contains fewer child nodes than client vdom.`
8474
8460
  }
8475
8461
  updateCssVars(n2);
8476
8462
  },
8477
- remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
8463
+ remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
8478
8464
  const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
8479
8465
  if (target) {
8480
8466
  hostRemove(targetAnchor);
@@ -9646,7 +9632,7 @@ Component that was made reactive: `,
9646
9632
  return true;
9647
9633
  }
9648
9634
 
9649
- const version = "3.4.29";
9635
+ const version = "3.4.31";
9650
9636
  const warn = warn$1 ;
9651
9637
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9652
9638
  const devtools = devtools$1 ;
@@ -10226,7 +10212,10 @@ Component that was made reactive: `,
10226
10212
  if (value == null || isBoolean && !includeBooleanAttr(value)) {
10227
10213
  el.removeAttribute(key);
10228
10214
  } else {
10229
- el.setAttribute(key, isBoolean ? "" : String(value));
10215
+ el.setAttribute(
10216
+ key,
10217
+ isBoolean ? "" : isSymbol(value) ? String(value) : value
10218
+ );
10230
10219
  }
10231
10220
  }
10232
10221
  }
@@ -10387,7 +10376,7 @@ Expected function or array of functions, received type ${typeof value}.`
10387
10376
  parentSuspense,
10388
10377
  unmountChildren
10389
10378
  );
10390
- if (key === "value" || key === "checked" || key === "selected") {
10379
+ if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
10391
10380
  patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
10392
10381
  }
10393
10382
  } else {
@@ -14970,9 +14959,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14970
14959
  break;
14971
14960
  }
14972
14961
  }
14973
- if (prev && isTemplateNode(prev) && findDir(prev, "if")) {
14974
- children.splice(i, 1);
14975
- i--;
14962
+ if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) {
14976
14963
  let conditional = dynamicSlots[dynamicSlots.length - 1];
14977
14964
  while (conditional.alternate.type === 19) {
14978
14965
  conditional = conditional.alternate;