@vue/compat 3.3.6 → 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 +377 -254
- package/dist/vue.cjs.prod.js +331 -227
- package/dist/vue.esm-browser.js +378 -255
- package/dist/vue.esm-browser.prod.js +4 -4
- package/dist/vue.esm-bundler.js +379 -264
- package/dist/vue.global.js +377 -254
- package/dist/vue.global.prod.js +5 -5
- package/dist/vue.runtime.esm-browser.js +360 -248
- package/dist/vue.runtime.esm-browser.prod.js +5 -5
- package/dist/vue.runtime.esm-bundler.js +361 -257
- package/dist/vue.runtime.global.js +359 -247
- package/dist/vue.runtime.global.prod.js +5 -5
- package/package.json +2 -2
package/dist/vue.esm-browser.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("iterate" );
|
|
461
|
-
const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate" );
|
|
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,68 @@ 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
|
+
var _a;
|
|
573
|
+
if (dep.get(effect2) !== effect2._trackId) {
|
|
574
|
+
dep.set(effect2, effect2._trackId);
|
|
575
|
+
const oldDep = effect2.deps[effect2._depsLength];
|
|
576
|
+
if (oldDep !== dep) {
|
|
577
|
+
if (oldDep) {
|
|
578
|
+
cleanupDepEffect(oldDep, effect2);
|
|
579
|
+
}
|
|
580
|
+
effect2.deps[effect2._depsLength++] = dep;
|
|
581
|
+
} else {
|
|
582
|
+
effect2._depsLength++;
|
|
583
|
+
}
|
|
584
|
+
{
|
|
585
|
+
(_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
const queueEffectSchedulers = [];
|
|
590
|
+
function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
|
|
591
|
+
var _a;
|
|
592
|
+
pauseScheduling();
|
|
593
|
+
for (const effect2 of dep.keys()) {
|
|
594
|
+
if (!effect2.allowRecurse && effect2._runnings) {
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
if (effect2._dirtyLevel < dirtyLevel && (!effect2._runnings || dirtyLevel !== 2)) {
|
|
598
|
+
const lastDirtyLevel = effect2._dirtyLevel;
|
|
599
|
+
effect2._dirtyLevel = dirtyLevel;
|
|
600
|
+
if (lastDirtyLevel === 0 && (!effect2._queryings || dirtyLevel !== 2)) {
|
|
601
|
+
{
|
|
602
|
+
(_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
603
|
+
}
|
|
604
|
+
effect2.trigger();
|
|
605
|
+
if (effect2.scheduler) {
|
|
606
|
+
queueEffectSchedulers.push(effect2.scheduler);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
resetScheduling();
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
const createDep = (cleanup, computed) => {
|
|
615
|
+
const dep = /* @__PURE__ */ new Map();
|
|
616
|
+
dep.cleanup = cleanup;
|
|
617
|
+
dep.computed = computed;
|
|
618
|
+
return dep;
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
622
|
+
const ITERATE_KEY = Symbol("iterate" );
|
|
623
|
+
const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate" );
|
|
558
624
|
function track(target, type, key) {
|
|
559
625
|
if (shouldTrack && activeEffect) {
|
|
560
626
|
let depsMap = targetMap.get(target);
|
|
@@ -563,35 +629,17 @@ function track(target, type, key) {
|
|
|
563
629
|
}
|
|
564
630
|
let dep = depsMap.get(key);
|
|
565
631
|
if (!dep) {
|
|
566
|
-
depsMap.set(key, dep = createDep());
|
|
567
|
-
}
|
|
568
|
-
const eventInfo = { effect: activeEffect, target, type, key } ;
|
|
569
|
-
trackEffects(dep, eventInfo);
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
function trackEffects(dep, debuggerEventExtraInfo) {
|
|
573
|
-
let shouldTrack2 = false;
|
|
574
|
-
if (effectTrackDepth <= maxMarkerBits) {
|
|
575
|
-
if (!newTracked(dep)) {
|
|
576
|
-
dep.n |= trackOpBit;
|
|
577
|
-
shouldTrack2 = !wasTracked(dep);
|
|
578
|
-
}
|
|
579
|
-
} else {
|
|
580
|
-
shouldTrack2 = !dep.has(activeEffect);
|
|
581
|
-
}
|
|
582
|
-
if (shouldTrack2) {
|
|
583
|
-
dep.add(activeEffect);
|
|
584
|
-
activeEffect.deps.push(dep);
|
|
585
|
-
if (activeEffect.onTrack) {
|
|
586
|
-
activeEffect.onTrack(
|
|
587
|
-
extend(
|
|
588
|
-
{
|
|
589
|
-
effect: activeEffect
|
|
590
|
-
},
|
|
591
|
-
debuggerEventExtraInfo
|
|
592
|
-
)
|
|
593
|
-
);
|
|
632
|
+
depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
|
|
594
633
|
}
|
|
634
|
+
trackEffect(
|
|
635
|
+
activeEffect,
|
|
636
|
+
dep,
|
|
637
|
+
{
|
|
638
|
+
target,
|
|
639
|
+
type,
|
|
640
|
+
key
|
|
641
|
+
}
|
|
642
|
+
);
|
|
595
643
|
}
|
|
596
644
|
}
|
|
597
645
|
function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
@@ -605,7 +653,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
605
653
|
} else if (key === "length" && isArray(target)) {
|
|
606
654
|
const newLength = Number(newValue);
|
|
607
655
|
depsMap.forEach((dep, key2) => {
|
|
608
|
-
if (key2 === "length" || key2 >= newLength) {
|
|
656
|
+
if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
|
|
609
657
|
deps.push(dep);
|
|
610
658
|
}
|
|
611
659
|
});
|
|
@@ -639,49 +687,24 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
639
687
|
break;
|
|
640
688
|
}
|
|
641
689
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
if (
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
triggerEffects(createDep(effects), eventInfo);
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
function triggerEffects(dep, debuggerEventExtraInfo) {
|
|
662
|
-
const effects = isArray(dep) ? dep : [...dep];
|
|
663
|
-
for (const effect2 of effects) {
|
|
664
|
-
if (effect2.computed) {
|
|
665
|
-
triggerEffect(effect2, debuggerEventExtraInfo);
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
for (const effect2 of effects) {
|
|
669
|
-
if (!effect2.computed) {
|
|
670
|
-
triggerEffect(effect2, debuggerEventExtraInfo);
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
function triggerEffect(effect2, debuggerEventExtraInfo) {
|
|
675
|
-
if (effect2 !== activeEffect || effect2.allowRecurse) {
|
|
676
|
-
if (effect2.onTrigger) {
|
|
677
|
-
effect2.onTrigger(extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
678
|
-
}
|
|
679
|
-
if (effect2.scheduler) {
|
|
680
|
-
effect2.scheduler();
|
|
681
|
-
} else {
|
|
682
|
-
effect2.run();
|
|
690
|
+
pauseScheduling();
|
|
691
|
+
for (const dep of deps) {
|
|
692
|
+
if (dep) {
|
|
693
|
+
triggerEffects(
|
|
694
|
+
dep,
|
|
695
|
+
3,
|
|
696
|
+
{
|
|
697
|
+
target,
|
|
698
|
+
type,
|
|
699
|
+
key,
|
|
700
|
+
newValue,
|
|
701
|
+
oldValue,
|
|
702
|
+
oldTarget
|
|
703
|
+
}
|
|
704
|
+
);
|
|
683
705
|
}
|
|
684
706
|
}
|
|
707
|
+
resetScheduling();
|
|
685
708
|
}
|
|
686
709
|
function getDepFromReactive(object, key) {
|
|
687
710
|
var _a;
|
|
@@ -712,7 +735,9 @@ function createArrayInstrumentations() {
|
|
|
712
735
|
["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
|
|
713
736
|
instrumentations[key] = function(...args) {
|
|
714
737
|
pauseTracking();
|
|
738
|
+
pauseScheduling();
|
|
715
739
|
const res = toRaw(this)[key].apply(this, args);
|
|
740
|
+
resetScheduling();
|
|
716
741
|
resetTracking();
|
|
717
742
|
return res;
|
|
718
743
|
};
|
|
@@ -1251,30 +1276,93 @@ function markRaw(value) {
|
|
|
1251
1276
|
const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
1252
1277
|
const toReadonly = (value) => isObject(value) ? readonly(value) : value;
|
|
1253
1278
|
|
|
1279
|
+
class ComputedRefImpl {
|
|
1280
|
+
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1281
|
+
this._setter = _setter;
|
|
1282
|
+
this.dep = void 0;
|
|
1283
|
+
this.__v_isRef = true;
|
|
1284
|
+
this["__v_isReadonly"] = false;
|
|
1285
|
+
this.effect = new ReactiveEffect(getter, () => {
|
|
1286
|
+
triggerRefValue(this, 1);
|
|
1287
|
+
});
|
|
1288
|
+
this.effect.computed = this;
|
|
1289
|
+
this.effect.active = this._cacheable = !isSSR;
|
|
1290
|
+
this["__v_isReadonly"] = isReadonly;
|
|
1291
|
+
}
|
|
1292
|
+
get value() {
|
|
1293
|
+
const self = toRaw(this);
|
|
1294
|
+
trackRefValue(self);
|
|
1295
|
+
if (!self._cacheable || self.effect.dirty) {
|
|
1296
|
+
if (hasChanged(self._value, self._value = self.effect.run())) {
|
|
1297
|
+
triggerRefValue(self, 2);
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
return self._value;
|
|
1301
|
+
}
|
|
1302
|
+
set value(newValue) {
|
|
1303
|
+
this._setter(newValue);
|
|
1304
|
+
}
|
|
1305
|
+
// #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
|
|
1306
|
+
get _dirty() {
|
|
1307
|
+
return this.effect.dirty;
|
|
1308
|
+
}
|
|
1309
|
+
set _dirty(v) {
|
|
1310
|
+
this.effect.dirty = v;
|
|
1311
|
+
}
|
|
1312
|
+
// #endregion
|
|
1313
|
+
}
|
|
1314
|
+
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1315
|
+
let getter;
|
|
1316
|
+
let setter;
|
|
1317
|
+
const onlyGetter = isFunction(getterOrOptions);
|
|
1318
|
+
if (onlyGetter) {
|
|
1319
|
+
getter = getterOrOptions;
|
|
1320
|
+
setter = () => {
|
|
1321
|
+
console.warn("Write operation failed: computed value is readonly");
|
|
1322
|
+
} ;
|
|
1323
|
+
} else {
|
|
1324
|
+
getter = getterOrOptions.get;
|
|
1325
|
+
setter = getterOrOptions.set;
|
|
1326
|
+
}
|
|
1327
|
+
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
1328
|
+
if (debugOptions && !isSSR) {
|
|
1329
|
+
cRef.effect.onTrack = debugOptions.onTrack;
|
|
1330
|
+
cRef.effect.onTrigger = debugOptions.onTrigger;
|
|
1331
|
+
}
|
|
1332
|
+
return cRef;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1254
1335
|
function trackRefValue(ref2) {
|
|
1255
1336
|
if (shouldTrack && activeEffect) {
|
|
1256
1337
|
ref2 = toRaw(ref2);
|
|
1257
|
-
|
|
1258
|
-
|
|
1338
|
+
trackEffect(
|
|
1339
|
+
activeEffect,
|
|
1340
|
+
ref2.dep || (ref2.dep = createDep(
|
|
1341
|
+
() => ref2.dep = void 0,
|
|
1342
|
+
ref2 instanceof ComputedRefImpl ? ref2 : void 0
|
|
1343
|
+
)),
|
|
1344
|
+
{
|
|
1259
1345
|
target: ref2,
|
|
1260
1346
|
type: "get",
|
|
1261
1347
|
key: "value"
|
|
1262
|
-
}
|
|
1263
|
-
|
|
1348
|
+
}
|
|
1349
|
+
);
|
|
1264
1350
|
}
|
|
1265
1351
|
}
|
|
1266
|
-
function triggerRefValue(ref2, newVal) {
|
|
1352
|
+
function triggerRefValue(ref2, dirtyLevel = 3, newVal) {
|
|
1267
1353
|
ref2 = toRaw(ref2);
|
|
1268
1354
|
const dep = ref2.dep;
|
|
1269
1355
|
if (dep) {
|
|
1270
|
-
|
|
1271
|
-
|
|
1356
|
+
triggerEffects(
|
|
1357
|
+
dep,
|
|
1358
|
+
dirtyLevel,
|
|
1359
|
+
{
|
|
1272
1360
|
target: ref2,
|
|
1273
1361
|
type: "set",
|
|
1274
1362
|
key: "value",
|
|
1275
1363
|
newValue: newVal
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1364
|
+
}
|
|
1365
|
+
);
|
|
1278
1366
|
}
|
|
1279
1367
|
}
|
|
1280
1368
|
function isRef(r) {
|
|
@@ -1310,12 +1398,12 @@ class RefImpl {
|
|
|
1310
1398
|
if (hasChanged(newVal, this._rawValue)) {
|
|
1311
1399
|
this._rawValue = newVal;
|
|
1312
1400
|
this._value = useDirectValue ? newVal : toReactive(newVal);
|
|
1313
|
-
triggerRefValue(this, newVal);
|
|
1401
|
+
triggerRefValue(this, 3, newVal);
|
|
1314
1402
|
}
|
|
1315
1403
|
}
|
|
1316
1404
|
}
|
|
1317
1405
|
function triggerRef(ref2) {
|
|
1318
|
-
triggerRefValue(ref2, ref2.value );
|
|
1406
|
+
triggerRefValue(ref2, 3, ref2.value );
|
|
1319
1407
|
}
|
|
1320
1408
|
function unref(ref2) {
|
|
1321
1409
|
return isRef(ref2) ? ref2.value : ref2;
|
|
@@ -1413,57 +1501,6 @@ function propertyToRef(source, key, defaultValue) {
|
|
|
1413
1501
|
return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
|
|
1414
1502
|
}
|
|
1415
1503
|
|
|
1416
|
-
class ComputedRefImpl {
|
|
1417
|
-
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1418
|
-
this._setter = _setter;
|
|
1419
|
-
this.dep = void 0;
|
|
1420
|
-
this.__v_isRef = true;
|
|
1421
|
-
this["__v_isReadonly"] = false;
|
|
1422
|
-
this._dirty = true;
|
|
1423
|
-
this.effect = new ReactiveEffect(getter, () => {
|
|
1424
|
-
if (!this._dirty) {
|
|
1425
|
-
this._dirty = true;
|
|
1426
|
-
triggerRefValue(this);
|
|
1427
|
-
}
|
|
1428
|
-
});
|
|
1429
|
-
this.effect.computed = this;
|
|
1430
|
-
this.effect.active = this._cacheable = !isSSR;
|
|
1431
|
-
this["__v_isReadonly"] = isReadonly;
|
|
1432
|
-
}
|
|
1433
|
-
get value() {
|
|
1434
|
-
const self = toRaw(this);
|
|
1435
|
-
trackRefValue(self);
|
|
1436
|
-
if (self._dirty || !self._cacheable) {
|
|
1437
|
-
self._dirty = false;
|
|
1438
|
-
self._value = self.effect.run();
|
|
1439
|
-
}
|
|
1440
|
-
return self._value;
|
|
1441
|
-
}
|
|
1442
|
-
set value(newValue) {
|
|
1443
|
-
this._setter(newValue);
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1447
|
-
let getter;
|
|
1448
|
-
let setter;
|
|
1449
|
-
const onlyGetter = isFunction(getterOrOptions);
|
|
1450
|
-
if (onlyGetter) {
|
|
1451
|
-
getter = getterOrOptions;
|
|
1452
|
-
setter = () => {
|
|
1453
|
-
console.warn("Write operation failed: computed value is readonly");
|
|
1454
|
-
} ;
|
|
1455
|
-
} else {
|
|
1456
|
-
getter = getterOrOptions.get;
|
|
1457
|
-
setter = getterOrOptions.set;
|
|
1458
|
-
}
|
|
1459
|
-
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
1460
|
-
if (debugOptions && !isSSR) {
|
|
1461
|
-
cRef.effect.onTrack = debugOptions.onTrack;
|
|
1462
|
-
cRef.effect.onTrigger = debugOptions.onTrigger;
|
|
1463
|
-
}
|
|
1464
|
-
return cRef;
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
1504
|
const stack = [];
|
|
1468
1505
|
function pushWarningContext(vnode) {
|
|
1469
1506
|
stack.push(vnode);
|
|
@@ -1578,7 +1615,7 @@ function assertNumber(val, type) {
|
|
|
1578
1615
|
}
|
|
1579
1616
|
}
|
|
1580
1617
|
|
|
1581
|
-
const ErrorTypeStrings = {
|
|
1618
|
+
const ErrorTypeStrings$1 = {
|
|
1582
1619
|
["sp"]: "serverPrefetch hook",
|
|
1583
1620
|
["bc"]: "beforeCreate hook",
|
|
1584
1621
|
["c"]: "created hook",
|
|
@@ -1639,7 +1676,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
1639
1676
|
if (instance) {
|
|
1640
1677
|
let cur = instance.parent;
|
|
1641
1678
|
const exposedInstance = instance.proxy;
|
|
1642
|
-
const errorInfo = ErrorTypeStrings[type] ;
|
|
1679
|
+
const errorInfo = ErrorTypeStrings$1[type] ;
|
|
1643
1680
|
while (cur) {
|
|
1644
1681
|
const errorCapturedHooks = cur.ec;
|
|
1645
1682
|
if (errorCapturedHooks) {
|
|
@@ -1666,7 +1703,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
1666
1703
|
}
|
|
1667
1704
|
function logError(err, type, contextVNode, throwInDev = true) {
|
|
1668
1705
|
{
|
|
1669
|
-
const info = ErrorTypeStrings[type];
|
|
1706
|
+
const info = ErrorTypeStrings$1[type];
|
|
1670
1707
|
if (contextVNode) {
|
|
1671
1708
|
pushWarningContext(contextVNode);
|
|
1672
1709
|
}
|
|
@@ -1701,8 +1738,13 @@ function findInsertionIndex(id) {
|
|
|
1701
1738
|
let end = queue.length;
|
|
1702
1739
|
while (start < end) {
|
|
1703
1740
|
const middle = start + end >>> 1;
|
|
1704
|
-
const
|
|
1705
|
-
middleJobId
|
|
1741
|
+
const middleJob = queue[middle];
|
|
1742
|
+
const middleJobId = getId(middleJob);
|
|
1743
|
+
if (middleJobId < id || middleJobId === id && middleJob.pre) {
|
|
1744
|
+
start = middle + 1;
|
|
1745
|
+
} else {
|
|
1746
|
+
end = middle;
|
|
1747
|
+
}
|
|
1706
1748
|
}
|
|
1707
1749
|
return start;
|
|
1708
1750
|
}
|
|
@@ -1889,6 +1931,7 @@ function rerender(id, newRender) {
|
|
|
1889
1931
|
}
|
|
1890
1932
|
instance.renderCache = [];
|
|
1891
1933
|
isHmrUpdating = true;
|
|
1934
|
+
instance.effect.dirty = true;
|
|
1892
1935
|
instance.update();
|
|
1893
1936
|
isHmrUpdating = false;
|
|
1894
1937
|
});
|
|
@@ -1916,6 +1959,7 @@ function reload(id, newComp) {
|
|
|
1916
1959
|
instance.ceReload(newComp.styles);
|
|
1917
1960
|
hmrDirtyComponents.delete(oldComp);
|
|
1918
1961
|
} else if (instance.parent) {
|
|
1962
|
+
instance.parent.effect.dirty = true;
|
|
1919
1963
|
queueJob(instance.parent.update);
|
|
1920
1964
|
} else if (instance.appContext.reload) {
|
|
1921
1965
|
instance.appContext.reload();
|
|
@@ -3290,14 +3334,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
3290
3334
|
parentComponent: parentComponent2,
|
|
3291
3335
|
container: container2
|
|
3292
3336
|
} = suspense;
|
|
3337
|
+
let delayEnter = false;
|
|
3293
3338
|
if (suspense.isHydrating) {
|
|
3294
3339
|
suspense.isHydrating = false;
|
|
3295
3340
|
} else if (!resume) {
|
|
3296
|
-
|
|
3341
|
+
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
3297
3342
|
if (delayEnter) {
|
|
3298
3343
|
activeBranch.transition.afterLeave = () => {
|
|
3299
3344
|
if (pendingId === suspense.pendingId) {
|
|
3300
3345
|
move(pendingBranch, container2, anchor2, 0);
|
|
3346
|
+
queuePostFlushCb(effects);
|
|
3301
3347
|
}
|
|
3302
3348
|
};
|
|
3303
3349
|
}
|
|
@@ -3323,7 +3369,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
3323
3369
|
}
|
|
3324
3370
|
parent = parent.parent;
|
|
3325
3371
|
}
|
|
3326
|
-
if (!hasUnresolvedAncestor) {
|
|
3372
|
+
if (!hasUnresolvedAncestor && !delayEnter) {
|
|
3327
3373
|
queuePostFlushCb(effects);
|
|
3328
3374
|
}
|
|
3329
3375
|
suspense.effects = [];
|
|
@@ -3609,8 +3655,15 @@ function watch(source, cb, options) {
|
|
|
3609
3655
|
}
|
|
3610
3656
|
return doWatch(source, cb, options);
|
|
3611
3657
|
}
|
|
3612
|
-
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
3658
|
+
function doWatch(source, cb, { immediate, deep, flush, once, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
3613
3659
|
var _a;
|
|
3660
|
+
if (cb && once) {
|
|
3661
|
+
const _cb = cb;
|
|
3662
|
+
cb = (...args) => {
|
|
3663
|
+
_cb(...args);
|
|
3664
|
+
unwatch();
|
|
3665
|
+
};
|
|
3666
|
+
}
|
|
3614
3667
|
if (!cb) {
|
|
3615
3668
|
if (immediate !== void 0) {
|
|
3616
3669
|
warn(
|
|
@@ -3622,6 +3675,11 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3622
3675
|
`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
|
|
3623
3676
|
);
|
|
3624
3677
|
}
|
|
3678
|
+
if (once !== void 0) {
|
|
3679
|
+
warn(
|
|
3680
|
+
`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
|
|
3681
|
+
);
|
|
3682
|
+
}
|
|
3625
3683
|
}
|
|
3626
3684
|
const warnInvalidSource = (s) => {
|
|
3627
3685
|
warn(
|
|
@@ -3699,7 +3757,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3699
3757
|
};
|
|
3700
3758
|
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
|
|
3701
3759
|
const job = () => {
|
|
3702
|
-
if (!effect.active) {
|
|
3760
|
+
if (!effect.active || !effect.dirty) {
|
|
3703
3761
|
return;
|
|
3704
3762
|
}
|
|
3705
3763
|
if (cb) {
|
|
@@ -3732,7 +3790,13 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3732
3790
|
job.id = instance.uid;
|
|
3733
3791
|
scheduler = () => queueJob(job);
|
|
3734
3792
|
}
|
|
3735
|
-
const effect = new ReactiveEffect(getter, scheduler);
|
|
3793
|
+
const effect = new ReactiveEffect(getter, NOOP, scheduler);
|
|
3794
|
+
const unwatch = () => {
|
|
3795
|
+
effect.stop();
|
|
3796
|
+
if (instance && instance.scope) {
|
|
3797
|
+
remove(instance.scope.effects, effect);
|
|
3798
|
+
}
|
|
3799
|
+
};
|
|
3736
3800
|
{
|
|
3737
3801
|
effect.onTrack = onTrack;
|
|
3738
3802
|
effect.onTrigger = onTrigger;
|
|
@@ -3751,12 +3815,6 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3751
3815
|
} else {
|
|
3752
3816
|
effect.run();
|
|
3753
3817
|
}
|
|
3754
|
-
const unwatch = () => {
|
|
3755
|
-
effect.stop();
|
|
3756
|
-
if (instance && instance.scope) {
|
|
3757
|
-
remove(instance.scope.effects, effect);
|
|
3758
|
-
}
|
|
3759
|
-
};
|
|
3760
3818
|
return unwatch;
|
|
3761
3819
|
}
|
|
3762
3820
|
function instanceWatch(source, value, options) {
|
|
@@ -3989,6 +4047,7 @@ const BaseTransitionImpl = {
|
|
|
3989
4047
|
leavingHooks.afterLeave = () => {
|
|
3990
4048
|
state.isLeaving = false;
|
|
3991
4049
|
if (instance.update.active !== false) {
|
|
4050
|
+
instance.effect.dirty = true;
|
|
3992
4051
|
instance.update();
|
|
3993
4052
|
}
|
|
3994
4053
|
};
|
|
@@ -4327,6 +4386,7 @@ function defineAsyncComponent(source) {
|
|
|
4327
4386
|
load().then(() => {
|
|
4328
4387
|
loaded.value = true;
|
|
4329
4388
|
if (instance.parent && isKeepAlive(instance.parent.vnode)) {
|
|
4389
|
+
instance.parent.effect.dirty = true;
|
|
4330
4390
|
queueJob(instance.parent.update);
|
|
4331
4391
|
}
|
|
4332
4392
|
}).catch((err) => {
|
|
@@ -4624,7 +4684,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
4624
4684
|
}
|
|
4625
4685
|
return wrappedHook;
|
|
4626
4686
|
} else {
|
|
4627
|
-
const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ""));
|
|
4687
|
+
const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
|
|
4628
4688
|
warn(
|
|
4629
4689
|
`${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.` )
|
|
4630
4690
|
);
|
|
@@ -5346,7 +5406,10 @@ const publicPropertiesMap = (
|
|
|
5346
5406
|
$root: (i) => getPublicInstance(i.root),
|
|
5347
5407
|
$emit: (i) => i.emit,
|
|
5348
5408
|
$options: (i) => resolveMergedOptions(i) ,
|
|
5349
|
-
$forceUpdate: (i) => i.f || (i.f = () =>
|
|
5409
|
+
$forceUpdate: (i) => i.f || (i.f = () => {
|
|
5410
|
+
i.effect.dirty = true;
|
|
5411
|
+
queueJob(i.update);
|
|
5412
|
+
}),
|
|
5350
5413
|
$nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
|
|
5351
5414
|
$watch: (i) => instanceWatch.bind(i)
|
|
5352
5415
|
})
|
|
@@ -6247,7 +6310,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6247
6310
|
return vm;
|
|
6248
6311
|
}
|
|
6249
6312
|
}
|
|
6250
|
-
Vue.version = `2.6.14-compat:${"3.
|
|
6313
|
+
Vue.version = `2.6.14-compat:${"3.4.0-alpha.1"}`;
|
|
6251
6314
|
Vue.config = singletonApp.config;
|
|
6252
6315
|
Vue.use = (p, ...options) => {
|
|
6253
6316
|
if (p && isFunction(p.install)) {
|
|
@@ -7577,7 +7640,14 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7577
7640
|
break;
|
|
7578
7641
|
case Comment:
|
|
7579
7642
|
if (domType !== 8 /* COMMENT */ || isFragmentStart) {
|
|
7580
|
-
|
|
7643
|
+
if (node.tagName.toLowerCase() === "template") {
|
|
7644
|
+
const content = vnode.el.content.firstChild;
|
|
7645
|
+
replaceNode(content, node, parentComponent);
|
|
7646
|
+
vnode.el = node = content;
|
|
7647
|
+
nextNode = nextSibling(node);
|
|
7648
|
+
} else {
|
|
7649
|
+
nextNode = onMismatch();
|
|
7650
|
+
}
|
|
7581
7651
|
} else {
|
|
7582
7652
|
nextNode = nextSibling(node);
|
|
7583
7653
|
}
|
|
@@ -7619,7 +7689,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7619
7689
|
break;
|
|
7620
7690
|
default:
|
|
7621
7691
|
if (shapeFlag & 1) {
|
|
7622
|
-
if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
|
|
7692
|
+
if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
|
|
7623
7693
|
nextNode = onMismatch();
|
|
7624
7694
|
} else {
|
|
7625
7695
|
nextNode = hydrateElement(
|
|
@@ -7634,6 +7704,13 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7634
7704
|
} else if (shapeFlag & 6) {
|
|
7635
7705
|
vnode.slotScopeIds = slotScopeIds;
|
|
7636
7706
|
const container = parentNode(node);
|
|
7707
|
+
if (isFragmentStart) {
|
|
7708
|
+
nextNode = locateClosingAnchor(node);
|
|
7709
|
+
} else if (isComment(node) && node.data === "teleport start") {
|
|
7710
|
+
nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
7711
|
+
} else {
|
|
7712
|
+
nextNode = nextSibling(node);
|
|
7713
|
+
}
|
|
7637
7714
|
mountComponent(
|
|
7638
7715
|
vnode,
|
|
7639
7716
|
container,
|
|
@@ -7643,10 +7720,6 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7643
7720
|
isSVGContainer(container),
|
|
7644
7721
|
optimized
|
|
7645
7722
|
);
|
|
7646
|
-
nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
|
|
7647
|
-
if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
|
|
7648
|
-
nextNode = nextSibling(nextNode);
|
|
7649
|
-
}
|
|
7650
7723
|
if (isAsyncWrapper(vnode)) {
|
|
7651
7724
|
let subTree;
|
|
7652
7725
|
if (isFragmentStart) {
|
|
@@ -7696,7 +7769,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7696
7769
|
};
|
|
7697
7770
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
7698
7771
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
7699
|
-
const { type, props, patchFlag, shapeFlag, dirs } = vnode;
|
|
7772
|
+
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
7700
7773
|
const forcePatchValue = type === "input" && dirs || type === "option";
|
|
7701
7774
|
{
|
|
7702
7775
|
if (dirs) {
|
|
@@ -7733,12 +7806,23 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7733
7806
|
if (vnodeHooks = props && props.onVnodeBeforeMount) {
|
|
7734
7807
|
invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
7735
7808
|
}
|
|
7809
|
+
let needCallTransitionHooks = false;
|
|
7810
|
+
if (isTemplateNode(el)) {
|
|
7811
|
+
needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
7812
|
+
const content = el.content.firstChild;
|
|
7813
|
+
if (needCallTransitionHooks) {
|
|
7814
|
+
transition.beforeEnter(content);
|
|
7815
|
+
}
|
|
7816
|
+
replaceNode(content, el, parentComponent);
|
|
7817
|
+
vnode.el = el = content;
|
|
7818
|
+
}
|
|
7736
7819
|
if (dirs) {
|
|
7737
7820
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
7738
7821
|
}
|
|
7739
|
-
if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
|
|
7822
|
+
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
7740
7823
|
queueEffectWithSuspense(() => {
|
|
7741
7824
|
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
7825
|
+
needCallTransitionHooks && transition.enter(el);
|
|
7742
7826
|
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
7743
7827
|
}, parentSuspense);
|
|
7744
7828
|
}
|
|
@@ -7856,7 +7940,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7856
7940
|
);
|
|
7857
7941
|
vnode.el = null;
|
|
7858
7942
|
if (isFragment) {
|
|
7859
|
-
const end =
|
|
7943
|
+
const end = locateClosingAnchor(node);
|
|
7860
7944
|
while (true) {
|
|
7861
7945
|
const next2 = nextSibling(node);
|
|
7862
7946
|
if (next2 && next2 !== end) {
|
|
@@ -7881,14 +7965,14 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7881
7965
|
);
|
|
7882
7966
|
return next;
|
|
7883
7967
|
};
|
|
7884
|
-
const
|
|
7968
|
+
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
7885
7969
|
let match = 0;
|
|
7886
7970
|
while (node) {
|
|
7887
7971
|
node = nextSibling(node);
|
|
7888
7972
|
if (node && isComment(node)) {
|
|
7889
|
-
if (node.data ===
|
|
7973
|
+
if (node.data === open)
|
|
7890
7974
|
match++;
|
|
7891
|
-
if (node.data ===
|
|
7975
|
+
if (node.data === close) {
|
|
7892
7976
|
if (match === 0) {
|
|
7893
7977
|
return nextSibling(node);
|
|
7894
7978
|
} else {
|
|
@@ -7899,6 +7983,23 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7899
7983
|
}
|
|
7900
7984
|
return node;
|
|
7901
7985
|
};
|
|
7986
|
+
const replaceNode = (newNode, oldNode, parentComponent) => {
|
|
7987
|
+
const parentNode2 = oldNode.parentNode;
|
|
7988
|
+
if (parentNode2) {
|
|
7989
|
+
parentNode2.replaceChild(newNode, oldNode);
|
|
7990
|
+
}
|
|
7991
|
+
let parent = parentComponent;
|
|
7992
|
+
while (parent) {
|
|
7993
|
+
if (parent.vnode.el === oldNode) {
|
|
7994
|
+
parent.vnode.el = newNode;
|
|
7995
|
+
parent.subTree.el = newNode;
|
|
7996
|
+
}
|
|
7997
|
+
parent = parent.parent;
|
|
7998
|
+
}
|
|
7999
|
+
};
|
|
8000
|
+
const isTemplateNode = (node) => {
|
|
8001
|
+
return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
|
|
8002
|
+
};
|
|
7902
8003
|
return [hydrate, hydrateNode];
|
|
7903
8004
|
}
|
|
7904
8005
|
|
|
@@ -8226,7 +8327,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8226
8327
|
if (dirs) {
|
|
8227
8328
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
8228
8329
|
}
|
|
8229
|
-
const needCallTransitionHooks = (
|
|
8330
|
+
const needCallTransitionHooks = needTransition(parentSuspense, transition);
|
|
8230
8331
|
if (needCallTransitionHooks) {
|
|
8231
8332
|
transition.beforeEnter(el);
|
|
8232
8333
|
}
|
|
@@ -8615,6 +8716,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8615
8716
|
} else {
|
|
8616
8717
|
instance.next = n2;
|
|
8617
8718
|
invalidateJob(instance.update);
|
|
8719
|
+
instance.effect.dirty = true;
|
|
8618
8720
|
instance.update();
|
|
8619
8721
|
}
|
|
8620
8722
|
} else {
|
|
@@ -8808,11 +8910,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8808
8910
|
};
|
|
8809
8911
|
const effect = instance.effect = new ReactiveEffect(
|
|
8810
8912
|
componentUpdateFn,
|
|
8913
|
+
NOOP,
|
|
8811
8914
|
() => queueJob(update),
|
|
8812
8915
|
instance.scope
|
|
8813
8916
|
// track it in component's effect scope
|
|
8814
8917
|
);
|
|
8815
|
-
const update = instance.update = () =>
|
|
8918
|
+
const update = instance.update = () => {
|
|
8919
|
+
if (effect.dirty) {
|
|
8920
|
+
effect.run();
|
|
8921
|
+
}
|
|
8922
|
+
};
|
|
8816
8923
|
update.id = instance.uid;
|
|
8817
8924
|
toggleRecurse(instance, true);
|
|
8818
8925
|
{
|
|
@@ -9143,8 +9250,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9143
9250
|
moveStaticNode(vnode, container, anchor);
|
|
9144
9251
|
return;
|
|
9145
9252
|
}
|
|
9146
|
-
const
|
|
9147
|
-
if (
|
|
9253
|
+
const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
|
|
9254
|
+
if (needTransition2) {
|
|
9148
9255
|
if (moveType === 0) {
|
|
9149
9256
|
transition.beforeEnter(el);
|
|
9150
9257
|
hostInsert(el, container, anchor);
|
|
@@ -9373,6 +9480,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9373
9480
|
function toggleRecurse({ effect, update }, allowed) {
|
|
9374
9481
|
effect.allowRecurse = update.allowRecurse = allowed;
|
|
9375
9482
|
}
|
|
9483
|
+
function needTransition(parentSuspense, transition) {
|
|
9484
|
+
return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
|
|
9485
|
+
}
|
|
9376
9486
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
9377
9487
|
const ch1 = n1.children;
|
|
9378
9488
|
const ch2 = n2.children;
|
|
@@ -10781,7 +10891,8 @@ function isMemoSame(cached, memo) {
|
|
|
10781
10891
|
return true;
|
|
10782
10892
|
}
|
|
10783
10893
|
|
|
10784
|
-
const version = "3.
|
|
10894
|
+
const version = "3.4.0-alpha.1";
|
|
10895
|
+
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
10785
10896
|
const ssrUtils = null;
|
|
10786
10897
|
const resolveFilter = resolveFilter$1 ;
|
|
10787
10898
|
const _compatUtils = {
|
|
@@ -12417,6 +12528,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
12417
12528
|
BaseTransitionPropsValidators: BaseTransitionPropsValidators,
|
|
12418
12529
|
Comment: Comment,
|
|
12419
12530
|
EffectScope: EffectScope,
|
|
12531
|
+
ErrorTypeStrings: ErrorTypeStrings,
|
|
12420
12532
|
Fragment: Fragment,
|
|
12421
12533
|
KeepAlive: KeepAlive,
|
|
12422
12534
|
ReactiveEffect: ReactiveEffect,
|
|
@@ -14083,9 +14195,13 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
14083
14195
|
context.transformHoist(children, context, node);
|
|
14084
14196
|
}
|
|
14085
14197
|
if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
|
|
14086
|
-
|
|
14198
|
+
const hoisted = context.hoist(
|
|
14087
14199
|
createArrayExpression(node.codegenNode.children)
|
|
14088
14200
|
);
|
|
14201
|
+
if (context.hmr) {
|
|
14202
|
+
hoisted.content = `[...${hoisted.content}]`;
|
|
14203
|
+
}
|
|
14204
|
+
node.codegenNode.children = hoisted;
|
|
14089
14205
|
}
|
|
14090
14206
|
}
|
|
14091
14207
|
function getConstantType(node, context) {
|
|
@@ -14258,6 +14374,7 @@ function createTransformContext(root, {
|
|
|
14258
14374
|
filename = "",
|
|
14259
14375
|
prefixIdentifiers = false,
|
|
14260
14376
|
hoistStatic: hoistStatic2 = false,
|
|
14377
|
+
hmr = false,
|
|
14261
14378
|
cacheHandlers = false,
|
|
14262
14379
|
nodeTransforms = [],
|
|
14263
14380
|
directiveTransforms = {},
|
|
@@ -14283,6 +14400,7 @@ function createTransformContext(root, {
|
|
|
14283
14400
|
selfName: nameMatch && capitalize(camelize(nameMatch[1])),
|
|
14284
14401
|
prefixIdentifiers,
|
|
14285
14402
|
hoistStatic: hoistStatic2,
|
|
14403
|
+
hmr,
|
|
14286
14404
|
cacheHandlers,
|
|
14287
14405
|
nodeTransforms,
|
|
14288
14406
|
directiveTransforms,
|
|
@@ -15666,7 +15784,7 @@ const trackSlotScopes = (node, context) => {
|
|
|
15666
15784
|
}
|
|
15667
15785
|
}
|
|
15668
15786
|
};
|
|
15669
|
-
const buildClientSlotFn = (props, children, loc) => createFunctionExpression(
|
|
15787
|
+
const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression(
|
|
15670
15788
|
props,
|
|
15671
15789
|
children,
|
|
15672
15790
|
false,
|
|
@@ -15688,7 +15806,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15688
15806
|
slotsProperties.push(
|
|
15689
15807
|
createObjectProperty(
|
|
15690
15808
|
arg || createSimpleExpression("default", true),
|
|
15691
|
-
buildSlotFn(exp, children, loc)
|
|
15809
|
+
buildSlotFn(exp, void 0, children, loc)
|
|
15692
15810
|
)
|
|
15693
15811
|
);
|
|
15694
15812
|
}
|
|
@@ -15725,10 +15843,15 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15725
15843
|
} else {
|
|
15726
15844
|
hasDynamicSlots = true;
|
|
15727
15845
|
}
|
|
15728
|
-
const
|
|
15846
|
+
const vFor = findDir(slotElement, "for");
|
|
15847
|
+
const slotFunction = buildSlotFn(
|
|
15848
|
+
slotProps,
|
|
15849
|
+
vFor == null ? void 0 : vFor.exp,
|
|
15850
|
+
slotChildren,
|
|
15851
|
+
slotLoc
|
|
15852
|
+
);
|
|
15729
15853
|
let vIf;
|
|
15730
15854
|
let vElse;
|
|
15731
|
-
let vFor;
|
|
15732
15855
|
if (vIf = findDir(slotElement, "if")) {
|
|
15733
15856
|
hasDynamicSlots = true;
|
|
15734
15857
|
dynamicSlots.push(
|
|
@@ -15773,7 +15896,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15773
15896
|
createCompilerError(30, vElse.loc)
|
|
15774
15897
|
);
|
|
15775
15898
|
}
|
|
15776
|
-
} else if (vFor
|
|
15899
|
+
} else if (vFor) {
|
|
15777
15900
|
hasDynamicSlots = true;
|
|
15778
15901
|
const parseResult = vFor.parseResult || parseForExpression(vFor.exp, context);
|
|
15779
15902
|
if (parseResult) {
|
|
@@ -15814,7 +15937,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15814
15937
|
}
|
|
15815
15938
|
if (!onComponentSlot) {
|
|
15816
15939
|
const buildDefaultSlotProperty = (props, children2) => {
|
|
15817
|
-
const fn = buildSlotFn(props, children2, loc);
|
|
15940
|
+
const fn = buildSlotFn(props, void 0, children2, loc);
|
|
15818
15941
|
if (context.compatConfig) {
|
|
15819
15942
|
fn.isNonScopedSlot = true;
|
|
15820
15943
|
}
|
|
@@ -17608,4 +17731,4 @@ var Vue$1 = Vue;
|
|
|
17608
17731
|
|
|
17609
17732
|
const { configureCompat } = Vue$1;
|
|
17610
17733
|
|
|
17611
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|
|
17734
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|