@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.cjs.prod.js
CHANGED
|
@@ -419,117 +419,120 @@ function onScopeDispose(fn) {
|
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
|
|
422
|
-
const createDep = (effects) => {
|
|
423
|
-
const dep = new Set(effects);
|
|
424
|
-
dep.w = 0;
|
|
425
|
-
dep.n = 0;
|
|
426
|
-
return dep;
|
|
427
|
-
};
|
|
428
|
-
const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
|
|
429
|
-
const newTracked = (dep) => (dep.n & trackOpBit) > 0;
|
|
430
|
-
const initDepMarkers = ({ deps }) => {
|
|
431
|
-
if (deps.length) {
|
|
432
|
-
for (let i = 0; i < deps.length; i++) {
|
|
433
|
-
deps[i].w |= trackOpBit;
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
};
|
|
437
|
-
const finalizeDepMarkers = (effect) => {
|
|
438
|
-
const { deps } = effect;
|
|
439
|
-
if (deps.length) {
|
|
440
|
-
let ptr = 0;
|
|
441
|
-
for (let i = 0; i < deps.length; i++) {
|
|
442
|
-
const dep = deps[i];
|
|
443
|
-
if (wasTracked(dep) && !newTracked(dep)) {
|
|
444
|
-
dep.delete(effect);
|
|
445
|
-
} else {
|
|
446
|
-
deps[ptr++] = dep;
|
|
447
|
-
}
|
|
448
|
-
dep.w &= ~trackOpBit;
|
|
449
|
-
dep.n &= ~trackOpBit;
|
|
450
|
-
}
|
|
451
|
-
deps.length = ptr;
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
|
-
|
|
455
|
-
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
456
|
-
let effectTrackDepth = 0;
|
|
457
|
-
let trackOpBit = 1;
|
|
458
|
-
const maxMarkerBits = 30;
|
|
459
422
|
let activeEffect;
|
|
460
|
-
const ITERATE_KEY = Symbol("");
|
|
461
|
-
const MAP_KEY_ITERATE_KEY = Symbol("");
|
|
462
423
|
class ReactiveEffect {
|
|
463
|
-
constructor(fn, scheduler
|
|
424
|
+
constructor(fn, trigger, scheduler, scope) {
|
|
464
425
|
this.fn = fn;
|
|
426
|
+
this.trigger = trigger;
|
|
465
427
|
this.scheduler = scheduler;
|
|
466
428
|
this.active = true;
|
|
467
429
|
this.deps = [];
|
|
468
|
-
|
|
430
|
+
/**
|
|
431
|
+
* @internal
|
|
432
|
+
*/
|
|
433
|
+
this._dirtyLevel = 3;
|
|
434
|
+
/**
|
|
435
|
+
* @internal
|
|
436
|
+
*/
|
|
437
|
+
this._trackId = 0;
|
|
438
|
+
/**
|
|
439
|
+
* @internal
|
|
440
|
+
*/
|
|
441
|
+
this._runnings = 0;
|
|
442
|
+
/**
|
|
443
|
+
* @internal
|
|
444
|
+
*/
|
|
445
|
+
this._queryings = 0;
|
|
446
|
+
/**
|
|
447
|
+
* @internal
|
|
448
|
+
*/
|
|
449
|
+
this._depsLength = 0;
|
|
469
450
|
recordEffectScope(this, scope);
|
|
470
451
|
}
|
|
452
|
+
get dirty() {
|
|
453
|
+
if (this._dirtyLevel === 1) {
|
|
454
|
+
this._dirtyLevel = 0;
|
|
455
|
+
this._queryings++;
|
|
456
|
+
pauseTracking();
|
|
457
|
+
for (const dep of this.deps) {
|
|
458
|
+
if (dep.computed) {
|
|
459
|
+
triggerComputed(dep.computed);
|
|
460
|
+
if (this._dirtyLevel >= 2) {
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
resetTracking();
|
|
466
|
+
this._queryings--;
|
|
467
|
+
}
|
|
468
|
+
return this._dirtyLevel >= 2;
|
|
469
|
+
}
|
|
470
|
+
set dirty(v) {
|
|
471
|
+
this._dirtyLevel = v ? 3 : 0;
|
|
472
|
+
}
|
|
471
473
|
run() {
|
|
474
|
+
this._dirtyLevel = 0;
|
|
472
475
|
if (!this.active) {
|
|
473
476
|
return this.fn();
|
|
474
477
|
}
|
|
475
|
-
let parent = activeEffect;
|
|
476
478
|
let lastShouldTrack = shouldTrack;
|
|
477
|
-
|
|
478
|
-
if (parent === this) {
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
481
|
-
parent = parent.parent;
|
|
482
|
-
}
|
|
479
|
+
let lastEffect = activeEffect;
|
|
483
480
|
try {
|
|
484
|
-
this.parent = activeEffect;
|
|
485
|
-
activeEffect = this;
|
|
486
481
|
shouldTrack = true;
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
} else {
|
|
491
|
-
cleanupEffect(this);
|
|
492
|
-
}
|
|
482
|
+
activeEffect = this;
|
|
483
|
+
this._runnings++;
|
|
484
|
+
preCleanupEffect(this);
|
|
493
485
|
return this.fn();
|
|
494
486
|
} finally {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
trackOpBit = 1 << --effectTrackDepth;
|
|
499
|
-
activeEffect = this.parent;
|
|
487
|
+
postCleanupEffect(this);
|
|
488
|
+
this._runnings--;
|
|
489
|
+
activeEffect = lastEffect;
|
|
500
490
|
shouldTrack = lastShouldTrack;
|
|
501
|
-
this.parent = void 0;
|
|
502
|
-
if (this.deferStop) {
|
|
503
|
-
this.stop();
|
|
504
|
-
}
|
|
505
491
|
}
|
|
506
492
|
}
|
|
507
493
|
stop() {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
this.onStop();
|
|
514
|
-
}
|
|
494
|
+
var _a;
|
|
495
|
+
if (this.active) {
|
|
496
|
+
preCleanupEffect(this);
|
|
497
|
+
postCleanupEffect(this);
|
|
498
|
+
(_a = this.onStop) == null ? void 0 : _a.call(this);
|
|
515
499
|
this.active = false;
|
|
516
500
|
}
|
|
517
501
|
}
|
|
518
502
|
}
|
|
519
|
-
function
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
503
|
+
function triggerComputed(computed) {
|
|
504
|
+
return computed.value;
|
|
505
|
+
}
|
|
506
|
+
function preCleanupEffect(effect2) {
|
|
507
|
+
effect2._trackId++;
|
|
508
|
+
effect2._depsLength = 0;
|
|
509
|
+
}
|
|
510
|
+
function postCleanupEffect(effect2) {
|
|
511
|
+
if (effect2.deps && effect2.deps.length > effect2._depsLength) {
|
|
512
|
+
for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
|
|
513
|
+
cleanupDepEffect(effect2.deps[i], effect2);
|
|
514
|
+
}
|
|
515
|
+
effect2.deps.length = effect2._depsLength;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
function cleanupDepEffect(dep, effect2) {
|
|
519
|
+
const trackId = dep.get(effect2);
|
|
520
|
+
if (trackId !== void 0 && effect2._trackId !== trackId) {
|
|
521
|
+
dep.delete(effect2);
|
|
522
|
+
if (dep.size === 0) {
|
|
523
|
+
dep.cleanup();
|
|
524
524
|
}
|
|
525
|
-
deps.length = 0;
|
|
526
525
|
}
|
|
527
526
|
}
|
|
528
527
|
function effect(fn, options) {
|
|
529
528
|
if (fn.effect instanceof ReactiveEffect) {
|
|
530
529
|
fn = fn.effect.fn;
|
|
531
530
|
}
|
|
532
|
-
const _effect = new ReactiveEffect(fn)
|
|
531
|
+
const _effect = new ReactiveEffect(fn, NOOP, () => {
|
|
532
|
+
if (_effect.dirty) {
|
|
533
|
+
_effect.run();
|
|
534
|
+
}
|
|
535
|
+
});
|
|
533
536
|
if (options) {
|
|
534
537
|
extend(_effect, options);
|
|
535
538
|
if (options.scope)
|
|
@@ -546,6 +549,7 @@ function stop(runner) {
|
|
|
546
549
|
runner.effect.stop();
|
|
547
550
|
}
|
|
548
551
|
let shouldTrack = true;
|
|
552
|
+
let pauseScheduleStack = 0;
|
|
549
553
|
const trackStack = [];
|
|
550
554
|
function pauseTracking() {
|
|
551
555
|
trackStack.push(shouldTrack);
|
|
@@ -555,6 +559,60 @@ function resetTracking() {
|
|
|
555
559
|
const last = trackStack.pop();
|
|
556
560
|
shouldTrack = last === void 0 ? true : last;
|
|
557
561
|
}
|
|
562
|
+
function pauseScheduling() {
|
|
563
|
+
pauseScheduleStack++;
|
|
564
|
+
}
|
|
565
|
+
function resetScheduling() {
|
|
566
|
+
pauseScheduleStack--;
|
|
567
|
+
while (!pauseScheduleStack && queueEffectSchedulers.length) {
|
|
568
|
+
queueEffectSchedulers.shift()();
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
function trackEffect(effect2, dep, debuggerEventExtraInfo) {
|
|
572
|
+
if (dep.get(effect2) !== effect2._trackId) {
|
|
573
|
+
dep.set(effect2, effect2._trackId);
|
|
574
|
+
const oldDep = effect2.deps[effect2._depsLength];
|
|
575
|
+
if (oldDep !== dep) {
|
|
576
|
+
if (oldDep) {
|
|
577
|
+
cleanupDepEffect(oldDep, effect2);
|
|
578
|
+
}
|
|
579
|
+
effect2.deps[effect2._depsLength++] = dep;
|
|
580
|
+
} else {
|
|
581
|
+
effect2._depsLength++;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
const queueEffectSchedulers = [];
|
|
586
|
+
function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
|
|
587
|
+
pauseScheduling();
|
|
588
|
+
for (const effect2 of dep.keys()) {
|
|
589
|
+
if (!effect2.allowRecurse && effect2._runnings) {
|
|
590
|
+
continue;
|
|
591
|
+
}
|
|
592
|
+
if (effect2._dirtyLevel < dirtyLevel && (!effect2._runnings || dirtyLevel !== 2)) {
|
|
593
|
+
const lastDirtyLevel = effect2._dirtyLevel;
|
|
594
|
+
effect2._dirtyLevel = dirtyLevel;
|
|
595
|
+
if (lastDirtyLevel === 0 && (!effect2._queryings || dirtyLevel !== 2)) {
|
|
596
|
+
effect2.trigger();
|
|
597
|
+
if (effect2.scheduler) {
|
|
598
|
+
queueEffectSchedulers.push(effect2.scheduler);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
resetScheduling();
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
const createDep = (cleanup, computed) => {
|
|
607
|
+
const dep = /* @__PURE__ */ new Map();
|
|
608
|
+
dep.cleanup = cleanup;
|
|
609
|
+
dep.computed = computed;
|
|
610
|
+
return dep;
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
614
|
+
const ITERATE_KEY = Symbol("");
|
|
615
|
+
const MAP_KEY_ITERATE_KEY = Symbol("");
|
|
558
616
|
function track(target, type, key) {
|
|
559
617
|
if (shouldTrack && activeEffect) {
|
|
560
618
|
let depsMap = targetMap.get(target);
|
|
@@ -563,24 +621,11 @@ function track(target, type, key) {
|
|
|
563
621
|
}
|
|
564
622
|
let dep = depsMap.get(key);
|
|
565
623
|
if (!dep) {
|
|
566
|
-
depsMap.set(key, dep = createDep());
|
|
624
|
+
depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
|
|
567
625
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
function trackEffects(dep, debuggerEventExtraInfo) {
|
|
572
|
-
let shouldTrack2 = false;
|
|
573
|
-
if (effectTrackDepth <= maxMarkerBits) {
|
|
574
|
-
if (!newTracked(dep)) {
|
|
575
|
-
dep.n |= trackOpBit;
|
|
576
|
-
shouldTrack2 = !wasTracked(dep);
|
|
577
|
-
}
|
|
578
|
-
} else {
|
|
579
|
-
shouldTrack2 = !dep.has(activeEffect);
|
|
580
|
-
}
|
|
581
|
-
if (shouldTrack2) {
|
|
582
|
-
dep.add(activeEffect);
|
|
583
|
-
activeEffect.deps.push(dep);
|
|
626
|
+
trackEffect(
|
|
627
|
+
activeEffect,
|
|
628
|
+
dep);
|
|
584
629
|
}
|
|
585
630
|
}
|
|
586
631
|
function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
@@ -628,45 +673,15 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
628
673
|
break;
|
|
629
674
|
}
|
|
630
675
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
} else {
|
|
638
|
-
const effects = [];
|
|
639
|
-
for (const dep of deps) {
|
|
640
|
-
if (dep) {
|
|
641
|
-
effects.push(...dep);
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
{
|
|
645
|
-
triggerEffects(createDep(effects));
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
function triggerEffects(dep, debuggerEventExtraInfo) {
|
|
650
|
-
const effects = isArray(dep) ? dep : [...dep];
|
|
651
|
-
for (const effect2 of effects) {
|
|
652
|
-
if (effect2.computed) {
|
|
653
|
-
triggerEffect(effect2);
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
for (const effect2 of effects) {
|
|
657
|
-
if (!effect2.computed) {
|
|
658
|
-
triggerEffect(effect2);
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
function triggerEffect(effect2, debuggerEventExtraInfo) {
|
|
663
|
-
if (effect2 !== activeEffect || effect2.allowRecurse) {
|
|
664
|
-
if (effect2.scheduler) {
|
|
665
|
-
effect2.scheduler();
|
|
666
|
-
} else {
|
|
667
|
-
effect2.run();
|
|
676
|
+
pauseScheduling();
|
|
677
|
+
for (const dep of deps) {
|
|
678
|
+
if (dep) {
|
|
679
|
+
triggerEffects(
|
|
680
|
+
dep,
|
|
681
|
+
3);
|
|
668
682
|
}
|
|
669
683
|
}
|
|
684
|
+
resetScheduling();
|
|
670
685
|
}
|
|
671
686
|
function getDepFromReactive(object, key) {
|
|
672
687
|
var _a;
|
|
@@ -697,7 +712,9 @@ function createArrayInstrumentations() {
|
|
|
697
712
|
["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
|
|
698
713
|
instrumentations[key] = function(...args) {
|
|
699
714
|
pauseTracking();
|
|
715
|
+
pauseScheduling();
|
|
700
716
|
const res = toRaw(this)[key].apply(this, args);
|
|
717
|
+
resetScheduling();
|
|
701
718
|
resetTracking();
|
|
702
719
|
return res;
|
|
703
720
|
};
|
|
@@ -1200,21 +1217,74 @@ function markRaw(value) {
|
|
|
1200
1217
|
const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
1201
1218
|
const toReadonly = (value) => isObject(value) ? readonly(value) : value;
|
|
1202
1219
|
|
|
1220
|
+
class ComputedRefImpl {
|
|
1221
|
+
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1222
|
+
this._setter = _setter;
|
|
1223
|
+
this.dep = void 0;
|
|
1224
|
+
this.__v_isRef = true;
|
|
1225
|
+
this["__v_isReadonly"] = false;
|
|
1226
|
+
this.effect = new ReactiveEffect(getter, () => {
|
|
1227
|
+
triggerRefValue(this, 1);
|
|
1228
|
+
});
|
|
1229
|
+
this.effect.computed = this;
|
|
1230
|
+
this.effect.active = this._cacheable = !isSSR;
|
|
1231
|
+
this["__v_isReadonly"] = isReadonly;
|
|
1232
|
+
}
|
|
1233
|
+
get value() {
|
|
1234
|
+
const self = toRaw(this);
|
|
1235
|
+
trackRefValue(self);
|
|
1236
|
+
if (!self._cacheable || self.effect.dirty) {
|
|
1237
|
+
if (hasChanged(self._value, self._value = self.effect.run())) {
|
|
1238
|
+
triggerRefValue(self, 2);
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
return self._value;
|
|
1242
|
+
}
|
|
1243
|
+
set value(newValue) {
|
|
1244
|
+
this._setter(newValue);
|
|
1245
|
+
}
|
|
1246
|
+
// #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
|
|
1247
|
+
get _dirty() {
|
|
1248
|
+
return this.effect.dirty;
|
|
1249
|
+
}
|
|
1250
|
+
set _dirty(v) {
|
|
1251
|
+
this.effect.dirty = v;
|
|
1252
|
+
}
|
|
1253
|
+
// #endregion
|
|
1254
|
+
}
|
|
1255
|
+
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1256
|
+
let getter;
|
|
1257
|
+
let setter;
|
|
1258
|
+
const onlyGetter = isFunction(getterOrOptions);
|
|
1259
|
+
if (onlyGetter) {
|
|
1260
|
+
getter = getterOrOptions;
|
|
1261
|
+
setter = NOOP;
|
|
1262
|
+
} else {
|
|
1263
|
+
getter = getterOrOptions.get;
|
|
1264
|
+
setter = getterOrOptions.set;
|
|
1265
|
+
}
|
|
1266
|
+
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
1267
|
+
return cRef;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1203
1270
|
function trackRefValue(ref2) {
|
|
1204
1271
|
if (shouldTrack && activeEffect) {
|
|
1205
1272
|
ref2 = toRaw(ref2);
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1273
|
+
trackEffect(
|
|
1274
|
+
activeEffect,
|
|
1275
|
+
ref2.dep || (ref2.dep = createDep(
|
|
1276
|
+
() => ref2.dep = void 0,
|
|
1277
|
+
ref2 instanceof ComputedRefImpl ? ref2 : void 0
|
|
1278
|
+
)));
|
|
1209
1279
|
}
|
|
1210
1280
|
}
|
|
1211
|
-
function triggerRefValue(ref2, newVal) {
|
|
1281
|
+
function triggerRefValue(ref2, dirtyLevel = 3, newVal) {
|
|
1212
1282
|
ref2 = toRaw(ref2);
|
|
1213
1283
|
const dep = ref2.dep;
|
|
1214
1284
|
if (dep) {
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1285
|
+
triggerEffects(
|
|
1286
|
+
dep,
|
|
1287
|
+
dirtyLevel);
|
|
1218
1288
|
}
|
|
1219
1289
|
}
|
|
1220
1290
|
function isRef(r) {
|
|
@@ -1250,12 +1320,12 @@ class RefImpl {
|
|
|
1250
1320
|
if (hasChanged(newVal, this._rawValue)) {
|
|
1251
1321
|
this._rawValue = newVal;
|
|
1252
1322
|
this._value = useDirectValue ? newVal : toReactive(newVal);
|
|
1253
|
-
triggerRefValue(this);
|
|
1323
|
+
triggerRefValue(this, 3);
|
|
1254
1324
|
}
|
|
1255
1325
|
}
|
|
1256
1326
|
}
|
|
1257
1327
|
function triggerRef(ref2) {
|
|
1258
|
-
triggerRefValue(ref2);
|
|
1328
|
+
triggerRefValue(ref2, 3);
|
|
1259
1329
|
}
|
|
1260
1330
|
function unref(ref2) {
|
|
1261
1331
|
return isRef(ref2) ? ref2.value : ref2;
|
|
@@ -1350,51 +1420,6 @@ function propertyToRef(source, key, defaultValue) {
|
|
|
1350
1420
|
return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
|
|
1351
1421
|
}
|
|
1352
1422
|
|
|
1353
|
-
class ComputedRefImpl {
|
|
1354
|
-
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1355
|
-
this._setter = _setter;
|
|
1356
|
-
this.dep = void 0;
|
|
1357
|
-
this.__v_isRef = true;
|
|
1358
|
-
this["__v_isReadonly"] = false;
|
|
1359
|
-
this._dirty = true;
|
|
1360
|
-
this.effect = new ReactiveEffect(getter, () => {
|
|
1361
|
-
if (!this._dirty) {
|
|
1362
|
-
this._dirty = true;
|
|
1363
|
-
triggerRefValue(this);
|
|
1364
|
-
}
|
|
1365
|
-
});
|
|
1366
|
-
this.effect.computed = this;
|
|
1367
|
-
this.effect.active = this._cacheable = !isSSR;
|
|
1368
|
-
this["__v_isReadonly"] = isReadonly;
|
|
1369
|
-
}
|
|
1370
|
-
get value() {
|
|
1371
|
-
const self = toRaw(this);
|
|
1372
|
-
trackRefValue(self);
|
|
1373
|
-
if (self._dirty || !self._cacheable) {
|
|
1374
|
-
self._dirty = false;
|
|
1375
|
-
self._value = self.effect.run();
|
|
1376
|
-
}
|
|
1377
|
-
return self._value;
|
|
1378
|
-
}
|
|
1379
|
-
set value(newValue) {
|
|
1380
|
-
this._setter(newValue);
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1383
|
-
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1384
|
-
let getter;
|
|
1385
|
-
let setter;
|
|
1386
|
-
const onlyGetter = isFunction(getterOrOptions);
|
|
1387
|
-
if (onlyGetter) {
|
|
1388
|
-
getter = getterOrOptions;
|
|
1389
|
-
setter = NOOP;
|
|
1390
|
-
} else {
|
|
1391
|
-
getter = getterOrOptions.get;
|
|
1392
|
-
setter = getterOrOptions.set;
|
|
1393
|
-
}
|
|
1394
|
-
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
1395
|
-
return cRef;
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
1423
|
function warn$1(msg, ...args) {
|
|
1399
1424
|
return;
|
|
1400
1425
|
}
|
|
@@ -2747,8 +2772,15 @@ const INITIAL_WATCHER_VALUE = {};
|
|
|
2747
2772
|
function watch(source, cb, options) {
|
|
2748
2773
|
return doWatch(source, cb, options);
|
|
2749
2774
|
}
|
|
2750
|
-
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
2775
|
+
function doWatch(source, cb, { immediate, deep, flush, once, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
2751
2776
|
var _a;
|
|
2777
|
+
if (cb && once) {
|
|
2778
|
+
const _cb = cb;
|
|
2779
|
+
cb = (...args) => {
|
|
2780
|
+
_cb(...args);
|
|
2781
|
+
unwatch();
|
|
2782
|
+
};
|
|
2783
|
+
}
|
|
2752
2784
|
const instance = getCurrentScope() === ((_a = currentInstance) == null ? void 0 : _a.scope) ? currentInstance : null;
|
|
2753
2785
|
let getter;
|
|
2754
2786
|
let forceTrigger = false;
|
|
@@ -2834,7 +2866,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
2834
2866
|
}
|
|
2835
2867
|
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
|
|
2836
2868
|
const job = () => {
|
|
2837
|
-
if (!effect.active) {
|
|
2869
|
+
if (!effect.active || !effect.dirty) {
|
|
2838
2870
|
return;
|
|
2839
2871
|
}
|
|
2840
2872
|
if (cb) {
|
|
@@ -2867,7 +2899,13 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
2867
2899
|
job.id = instance.uid;
|
|
2868
2900
|
scheduler = () => queueJob(job);
|
|
2869
2901
|
}
|
|
2870
|
-
const effect = new ReactiveEffect(getter, scheduler);
|
|
2902
|
+
const effect = new ReactiveEffect(getter, NOOP, scheduler);
|
|
2903
|
+
const unwatch = () => {
|
|
2904
|
+
effect.stop();
|
|
2905
|
+
if (instance && instance.scope) {
|
|
2906
|
+
remove(instance.scope.effects, effect);
|
|
2907
|
+
}
|
|
2908
|
+
};
|
|
2871
2909
|
if (cb) {
|
|
2872
2910
|
if (immediate) {
|
|
2873
2911
|
job();
|
|
@@ -2882,12 +2920,6 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
2882
2920
|
} else {
|
|
2883
2921
|
effect.run();
|
|
2884
2922
|
}
|
|
2885
|
-
const unwatch = () => {
|
|
2886
|
-
effect.stop();
|
|
2887
|
-
if (instance && instance.scope) {
|
|
2888
|
-
remove(instance.scope.effects, effect);
|
|
2889
|
-
}
|
|
2890
|
-
};
|
|
2891
2923
|
if (ssrCleanup)
|
|
2892
2924
|
ssrCleanup.push(unwatch);
|
|
2893
2925
|
return unwatch;
|
|
@@ -3106,6 +3138,7 @@ const BaseTransitionImpl = {
|
|
|
3106
3138
|
leavingHooks.afterLeave = () => {
|
|
3107
3139
|
state.isLeaving = false;
|
|
3108
3140
|
if (instance.update.active !== false) {
|
|
3141
|
+
instance.effect.dirty = true;
|
|
3109
3142
|
instance.update();
|
|
3110
3143
|
}
|
|
3111
3144
|
};
|
|
@@ -3436,6 +3469,7 @@ function defineAsyncComponent(source) {
|
|
|
3436
3469
|
load().then(() => {
|
|
3437
3470
|
loaded.value = true;
|
|
3438
3471
|
if (instance.parent && isKeepAlive(instance.parent.vnode)) {
|
|
3472
|
+
instance.parent.effect.dirty = true;
|
|
3439
3473
|
queueJob(instance.parent.update);
|
|
3440
3474
|
}
|
|
3441
3475
|
}).catch((err) => {
|
|
@@ -4422,7 +4456,10 @@ const publicPropertiesMap = (
|
|
|
4422
4456
|
$root: (i) => getPublicInstance(i.root),
|
|
4423
4457
|
$emit: (i) => i.emit,
|
|
4424
4458
|
$options: (i) => resolveMergedOptions(i) ,
|
|
4425
|
-
$forceUpdate: (i) => i.f || (i.f = () =>
|
|
4459
|
+
$forceUpdate: (i) => i.f || (i.f = () => {
|
|
4460
|
+
i.effect.dirty = true;
|
|
4461
|
+
queueJob(i.update);
|
|
4462
|
+
}),
|
|
4426
4463
|
$nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
|
|
4427
4464
|
$watch: (i) => instanceWatch.bind(i)
|
|
4428
4465
|
})
|
|
@@ -5072,7 +5109,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
5072
5109
|
return vm;
|
|
5073
5110
|
}
|
|
5074
5111
|
}
|
|
5075
|
-
Vue.version = `2.6.14-compat:${"3.
|
|
5112
|
+
Vue.version = `2.6.14-compat:${"3.4.0-alpha.1"}`;
|
|
5076
5113
|
Vue.config = singletonApp.config;
|
|
5077
5114
|
Vue.use = (p, ...options) => {
|
|
5078
5115
|
if (p && isFunction(p.install)) {
|
|
@@ -7068,6 +7105,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7068
7105
|
} else {
|
|
7069
7106
|
instance.next = n2;
|
|
7070
7107
|
invalidateJob(instance.update);
|
|
7108
|
+
instance.effect.dirty = true;
|
|
7071
7109
|
instance.update();
|
|
7072
7110
|
}
|
|
7073
7111
|
} else {
|
|
@@ -7213,11 +7251,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7213
7251
|
};
|
|
7214
7252
|
const effect = instance.effect = new ReactiveEffect(
|
|
7215
7253
|
componentUpdateFn,
|
|
7254
|
+
NOOP,
|
|
7216
7255
|
() => queueJob(update),
|
|
7217
7256
|
instance.scope
|
|
7218
7257
|
// track it in component's effect scope
|
|
7219
7258
|
);
|
|
7220
|
-
const update = instance.update = () =>
|
|
7259
|
+
const update = instance.update = () => {
|
|
7260
|
+
if (effect.dirty) {
|
|
7261
|
+
effect.run();
|
|
7262
|
+
}
|
|
7263
|
+
};
|
|
7221
7264
|
update.id = instance.uid;
|
|
7222
7265
|
toggleRecurse(instance, true);
|
|
7223
7266
|
update();
|
|
@@ -8800,7 +8843,8 @@ function isMemoSame(cached, memo) {
|
|
|
8800
8843
|
return true;
|
|
8801
8844
|
}
|
|
8802
8845
|
|
|
8803
|
-
const version = "3.
|
|
8846
|
+
const version = "3.4.0-alpha.1";
|
|
8847
|
+
const ErrorTypeStrings = null;
|
|
8804
8848
|
const _ssrUtils = {
|
|
8805
8849
|
createComponentInstance,
|
|
8806
8850
|
setupComponent,
|
|
@@ -10317,6 +10361,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
10317
10361
|
BaseTransitionPropsValidators: BaseTransitionPropsValidators,
|
|
10318
10362
|
Comment: Comment,
|
|
10319
10363
|
EffectScope: EffectScope,
|
|
10364
|
+
ErrorTypeStrings: ErrorTypeStrings,
|
|
10320
10365
|
Fragment: Fragment,
|
|
10321
10366
|
KeepAlive: KeepAlive,
|
|
10322
10367
|
ReactiveEffect: ReactiveEffect,
|