@vue/compat 3.3.7 → 3.4.0-alpha.1
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.
- package/dist/vue.cjs.js +291 -227
- package/dist/vue.cjs.prod.js +245 -200
- package/dist/vue.esm-browser.js +292 -228
- package/dist/vue.esm-browser.prod.js +4 -4
- package/dist/vue.esm-bundler.js +293 -237
- package/dist/vue.global.js +291 -227
- package/dist/vue.global.prod.js +5 -5
- package/dist/vue.runtime.esm-browser.js +292 -228
- package/dist/vue.runtime.esm-browser.prod.js +5 -5
- package/dist/vue.runtime.esm-bundler.js +293 -237
- package/dist/vue.runtime.global.js +291 -227
- package/dist/vue.runtime.global.prod.js +5 -5
- package/package.json +2 -2
package/dist/vue.global.js
CHANGED
|
@@ -422,117 +422,120 @@ var Vue = (function () {
|
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
const createDep = (effects) => {
|
|
426
|
-
const dep = new Set(effects);
|
|
427
|
-
dep.w = 0;
|
|
428
|
-
dep.n = 0;
|
|
429
|
-
return dep;
|
|
430
|
-
};
|
|
431
|
-
const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
|
|
432
|
-
const newTracked = (dep) => (dep.n & trackOpBit) > 0;
|
|
433
|
-
const initDepMarkers = ({ deps }) => {
|
|
434
|
-
if (deps.length) {
|
|
435
|
-
for (let i = 0; i < deps.length; i++) {
|
|
436
|
-
deps[i].w |= trackOpBit;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
};
|
|
440
|
-
const finalizeDepMarkers = (effect) => {
|
|
441
|
-
const { deps } = effect;
|
|
442
|
-
if (deps.length) {
|
|
443
|
-
let ptr = 0;
|
|
444
|
-
for (let i = 0; i < deps.length; i++) {
|
|
445
|
-
const dep = deps[i];
|
|
446
|
-
if (wasTracked(dep) && !newTracked(dep)) {
|
|
447
|
-
dep.delete(effect);
|
|
448
|
-
} else {
|
|
449
|
-
deps[ptr++] = dep;
|
|
450
|
-
}
|
|
451
|
-
dep.w &= ~trackOpBit;
|
|
452
|
-
dep.n &= ~trackOpBit;
|
|
453
|
-
}
|
|
454
|
-
deps.length = ptr;
|
|
455
|
-
}
|
|
456
|
-
};
|
|
457
|
-
|
|
458
|
-
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
459
|
-
let effectTrackDepth = 0;
|
|
460
|
-
let trackOpBit = 1;
|
|
461
|
-
const maxMarkerBits = 30;
|
|
462
425
|
let activeEffect;
|
|
463
|
-
const ITERATE_KEY = Symbol("iterate" );
|
|
464
|
-
const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate" );
|
|
465
426
|
class ReactiveEffect {
|
|
466
|
-
constructor(fn, scheduler
|
|
427
|
+
constructor(fn, trigger, scheduler, scope) {
|
|
467
428
|
this.fn = fn;
|
|
429
|
+
this.trigger = trigger;
|
|
468
430
|
this.scheduler = scheduler;
|
|
469
431
|
this.active = true;
|
|
470
432
|
this.deps = [];
|
|
471
|
-
|
|
433
|
+
/**
|
|
434
|
+
* @internal
|
|
435
|
+
*/
|
|
436
|
+
this._dirtyLevel = 3;
|
|
437
|
+
/**
|
|
438
|
+
* @internal
|
|
439
|
+
*/
|
|
440
|
+
this._trackId = 0;
|
|
441
|
+
/**
|
|
442
|
+
* @internal
|
|
443
|
+
*/
|
|
444
|
+
this._runnings = 0;
|
|
445
|
+
/**
|
|
446
|
+
* @internal
|
|
447
|
+
*/
|
|
448
|
+
this._queryings = 0;
|
|
449
|
+
/**
|
|
450
|
+
* @internal
|
|
451
|
+
*/
|
|
452
|
+
this._depsLength = 0;
|
|
472
453
|
recordEffectScope(this, scope);
|
|
473
454
|
}
|
|
455
|
+
get dirty() {
|
|
456
|
+
if (this._dirtyLevel === 1) {
|
|
457
|
+
this._dirtyLevel = 0;
|
|
458
|
+
this._queryings++;
|
|
459
|
+
pauseTracking();
|
|
460
|
+
for (const dep of this.deps) {
|
|
461
|
+
if (dep.computed) {
|
|
462
|
+
triggerComputed(dep.computed);
|
|
463
|
+
if (this._dirtyLevel >= 2) {
|
|
464
|
+
break;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
resetTracking();
|
|
469
|
+
this._queryings--;
|
|
470
|
+
}
|
|
471
|
+
return this._dirtyLevel >= 2;
|
|
472
|
+
}
|
|
473
|
+
set dirty(v) {
|
|
474
|
+
this._dirtyLevel = v ? 3 : 0;
|
|
475
|
+
}
|
|
474
476
|
run() {
|
|
477
|
+
this._dirtyLevel = 0;
|
|
475
478
|
if (!this.active) {
|
|
476
479
|
return this.fn();
|
|
477
480
|
}
|
|
478
|
-
let parent = activeEffect;
|
|
479
481
|
let lastShouldTrack = shouldTrack;
|
|
480
|
-
|
|
481
|
-
if (parent === this) {
|
|
482
|
-
return;
|
|
483
|
-
}
|
|
484
|
-
parent = parent.parent;
|
|
485
|
-
}
|
|
482
|
+
let lastEffect = activeEffect;
|
|
486
483
|
try {
|
|
487
|
-
this.parent = activeEffect;
|
|
488
|
-
activeEffect = this;
|
|
489
484
|
shouldTrack = true;
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
} else {
|
|
494
|
-
cleanupEffect(this);
|
|
495
|
-
}
|
|
485
|
+
activeEffect = this;
|
|
486
|
+
this._runnings++;
|
|
487
|
+
preCleanupEffect(this);
|
|
496
488
|
return this.fn();
|
|
497
489
|
} finally {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
trackOpBit = 1 << --effectTrackDepth;
|
|
502
|
-
activeEffect = this.parent;
|
|
490
|
+
postCleanupEffect(this);
|
|
491
|
+
this._runnings--;
|
|
492
|
+
activeEffect = lastEffect;
|
|
503
493
|
shouldTrack = lastShouldTrack;
|
|
504
|
-
this.parent = void 0;
|
|
505
|
-
if (this.deferStop) {
|
|
506
|
-
this.stop();
|
|
507
|
-
}
|
|
508
494
|
}
|
|
509
495
|
}
|
|
510
496
|
stop() {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
this.onStop();
|
|
517
|
-
}
|
|
497
|
+
var _a;
|
|
498
|
+
if (this.active) {
|
|
499
|
+
preCleanupEffect(this);
|
|
500
|
+
postCleanupEffect(this);
|
|
501
|
+
(_a = this.onStop) == null ? void 0 : _a.call(this);
|
|
518
502
|
this.active = false;
|
|
519
503
|
}
|
|
520
504
|
}
|
|
521
505
|
}
|
|
522
|
-
function
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
506
|
+
function triggerComputed(computed) {
|
|
507
|
+
return computed.value;
|
|
508
|
+
}
|
|
509
|
+
function preCleanupEffect(effect2) {
|
|
510
|
+
effect2._trackId++;
|
|
511
|
+
effect2._depsLength = 0;
|
|
512
|
+
}
|
|
513
|
+
function postCleanupEffect(effect2) {
|
|
514
|
+
if (effect2.deps && effect2.deps.length > effect2._depsLength) {
|
|
515
|
+
for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
|
|
516
|
+
cleanupDepEffect(effect2.deps[i], effect2);
|
|
517
|
+
}
|
|
518
|
+
effect2.deps.length = effect2._depsLength;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
function cleanupDepEffect(dep, effect2) {
|
|
522
|
+
const trackId = dep.get(effect2);
|
|
523
|
+
if (trackId !== void 0 && effect2._trackId !== trackId) {
|
|
524
|
+
dep.delete(effect2);
|
|
525
|
+
if (dep.size === 0) {
|
|
526
|
+
dep.cleanup();
|
|
527
527
|
}
|
|
528
|
-
deps.length = 0;
|
|
529
528
|
}
|
|
530
529
|
}
|
|
531
530
|
function effect(fn, options) {
|
|
532
531
|
if (fn.effect instanceof ReactiveEffect) {
|
|
533
532
|
fn = fn.effect.fn;
|
|
534
533
|
}
|
|
535
|
-
const _effect = new ReactiveEffect(fn)
|
|
534
|
+
const _effect = new ReactiveEffect(fn, NOOP, () => {
|
|
535
|
+
if (_effect.dirty) {
|
|
536
|
+
_effect.run();
|
|
537
|
+
}
|
|
538
|
+
});
|
|
536
539
|
if (options) {
|
|
537
540
|
extend(_effect, options);
|
|
538
541
|
if (options.scope)
|
|
@@ -549,6 +552,7 @@ var Vue = (function () {
|
|
|
549
552
|
runner.effect.stop();
|
|
550
553
|
}
|
|
551
554
|
let shouldTrack = true;
|
|
555
|
+
let pauseScheduleStack = 0;
|
|
552
556
|
const trackStack = [];
|
|
553
557
|
function pauseTracking() {
|
|
554
558
|
trackStack.push(shouldTrack);
|
|
@@ -558,6 +562,68 @@ var Vue = (function () {
|
|
|
558
562
|
const last = trackStack.pop();
|
|
559
563
|
shouldTrack = last === void 0 ? true : last;
|
|
560
564
|
}
|
|
565
|
+
function pauseScheduling() {
|
|
566
|
+
pauseScheduleStack++;
|
|
567
|
+
}
|
|
568
|
+
function resetScheduling() {
|
|
569
|
+
pauseScheduleStack--;
|
|
570
|
+
while (!pauseScheduleStack && queueEffectSchedulers.length) {
|
|
571
|
+
queueEffectSchedulers.shift()();
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
function trackEffect(effect2, dep, debuggerEventExtraInfo) {
|
|
575
|
+
var _a;
|
|
576
|
+
if (dep.get(effect2) !== effect2._trackId) {
|
|
577
|
+
dep.set(effect2, effect2._trackId);
|
|
578
|
+
const oldDep = effect2.deps[effect2._depsLength];
|
|
579
|
+
if (oldDep !== dep) {
|
|
580
|
+
if (oldDep) {
|
|
581
|
+
cleanupDepEffect(oldDep, effect2);
|
|
582
|
+
}
|
|
583
|
+
effect2.deps[effect2._depsLength++] = dep;
|
|
584
|
+
} else {
|
|
585
|
+
effect2._depsLength++;
|
|
586
|
+
}
|
|
587
|
+
{
|
|
588
|
+
(_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
const queueEffectSchedulers = [];
|
|
593
|
+
function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
|
|
594
|
+
var _a;
|
|
595
|
+
pauseScheduling();
|
|
596
|
+
for (const effect2 of dep.keys()) {
|
|
597
|
+
if (!effect2.allowRecurse && effect2._runnings) {
|
|
598
|
+
continue;
|
|
599
|
+
}
|
|
600
|
+
if (effect2._dirtyLevel < dirtyLevel && (!effect2._runnings || dirtyLevel !== 2)) {
|
|
601
|
+
const lastDirtyLevel = effect2._dirtyLevel;
|
|
602
|
+
effect2._dirtyLevel = dirtyLevel;
|
|
603
|
+
if (lastDirtyLevel === 0 && (!effect2._queryings || dirtyLevel !== 2)) {
|
|
604
|
+
{
|
|
605
|
+
(_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
606
|
+
}
|
|
607
|
+
effect2.trigger();
|
|
608
|
+
if (effect2.scheduler) {
|
|
609
|
+
queueEffectSchedulers.push(effect2.scheduler);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
resetScheduling();
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
const createDep = (cleanup, computed) => {
|
|
618
|
+
const dep = /* @__PURE__ */ new Map();
|
|
619
|
+
dep.cleanup = cleanup;
|
|
620
|
+
dep.computed = computed;
|
|
621
|
+
return dep;
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
625
|
+
const ITERATE_KEY = Symbol("iterate" );
|
|
626
|
+
const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate" );
|
|
561
627
|
function track(target, type, key) {
|
|
562
628
|
if (shouldTrack && activeEffect) {
|
|
563
629
|
let depsMap = targetMap.get(target);
|
|
@@ -566,35 +632,17 @@ var Vue = (function () {
|
|
|
566
632
|
}
|
|
567
633
|
let dep = depsMap.get(key);
|
|
568
634
|
if (!dep) {
|
|
569
|
-
depsMap.set(key, dep = createDep());
|
|
570
|
-
}
|
|
571
|
-
const eventInfo = { effect: activeEffect, target, type, key } ;
|
|
572
|
-
trackEffects(dep, eventInfo);
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
function trackEffects(dep, debuggerEventExtraInfo) {
|
|
576
|
-
let shouldTrack2 = false;
|
|
577
|
-
if (effectTrackDepth <= maxMarkerBits) {
|
|
578
|
-
if (!newTracked(dep)) {
|
|
579
|
-
dep.n |= trackOpBit;
|
|
580
|
-
shouldTrack2 = !wasTracked(dep);
|
|
581
|
-
}
|
|
582
|
-
} else {
|
|
583
|
-
shouldTrack2 = !dep.has(activeEffect);
|
|
584
|
-
}
|
|
585
|
-
if (shouldTrack2) {
|
|
586
|
-
dep.add(activeEffect);
|
|
587
|
-
activeEffect.deps.push(dep);
|
|
588
|
-
if (activeEffect.onTrack) {
|
|
589
|
-
activeEffect.onTrack(
|
|
590
|
-
extend(
|
|
591
|
-
{
|
|
592
|
-
effect: activeEffect
|
|
593
|
-
},
|
|
594
|
-
debuggerEventExtraInfo
|
|
595
|
-
)
|
|
596
|
-
);
|
|
635
|
+
depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
|
|
597
636
|
}
|
|
637
|
+
trackEffect(
|
|
638
|
+
activeEffect,
|
|
639
|
+
dep,
|
|
640
|
+
{
|
|
641
|
+
target,
|
|
642
|
+
type,
|
|
643
|
+
key
|
|
644
|
+
}
|
|
645
|
+
);
|
|
598
646
|
}
|
|
599
647
|
}
|
|
600
648
|
function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
@@ -642,49 +690,24 @@ var Vue = (function () {
|
|
|
642
690
|
break;
|
|
643
691
|
}
|
|
644
692
|
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
if (
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
triggerEffects(createDep(effects), eventInfo);
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
function triggerEffects(dep, debuggerEventExtraInfo) {
|
|
665
|
-
const effects = isArray(dep) ? dep : [...dep];
|
|
666
|
-
for (const effect2 of effects) {
|
|
667
|
-
if (effect2.computed) {
|
|
668
|
-
triggerEffect(effect2, debuggerEventExtraInfo);
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
for (const effect2 of effects) {
|
|
672
|
-
if (!effect2.computed) {
|
|
673
|
-
triggerEffect(effect2, debuggerEventExtraInfo);
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
function triggerEffect(effect2, debuggerEventExtraInfo) {
|
|
678
|
-
if (effect2 !== activeEffect || effect2.allowRecurse) {
|
|
679
|
-
if (effect2.onTrigger) {
|
|
680
|
-
effect2.onTrigger(extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
681
|
-
}
|
|
682
|
-
if (effect2.scheduler) {
|
|
683
|
-
effect2.scheduler();
|
|
684
|
-
} else {
|
|
685
|
-
effect2.run();
|
|
693
|
+
pauseScheduling();
|
|
694
|
+
for (const dep of deps) {
|
|
695
|
+
if (dep) {
|
|
696
|
+
triggerEffects(
|
|
697
|
+
dep,
|
|
698
|
+
3,
|
|
699
|
+
{
|
|
700
|
+
target,
|
|
701
|
+
type,
|
|
702
|
+
key,
|
|
703
|
+
newValue,
|
|
704
|
+
oldValue,
|
|
705
|
+
oldTarget
|
|
706
|
+
}
|
|
707
|
+
);
|
|
686
708
|
}
|
|
687
709
|
}
|
|
710
|
+
resetScheduling();
|
|
688
711
|
}
|
|
689
712
|
function getDepFromReactive(object, key) {
|
|
690
713
|
var _a;
|
|
@@ -715,7 +738,9 @@ var Vue = (function () {
|
|
|
715
738
|
["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
|
|
716
739
|
instrumentations[key] = function(...args) {
|
|
717
740
|
pauseTracking();
|
|
741
|
+
pauseScheduling();
|
|
718
742
|
const res = toRaw(this)[key].apply(this, args);
|
|
743
|
+
resetScheduling();
|
|
719
744
|
resetTracking();
|
|
720
745
|
return res;
|
|
721
746
|
};
|
|
@@ -1254,30 +1279,93 @@ var Vue = (function () {
|
|
|
1254
1279
|
const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
1255
1280
|
const toReadonly = (value) => isObject(value) ? readonly(value) : value;
|
|
1256
1281
|
|
|
1282
|
+
class ComputedRefImpl {
|
|
1283
|
+
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1284
|
+
this._setter = _setter;
|
|
1285
|
+
this.dep = void 0;
|
|
1286
|
+
this.__v_isRef = true;
|
|
1287
|
+
this["__v_isReadonly"] = false;
|
|
1288
|
+
this.effect = new ReactiveEffect(getter, () => {
|
|
1289
|
+
triggerRefValue(this, 1);
|
|
1290
|
+
});
|
|
1291
|
+
this.effect.computed = this;
|
|
1292
|
+
this.effect.active = this._cacheable = !isSSR;
|
|
1293
|
+
this["__v_isReadonly"] = isReadonly;
|
|
1294
|
+
}
|
|
1295
|
+
get value() {
|
|
1296
|
+
const self = toRaw(this);
|
|
1297
|
+
trackRefValue(self);
|
|
1298
|
+
if (!self._cacheable || self.effect.dirty) {
|
|
1299
|
+
if (hasChanged(self._value, self._value = self.effect.run())) {
|
|
1300
|
+
triggerRefValue(self, 2);
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
return self._value;
|
|
1304
|
+
}
|
|
1305
|
+
set value(newValue) {
|
|
1306
|
+
this._setter(newValue);
|
|
1307
|
+
}
|
|
1308
|
+
// #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
|
|
1309
|
+
get _dirty() {
|
|
1310
|
+
return this.effect.dirty;
|
|
1311
|
+
}
|
|
1312
|
+
set _dirty(v) {
|
|
1313
|
+
this.effect.dirty = v;
|
|
1314
|
+
}
|
|
1315
|
+
// #endregion
|
|
1316
|
+
}
|
|
1317
|
+
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1318
|
+
let getter;
|
|
1319
|
+
let setter;
|
|
1320
|
+
const onlyGetter = isFunction(getterOrOptions);
|
|
1321
|
+
if (onlyGetter) {
|
|
1322
|
+
getter = getterOrOptions;
|
|
1323
|
+
setter = () => {
|
|
1324
|
+
console.warn("Write operation failed: computed value is readonly");
|
|
1325
|
+
} ;
|
|
1326
|
+
} else {
|
|
1327
|
+
getter = getterOrOptions.get;
|
|
1328
|
+
setter = getterOrOptions.set;
|
|
1329
|
+
}
|
|
1330
|
+
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
1331
|
+
if (debugOptions && !isSSR) {
|
|
1332
|
+
cRef.effect.onTrack = debugOptions.onTrack;
|
|
1333
|
+
cRef.effect.onTrigger = debugOptions.onTrigger;
|
|
1334
|
+
}
|
|
1335
|
+
return cRef;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1257
1338
|
function trackRefValue(ref2) {
|
|
1258
1339
|
if (shouldTrack && activeEffect) {
|
|
1259
1340
|
ref2 = toRaw(ref2);
|
|
1260
|
-
|
|
1261
|
-
|
|
1341
|
+
trackEffect(
|
|
1342
|
+
activeEffect,
|
|
1343
|
+
ref2.dep || (ref2.dep = createDep(
|
|
1344
|
+
() => ref2.dep = void 0,
|
|
1345
|
+
ref2 instanceof ComputedRefImpl ? ref2 : void 0
|
|
1346
|
+
)),
|
|
1347
|
+
{
|
|
1262
1348
|
target: ref2,
|
|
1263
1349
|
type: "get",
|
|
1264
1350
|
key: "value"
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1351
|
+
}
|
|
1352
|
+
);
|
|
1267
1353
|
}
|
|
1268
1354
|
}
|
|
1269
|
-
function triggerRefValue(ref2, newVal) {
|
|
1355
|
+
function triggerRefValue(ref2, dirtyLevel = 3, newVal) {
|
|
1270
1356
|
ref2 = toRaw(ref2);
|
|
1271
1357
|
const dep = ref2.dep;
|
|
1272
1358
|
if (dep) {
|
|
1273
|
-
|
|
1274
|
-
|
|
1359
|
+
triggerEffects(
|
|
1360
|
+
dep,
|
|
1361
|
+
dirtyLevel,
|
|
1362
|
+
{
|
|
1275
1363
|
target: ref2,
|
|
1276
1364
|
type: "set",
|
|
1277
1365
|
key: "value",
|
|
1278
1366
|
newValue: newVal
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1367
|
+
}
|
|
1368
|
+
);
|
|
1281
1369
|
}
|
|
1282
1370
|
}
|
|
1283
1371
|
function isRef(r) {
|
|
@@ -1313,12 +1401,12 @@ var Vue = (function () {
|
|
|
1313
1401
|
if (hasChanged(newVal, this._rawValue)) {
|
|
1314
1402
|
this._rawValue = newVal;
|
|
1315
1403
|
this._value = useDirectValue ? newVal : toReactive(newVal);
|
|
1316
|
-
triggerRefValue(this, newVal);
|
|
1404
|
+
triggerRefValue(this, 3, newVal);
|
|
1317
1405
|
}
|
|
1318
1406
|
}
|
|
1319
1407
|
}
|
|
1320
1408
|
function triggerRef(ref2) {
|
|
1321
|
-
triggerRefValue(ref2, ref2.value );
|
|
1409
|
+
triggerRefValue(ref2, 3, ref2.value );
|
|
1322
1410
|
}
|
|
1323
1411
|
function unref(ref2) {
|
|
1324
1412
|
return isRef(ref2) ? ref2.value : ref2;
|
|
@@ -1416,57 +1504,6 @@ var Vue = (function () {
|
|
|
1416
1504
|
return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
|
|
1417
1505
|
}
|
|
1418
1506
|
|
|
1419
|
-
class ComputedRefImpl {
|
|
1420
|
-
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1421
|
-
this._setter = _setter;
|
|
1422
|
-
this.dep = void 0;
|
|
1423
|
-
this.__v_isRef = true;
|
|
1424
|
-
this["__v_isReadonly"] = false;
|
|
1425
|
-
this._dirty = true;
|
|
1426
|
-
this.effect = new ReactiveEffect(getter, () => {
|
|
1427
|
-
if (!this._dirty) {
|
|
1428
|
-
this._dirty = true;
|
|
1429
|
-
triggerRefValue(this);
|
|
1430
|
-
}
|
|
1431
|
-
});
|
|
1432
|
-
this.effect.computed = this;
|
|
1433
|
-
this.effect.active = this._cacheable = !isSSR;
|
|
1434
|
-
this["__v_isReadonly"] = isReadonly;
|
|
1435
|
-
}
|
|
1436
|
-
get value() {
|
|
1437
|
-
const self = toRaw(this);
|
|
1438
|
-
trackRefValue(self);
|
|
1439
|
-
if (self._dirty || !self._cacheable) {
|
|
1440
|
-
self._dirty = false;
|
|
1441
|
-
self._value = self.effect.run();
|
|
1442
|
-
}
|
|
1443
|
-
return self._value;
|
|
1444
|
-
}
|
|
1445
|
-
set value(newValue) {
|
|
1446
|
-
this._setter(newValue);
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1450
|
-
let getter;
|
|
1451
|
-
let setter;
|
|
1452
|
-
const onlyGetter = isFunction(getterOrOptions);
|
|
1453
|
-
if (onlyGetter) {
|
|
1454
|
-
getter = getterOrOptions;
|
|
1455
|
-
setter = () => {
|
|
1456
|
-
console.warn("Write operation failed: computed value is readonly");
|
|
1457
|
-
} ;
|
|
1458
|
-
} else {
|
|
1459
|
-
getter = getterOrOptions.get;
|
|
1460
|
-
setter = getterOrOptions.set;
|
|
1461
|
-
}
|
|
1462
|
-
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
1463
|
-
if (debugOptions && !isSSR) {
|
|
1464
|
-
cRef.effect.onTrack = debugOptions.onTrack;
|
|
1465
|
-
cRef.effect.onTrigger = debugOptions.onTrigger;
|
|
1466
|
-
}
|
|
1467
|
-
return cRef;
|
|
1468
|
-
}
|
|
1469
|
-
|
|
1470
1507
|
const stack = [];
|
|
1471
1508
|
function pushWarningContext(vnode) {
|
|
1472
1509
|
stack.push(vnode);
|
|
@@ -1581,7 +1618,7 @@ var Vue = (function () {
|
|
|
1581
1618
|
}
|
|
1582
1619
|
}
|
|
1583
1620
|
|
|
1584
|
-
const ErrorTypeStrings = {
|
|
1621
|
+
const ErrorTypeStrings$1 = {
|
|
1585
1622
|
["sp"]: "serverPrefetch hook",
|
|
1586
1623
|
["bc"]: "beforeCreate hook",
|
|
1587
1624
|
["c"]: "created hook",
|
|
@@ -1642,7 +1679,7 @@ var Vue = (function () {
|
|
|
1642
1679
|
if (instance) {
|
|
1643
1680
|
let cur = instance.parent;
|
|
1644
1681
|
const exposedInstance = instance.proxy;
|
|
1645
|
-
const errorInfo = ErrorTypeStrings[type] ;
|
|
1682
|
+
const errorInfo = ErrorTypeStrings$1[type] ;
|
|
1646
1683
|
while (cur) {
|
|
1647
1684
|
const errorCapturedHooks = cur.ec;
|
|
1648
1685
|
if (errorCapturedHooks) {
|
|
@@ -1669,7 +1706,7 @@ var Vue = (function () {
|
|
|
1669
1706
|
}
|
|
1670
1707
|
function logError(err, type, contextVNode, throwInDev = true) {
|
|
1671
1708
|
{
|
|
1672
|
-
const info = ErrorTypeStrings[type];
|
|
1709
|
+
const info = ErrorTypeStrings$1[type];
|
|
1673
1710
|
if (contextVNode) {
|
|
1674
1711
|
pushWarningContext(contextVNode);
|
|
1675
1712
|
}
|
|
@@ -1897,6 +1934,7 @@ var Vue = (function () {
|
|
|
1897
1934
|
}
|
|
1898
1935
|
instance.renderCache = [];
|
|
1899
1936
|
isHmrUpdating = true;
|
|
1937
|
+
instance.effect.dirty = true;
|
|
1900
1938
|
instance.update();
|
|
1901
1939
|
isHmrUpdating = false;
|
|
1902
1940
|
});
|
|
@@ -1924,6 +1962,7 @@ var Vue = (function () {
|
|
|
1924
1962
|
instance.ceReload(newComp.styles);
|
|
1925
1963
|
hmrDirtyComponents.delete(oldComp);
|
|
1926
1964
|
} else if (instance.parent) {
|
|
1965
|
+
instance.parent.effect.dirty = true;
|
|
1927
1966
|
queueJob(instance.parent.update);
|
|
1928
1967
|
} else if (instance.appContext.reload) {
|
|
1929
1968
|
instance.appContext.reload();
|
|
@@ -3619,8 +3658,15 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
|
|
|
3619
3658
|
}
|
|
3620
3659
|
return doWatch(source, cb, options);
|
|
3621
3660
|
}
|
|
3622
|
-
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
3661
|
+
function doWatch(source, cb, { immediate, deep, flush, once, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
3623
3662
|
var _a;
|
|
3663
|
+
if (cb && once) {
|
|
3664
|
+
const _cb = cb;
|
|
3665
|
+
cb = (...args) => {
|
|
3666
|
+
_cb(...args);
|
|
3667
|
+
unwatch();
|
|
3668
|
+
};
|
|
3669
|
+
}
|
|
3624
3670
|
if (!cb) {
|
|
3625
3671
|
if (immediate !== void 0) {
|
|
3626
3672
|
warn(
|
|
@@ -3632,6 +3678,11 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
|
|
|
3632
3678
|
`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
|
|
3633
3679
|
);
|
|
3634
3680
|
}
|
|
3681
|
+
if (once !== void 0) {
|
|
3682
|
+
warn(
|
|
3683
|
+
`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
|
|
3684
|
+
);
|
|
3685
|
+
}
|
|
3635
3686
|
}
|
|
3636
3687
|
const warnInvalidSource = (s) => {
|
|
3637
3688
|
warn(
|
|
@@ -3709,7 +3760,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
|
|
|
3709
3760
|
};
|
|
3710
3761
|
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
|
|
3711
3762
|
const job = () => {
|
|
3712
|
-
if (!effect.active) {
|
|
3763
|
+
if (!effect.active || !effect.dirty) {
|
|
3713
3764
|
return;
|
|
3714
3765
|
}
|
|
3715
3766
|
if (cb) {
|
|
@@ -3742,7 +3793,13 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
|
|
|
3742
3793
|
job.id = instance.uid;
|
|
3743
3794
|
scheduler = () => queueJob(job);
|
|
3744
3795
|
}
|
|
3745
|
-
const effect = new ReactiveEffect(getter, scheduler);
|
|
3796
|
+
const effect = new ReactiveEffect(getter, NOOP, scheduler);
|
|
3797
|
+
const unwatch = () => {
|
|
3798
|
+
effect.stop();
|
|
3799
|
+
if (instance && instance.scope) {
|
|
3800
|
+
remove(instance.scope.effects, effect);
|
|
3801
|
+
}
|
|
3802
|
+
};
|
|
3746
3803
|
{
|
|
3747
3804
|
effect.onTrack = onTrack;
|
|
3748
3805
|
effect.onTrigger = onTrigger;
|
|
@@ -3761,12 +3818,6 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
|
|
|
3761
3818
|
} else {
|
|
3762
3819
|
effect.run();
|
|
3763
3820
|
}
|
|
3764
|
-
const unwatch = () => {
|
|
3765
|
-
effect.stop();
|
|
3766
|
-
if (instance && instance.scope) {
|
|
3767
|
-
remove(instance.scope.effects, effect);
|
|
3768
|
-
}
|
|
3769
|
-
};
|
|
3770
3821
|
return unwatch;
|
|
3771
3822
|
}
|
|
3772
3823
|
function instanceWatch(source, value, options) {
|
|
@@ -3999,6 +4050,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
|
|
|
3999
4050
|
leavingHooks.afterLeave = () => {
|
|
4000
4051
|
state.isLeaving = false;
|
|
4001
4052
|
if (instance.update.active !== false) {
|
|
4053
|
+
instance.effect.dirty = true;
|
|
4002
4054
|
instance.update();
|
|
4003
4055
|
}
|
|
4004
4056
|
};
|
|
@@ -4337,6 +4389,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
|
|
|
4337
4389
|
load().then(() => {
|
|
4338
4390
|
loaded.value = true;
|
|
4339
4391
|
if (instance.parent && isKeepAlive(instance.parent.vnode)) {
|
|
4392
|
+
instance.parent.effect.dirty = true;
|
|
4340
4393
|
queueJob(instance.parent.update);
|
|
4341
4394
|
}
|
|
4342
4395
|
}).catch((err) => {
|
|
@@ -4634,7 +4687,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
|
|
|
4634
4687
|
}
|
|
4635
4688
|
return wrappedHook;
|
|
4636
4689
|
} else {
|
|
4637
|
-
const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ""));
|
|
4690
|
+
const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
|
|
4638
4691
|
warn(
|
|
4639
4692
|
`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
|
|
4640
4693
|
);
|
|
@@ -5356,7 +5409,10 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
5356
5409
|
$root: (i) => getPublicInstance(i.root),
|
|
5357
5410
|
$emit: (i) => i.emit,
|
|
5358
5411
|
$options: (i) => resolveMergedOptions(i) ,
|
|
5359
|
-
$forceUpdate: (i) => i.f || (i.f = () =>
|
|
5412
|
+
$forceUpdate: (i) => i.f || (i.f = () => {
|
|
5413
|
+
i.effect.dirty = true;
|
|
5414
|
+
queueJob(i.update);
|
|
5415
|
+
}),
|
|
5360
5416
|
$nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
|
|
5361
5417
|
$watch: (i) => instanceWatch.bind(i)
|
|
5362
5418
|
})
|
|
@@ -6257,7 +6313,7 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
6257
6313
|
return vm;
|
|
6258
6314
|
}
|
|
6259
6315
|
}
|
|
6260
|
-
Vue.version = `2.6.14-compat:${"3.
|
|
6316
|
+
Vue.version = `2.6.14-compat:${"3.4.0-alpha.1"}`;
|
|
6261
6317
|
Vue.config = singletonApp.config;
|
|
6262
6318
|
Vue.use = (p, ...options) => {
|
|
6263
6319
|
if (p && isFunction(p.install)) {
|
|
@@ -8663,6 +8719,7 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8663
8719
|
} else {
|
|
8664
8720
|
instance.next = n2;
|
|
8665
8721
|
invalidateJob(instance.update);
|
|
8722
|
+
instance.effect.dirty = true;
|
|
8666
8723
|
instance.update();
|
|
8667
8724
|
}
|
|
8668
8725
|
} else {
|
|
@@ -8856,11 +8913,16 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
8856
8913
|
};
|
|
8857
8914
|
const effect = instance.effect = new ReactiveEffect(
|
|
8858
8915
|
componentUpdateFn,
|
|
8916
|
+
NOOP,
|
|
8859
8917
|
() => queueJob(update),
|
|
8860
8918
|
instance.scope
|
|
8861
8919
|
// track it in component's effect scope
|
|
8862
8920
|
);
|
|
8863
|
-
const update = instance.update = () =>
|
|
8921
|
+
const update = instance.update = () => {
|
|
8922
|
+
if (effect.dirty) {
|
|
8923
|
+
effect.run();
|
|
8924
|
+
}
|
|
8925
|
+
};
|
|
8864
8926
|
update.id = instance.uid;
|
|
8865
8927
|
toggleRecurse(instance, true);
|
|
8866
8928
|
{
|
|
@@ -10826,7 +10888,8 @@ Component that was made reactive: `,
|
|
|
10826
10888
|
return true;
|
|
10827
10889
|
}
|
|
10828
10890
|
|
|
10829
|
-
const version = "3.
|
|
10891
|
+
const version = "3.4.0-alpha.1";
|
|
10892
|
+
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
10830
10893
|
const ssrUtils = null;
|
|
10831
10894
|
const resolveFilter = resolveFilter$1 ;
|
|
10832
10895
|
const _compatUtils = {
|
|
@@ -12450,6 +12513,7 @@ Component that was made reactive: `,
|
|
|
12450
12513
|
BaseTransitionPropsValidators: BaseTransitionPropsValidators,
|
|
12451
12514
|
Comment: Comment,
|
|
12452
12515
|
EffectScope: EffectScope,
|
|
12516
|
+
ErrorTypeStrings: ErrorTypeStrings,
|
|
12453
12517
|
Fragment: Fragment,
|
|
12454
12518
|
KeepAlive: KeepAlive,
|
|
12455
12519
|
ReactiveEffect: ReactiveEffect,
|