@vue/runtime-dom 3.4.30 → 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/runtime-dom v3.4.30
2
+ * @vue/runtime-dom 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/runtime-dom v3.4.30
2
+ * @vue/runtime-dom 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/runtime-dom v3.4.30
2
+ * @vue/runtime-dom v3.4.31
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -260,11 +260,14 @@ function looseIndexOf(arr, val) {
260
260
  return arr.findIndex((item) => looseEqual(item, val));
261
261
  }
262
262
 
263
+ const isRef$1 = (val) => {
264
+ return !!(val && val.__v_isRef === true);
265
+ };
263
266
  const toDisplayString = (val) => {
264
- return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
267
+ 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);
265
268
  };
266
269
  const replacer = (_key, val) => {
267
- if (val && val.__v_isRef) {
270
+ if (isRef$1(val)) {
268
271
  return replacer(_key, val.value);
269
272
  } else if (isMap(val)) {
270
273
  return {
@@ -411,7 +414,7 @@ class ReactiveEffect {
411
414
  /**
412
415
  * @internal
413
416
  */
414
- this._dirtyLevel = 5;
417
+ this._dirtyLevel = 4;
415
418
  /**
416
419
  * @internal
417
420
  */
@@ -431,20 +434,14 @@ class ReactiveEffect {
431
434
  recordEffectScope(this, scope);
432
435
  }
433
436
  get dirty() {
434
- if (this._dirtyLevel === 2)
435
- return false;
436
- if (this._dirtyLevel === 3 || this._dirtyLevel === 4) {
437
+ if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
437
438
  this._dirtyLevel = 1;
438
439
  pauseTracking();
439
440
  for (let i = 0; i < this._depsLength; i++) {
440
441
  const dep = this.deps[i];
441
442
  if (dep.computed) {
442
- if (dep.computed.effect._dirtyLevel === 2) {
443
- resetTracking();
444
- return true;
445
- }
446
443
  triggerComputed(dep.computed);
447
- if (this._dirtyLevel >= 5) {
444
+ if (this._dirtyLevel >= 4) {
448
445
  break;
449
446
  }
450
447
  }
@@ -454,10 +451,10 @@ class ReactiveEffect {
454
451
  }
455
452
  resetTracking();
456
453
  }
457
- return this._dirtyLevel >= 5;
454
+ return this._dirtyLevel >= 4;
458
455
  }
459
456
  set dirty(v) {
460
- this._dirtyLevel = v ? 5 : 0;
457
+ this._dirtyLevel = v ? 4 : 0;
461
458
  }
462
459
  run() {
463
460
  this._dirtyLevel = 0;
@@ -579,17 +576,8 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
579
576
  pauseScheduling();
580
577
  for (const effect2 of dep.keys()) {
581
578
  let tracking;
582
- if (!dep.computed && effect2.computed) {
583
- if (effect2._runnings > 0 && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
584
- effect2._dirtyLevel = 2;
585
- continue;
586
- }
587
- }
588
579
  if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
589
580
  effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
590
- if (effect2.computed && effect2._dirtyLevel === 2) {
591
- effect2._shouldSchedule = true;
592
- }
593
581
  effect2._dirtyLevel = dirtyLevel;
594
582
  }
595
583
  if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
@@ -597,7 +585,7 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
597
585
  (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
598
586
  }
599
587
  effect2.trigger();
600
- if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 3) {
588
+ if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
601
589
  effect2._shouldSchedule = false;
602
590
  if (effect2.scheduler) {
603
591
  queueEffectSchedulers.push(effect2.scheduler);
@@ -689,7 +677,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
689
677
  if (dep) {
690
678
  triggerEffects(
691
679
  dep,
692
- 5,
680
+ 4,
693
681
  {
694
682
  target,
695
683
  type,
@@ -1292,7 +1280,7 @@ class ComputedRefImpl {
1292
1280
  () => getter(this._value),
1293
1281
  () => triggerRefValue(
1294
1282
  this,
1295
- this.effect._dirtyLevel === 3 ? 3 : 4
1283
+ this.effect._dirtyLevel === 2 ? 2 : 3
1296
1284
  )
1297
1285
  );
1298
1286
  this.effect.computed = this;
@@ -1301,11 +1289,8 @@ class ComputedRefImpl {
1301
1289
  }
1302
1290
  get value() {
1303
1291
  const self = toRaw(this);
1304
- const lastDirtyLevel = self.effect._dirtyLevel;
1305
1292
  if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
1306
- if (lastDirtyLevel !== 3) {
1307
- triggerRefValue(self, 5);
1308
- }
1293
+ triggerRefValue(self, 4);
1309
1294
  }
1310
1295
  trackRefValue(self);
1311
1296
  if (self.effect._dirtyLevel >= 2) {
@@ -1314,7 +1299,7 @@ class ComputedRefImpl {
1314
1299
 
1315
1300
  getter: `, this.getter);
1316
1301
  }
1317
- triggerRefValue(self, 3);
1302
+ triggerRefValue(self, 2);
1318
1303
  }
1319
1304
  return self._value;
1320
1305
  }
@@ -1369,7 +1354,7 @@ function trackRefValue(ref2) {
1369
1354
  );
1370
1355
  }
1371
1356
  }
1372
- function triggerRefValue(ref2, dirtyLevel = 5, newVal, oldVal) {
1357
+ function triggerRefValue(ref2, dirtyLevel = 4, newVal, oldVal) {
1373
1358
  ref2 = toRaw(ref2);
1374
1359
  const dep = ref2.dep;
1375
1360
  if (dep) {
@@ -1420,12 +1405,12 @@ class RefImpl {
1420
1405
  const oldVal = this._rawValue;
1421
1406
  this._rawValue = newVal;
1422
1407
  this._value = useDirectValue ? newVal : toReactive(newVal);
1423
- triggerRefValue(this, 5, newVal, oldVal);
1408
+ triggerRefValue(this, 4, newVal, oldVal);
1424
1409
  }
1425
1410
  }
1426
1411
  }
1427
1412
  function triggerRef(ref2) {
1428
- triggerRefValue(ref2, 5, ref2.value );
1413
+ triggerRefValue(ref2, 4, ref2.value );
1429
1414
  }
1430
1415
  function unref(ref2) {
1431
1416
  return isRef(ref2) ? ref2.value : ref2;
@@ -9583,7 +9568,7 @@ function isMemoSame(cached, memo) {
9583
9568
  return true;
9584
9569
  }
9585
9570
 
9586
- const version = "3.4.30";
9571
+ const version = "3.4.31";
9587
9572
  const warn = warn$1 ;
9588
9573
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9589
9574
  const devtools = devtools$1 ;