@vue/server-renderer 3.6.0-rc.13 → 3.6.0-rc.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/server-renderer v3.6.0-rc.
|
|
2
|
+
* @vue/server-renderer v3.6.0-rc.15
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -57,10 +57,18 @@ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" &
|
|
|
57
57
|
const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
|
|
58
58
|
const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
|
|
59
59
|
const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
|
|
60
|
+
const STRING_CACHE_MAX_SIZE = 1e4;
|
|
60
61
|
const cacheStringFunction = (fn) => {
|
|
61
|
-
|
|
62
|
+
let cache = Object.create(null);
|
|
63
|
+
let size = 0;
|
|
62
64
|
return ((str) => {
|
|
63
|
-
|
|
65
|
+
const hit = cache[str];
|
|
66
|
+
if (hit !== void 0) return hit;
|
|
67
|
+
if (++size > STRING_CACHE_MAX_SIZE) {
|
|
68
|
+
cache = Object.create(null);
|
|
69
|
+
size = 1;
|
|
70
|
+
}
|
|
71
|
+
return cache[str] = fn(str);
|
|
64
72
|
});
|
|
65
73
|
};
|
|
66
74
|
const camelizeRE = /-(\w)/g;
|
|
@@ -68,22 +76,22 @@ const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
|
|
|
68
76
|
/**
|
|
69
77
|
* @private
|
|
70
78
|
*/
|
|
71
|
-
const camelize = cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
79
|
+
const camelize = /*@__PURE__*/ cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
72
80
|
const hyphenateRE = /\B([A-Z])/g;
|
|
73
81
|
/**
|
|
74
82
|
* @private
|
|
75
83
|
*/
|
|
76
|
-
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
84
|
+
const hyphenate = /*@__PURE__*/ cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
77
85
|
/**
|
|
78
86
|
* @private
|
|
79
87
|
*/
|
|
80
|
-
const capitalize = cacheStringFunction((str) => {
|
|
88
|
+
const capitalize = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
81
89
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
82
90
|
});
|
|
83
91
|
/**
|
|
84
92
|
* @private
|
|
85
93
|
*/
|
|
86
|
-
const toHandlerKey = cacheStringFunction((str) => {
|
|
94
|
+
const toHandlerKey = /*@__PURE__*/ cacheStringFunction((str) => {
|
|
87
95
|
return str ? `on${capitalize(str)}` : ``;
|
|
88
96
|
});
|
|
89
97
|
/**
|
|
@@ -199,26 +207,11 @@ const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
|
|
|
199
207
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
200
208
|
*/
|
|
201
209
|
const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
|
|
202
|
-
|
|
203
|
-
//#region packages/shared/src/domAttrConfig.ts
|
|
204
|
-
/**
|
|
205
|
-
* On the client we only need to offer special cases for boolean attributes that
|
|
206
|
-
* have different names from their corresponding dom properties:
|
|
207
|
-
* - itemscope -> N/A
|
|
208
|
-
* - allowfullscreen -> allowFullscreen
|
|
209
|
-
* - formnovalidate -> formNoValidate
|
|
210
|
-
* - ismap -> isMap
|
|
211
|
-
* - nomodule -> noModule
|
|
212
|
-
* - novalidate -> noValidate
|
|
213
|
-
* - playsinline -> playsInline
|
|
214
|
-
* - readonly -> readOnly
|
|
215
|
-
*/
|
|
216
|
-
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
|
|
217
|
-
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
210
|
+
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly");
|
|
218
211
|
/**
|
|
219
212
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
220
213
|
*/
|
|
221
|
-
const isBooleanAttr = /*@__PURE__*/ makeMap(
|
|
214
|
+
const isBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
|
|
222
215
|
/**
|
|
223
216
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
224
217
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -227,12 +220,10 @@ function includeBooleanAttr(value) {
|
|
|
227
220
|
return !!value || value === "";
|
|
228
221
|
}
|
|
229
222
|
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u000d\u0020]/;
|
|
230
|
-
const attrValidationCache = {};
|
|
231
223
|
function isSSRSafeAttrName(name) {
|
|
232
|
-
if (attrValidationCache.hasOwnProperty(name)) return attrValidationCache[name];
|
|
233
224
|
const isUnsafe = unsafeAttrCharRE.test(name);
|
|
234
225
|
if (isUnsafe) console.error(`unsafe attribute name: ${name}`);
|
|
235
|
-
return
|
|
226
|
+
return !isUnsafe;
|
|
236
227
|
}
|
|
237
228
|
const propsToAttrMap = {
|
|
238
229
|
acceptCharset: "accept-charset",
|
|
@@ -457,41 +448,6 @@ function normalizeCssVarValue(value) {
|
|
|
457
448
|
return String(value);
|
|
458
449
|
}
|
|
459
450
|
//#endregion
|
|
460
|
-
//#region packages/reactivity/src/debug.ts
|
|
461
|
-
const triggerEventInfos = [];
|
|
462
|
-
function onTrack(sub, debugInfo) {
|
|
463
|
-
if (sub.onTrack) sub.onTrack(extend({ effect: sub }, debugInfo));
|
|
464
|
-
}
|
|
465
|
-
function onTrigger(sub) {
|
|
466
|
-
if (sub.onTrigger) {
|
|
467
|
-
const debugInfo = triggerEventInfos[triggerEventInfos.length - 1];
|
|
468
|
-
sub.onTrigger(extend({ effect: sub }, debugInfo));
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
function setupOnTrigger(target) {
|
|
472
|
-
Object.defineProperty(target.prototype, "onTrigger", {
|
|
473
|
-
get() {
|
|
474
|
-
return this._onTrigger;
|
|
475
|
-
},
|
|
476
|
-
set(val) {
|
|
477
|
-
if (val && !this._onTrigger) setupFlagsHandler(this);
|
|
478
|
-
this._onTrigger = val;
|
|
479
|
-
}
|
|
480
|
-
});
|
|
481
|
-
}
|
|
482
|
-
function setupFlagsHandler(target) {
|
|
483
|
-
target._flags = target.flags;
|
|
484
|
-
Object.defineProperty(target, "flags", {
|
|
485
|
-
get() {
|
|
486
|
-
return target._flags;
|
|
487
|
-
},
|
|
488
|
-
set(value) {
|
|
489
|
-
if (!(target._flags & 48) && !!(value & 48)) onTrigger(this);
|
|
490
|
-
target._flags = value;
|
|
491
|
-
}
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
|
-
//#endregion
|
|
495
451
|
//#region packages/reactivity/src/warning.ts
|
|
496
452
|
function warn$2(msg, ...args) {
|
|
497
453
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
@@ -501,13 +457,7 @@ function warn$2(msg, ...args) {
|
|
|
501
457
|
const notifyBuffer = [];
|
|
502
458
|
let batchDepth = 0;
|
|
503
459
|
let activeSub = void 0;
|
|
504
|
-
|
|
505
|
-
function incRunDepth() {
|
|
506
|
-
++runDepth;
|
|
507
|
-
}
|
|
508
|
-
function decRunDepth() {
|
|
509
|
-
--runDepth;
|
|
510
|
-
}
|
|
460
|
+
const CHECKING = 512;
|
|
511
461
|
let globalVersion = 0;
|
|
512
462
|
let notifyIndex = 0;
|
|
513
463
|
let notifyBufferLength = 0;
|
|
@@ -556,6 +506,7 @@ function unlink(link, sub = link.sub) {
|
|
|
556
506
|
const nextDep = link.nextDep;
|
|
557
507
|
const nextSub = link.nextSub;
|
|
558
508
|
const prevSub = link.prevSub;
|
|
509
|
+
link.prevDep = link.nextDep = link.prevSub = link.nextSub = void 0;
|
|
559
510
|
if (nextDep !== void 0) nextDep.prevDep = prevDep;
|
|
560
511
|
else sub.depsTail = prevDep;
|
|
561
512
|
if (prevDep !== void 0) prevDep.nextDep = nextDep;
|
|
@@ -563,7 +514,7 @@ function unlink(link, sub = link.sub) {
|
|
|
563
514
|
if (nextSub !== void 0) nextSub.prevSub = prevSub;
|
|
564
515
|
else dep.subsTail = prevSub;
|
|
565
516
|
if (prevSub !== void 0) prevSub.nextSub = nextSub;
|
|
566
|
-
else if ((dep.subs = nextSub) === void 0) {
|
|
517
|
+
else if ((dep.subs = nextSub) === void 0 && dep.flags & 1) {
|
|
567
518
|
let toRemove = dep.deps;
|
|
568
519
|
if (toRemove !== void 0) {
|
|
569
520
|
do
|
|
@@ -581,14 +532,12 @@ function propagate(link) {
|
|
|
581
532
|
const sub = link.sub;
|
|
582
533
|
let flags = sub.flags;
|
|
583
534
|
if (flags & 3) {
|
|
584
|
-
if (!(flags &
|
|
585
|
-
|
|
586
|
-
if (runDepth) sub.flags |= 8;
|
|
587
|
-
} else if (!(flags & 12)) flags = 0;
|
|
535
|
+
if (!(flags & 44)) sub.flags = flags | 32;
|
|
536
|
+
else if (!(flags & 12)) flags = 0;
|
|
588
537
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
589
538
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
590
539
|
sub.flags = flags | 40;
|
|
591
|
-
flags
|
|
540
|
+
flags = sub === activeSub || activeSub === void 0 ? 0 : flags & 1;
|
|
592
541
|
} else flags = 0;
|
|
593
542
|
if (flags & 2) notifyBuffer[notifyBufferLength++] = sub;
|
|
594
543
|
if (flags & 1) {
|
|
@@ -624,7 +573,7 @@ function propagate(link) {
|
|
|
624
573
|
function startTracking(sub) {
|
|
625
574
|
++globalVersion;
|
|
626
575
|
sub.depsTail = void 0;
|
|
627
|
-
sub.flags = sub.flags & -
|
|
576
|
+
sub.flags = sub.flags & -569 | 4;
|
|
628
577
|
return setActiveSub(sub);
|
|
629
578
|
}
|
|
630
579
|
function endTracking(sub, prevSub) {
|
|
@@ -632,8 +581,11 @@ function endTracking(sub, prevSub) {
|
|
|
632
581
|
activeSub = prevSub;
|
|
633
582
|
const depsTail = sub.depsTail;
|
|
634
583
|
let toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
|
|
635
|
-
while (toRemove !== void 0)
|
|
636
|
-
|
|
584
|
+
while (toRemove !== void 0) {
|
|
585
|
+
unlink(toRemove, sub);
|
|
586
|
+
toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
|
|
587
|
+
}
|
|
588
|
+
if ((sub.flags &= -5) & 8) markRecursed(sub);
|
|
637
589
|
}
|
|
638
590
|
function flush() {
|
|
639
591
|
let hasError = false;
|
|
@@ -655,45 +607,67 @@ function flush() {
|
|
|
655
607
|
if (hasError) throw error;
|
|
656
608
|
}
|
|
657
609
|
function checkDirty(link, sub) {
|
|
610
|
+
try {
|
|
611
|
+
return walkDirty(link, sub);
|
|
612
|
+
} catch (err) {
|
|
613
|
+
markStale(sub);
|
|
614
|
+
throw err;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
function walkDirty(link, sub) {
|
|
618
|
+
const root = sub;
|
|
658
619
|
let stack;
|
|
659
620
|
let checkDepth = 0;
|
|
621
|
+
let staleDepth = 0;
|
|
622
|
+
let staleFloor = 0;
|
|
660
623
|
top: do {
|
|
661
624
|
const dep = link.dep;
|
|
662
625
|
const depFlags = dep.flags;
|
|
663
626
|
let dirty = false;
|
|
664
627
|
if (sub.flags & 16) dirty = true;
|
|
665
628
|
else if ((depFlags & 17) === 17) {
|
|
666
|
-
const subs = dep.subs;
|
|
667
629
|
if (dep.update()) {
|
|
668
|
-
|
|
630
|
+
const subs = dep.subs;
|
|
631
|
+
if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
|
|
669
632
|
dirty = true;
|
|
670
633
|
}
|
|
671
634
|
} else if ((depFlags & 33) === 33) {
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
635
|
+
const depth = dep === root ? 0 : depFlags & CHECKING ? checkingDepth(dep, stack, checkDepth) : -1;
|
|
636
|
+
if (depth < 0) {
|
|
637
|
+
if (link.nextSub !== void 0 || link.prevSub !== void 0) dep.flags = depFlags | CHECKING;
|
|
638
|
+
stack = {
|
|
639
|
+
value: link,
|
|
640
|
+
prev: stack
|
|
641
|
+
};
|
|
642
|
+
link = dep.deps;
|
|
643
|
+
sub = dep;
|
|
644
|
+
++checkDepth;
|
|
645
|
+
continue;
|
|
646
|
+
}
|
|
647
|
+
if (depth < checkDepth) {
|
|
648
|
+
staleFloor = staleDepth && staleFloor < depth ? staleFloor : depth;
|
|
649
|
+
staleDepth = checkDepth;
|
|
650
|
+
}
|
|
680
651
|
}
|
|
681
652
|
if (!dirty && link.nextDep !== void 0) {
|
|
682
653
|
link = link.nextDep;
|
|
683
654
|
continue;
|
|
684
655
|
}
|
|
685
656
|
while (checkDepth) {
|
|
657
|
+
const stale = checkDepth === staleDepth;
|
|
658
|
+
if (stale && --staleDepth === staleFloor) staleDepth = 0;
|
|
686
659
|
--checkDepth;
|
|
687
660
|
link = stack.value;
|
|
688
661
|
stack = stack.prev;
|
|
689
662
|
if (dirty) {
|
|
690
|
-
const subs = sub.subs;
|
|
691
663
|
if (sub.update()) {
|
|
692
|
-
|
|
664
|
+
const subs = sub.subs;
|
|
665
|
+
if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
|
|
693
666
|
sub = link.sub;
|
|
694
667
|
continue;
|
|
695
668
|
}
|
|
696
|
-
} else sub.flags
|
|
669
|
+
} else if (stale) sub.flags = sub.flags & -545 | 16;
|
|
670
|
+
else sub.flags &= -545;
|
|
697
671
|
sub = link.sub;
|
|
698
672
|
if (link.nextDep !== void 0) {
|
|
699
673
|
link = link.nextDep;
|
|
@@ -701,9 +675,21 @@ function checkDirty(link, sub) {
|
|
|
701
675
|
}
|
|
702
676
|
dirty = false;
|
|
703
677
|
}
|
|
704
|
-
return dirty && !!sub.flags;
|
|
678
|
+
return (dirty || !!(sub.flags & 16)) && !!sub.flags;
|
|
705
679
|
} while (true);
|
|
706
680
|
}
|
|
681
|
+
function checkingDepth(dep, stack, depth) {
|
|
682
|
+
for (; stack !== void 0; stack = stack.prev, --depth) if (stack.value.dep === dep) return depth;
|
|
683
|
+
return -1;
|
|
684
|
+
}
|
|
685
|
+
function markStale(sub) {
|
|
686
|
+
const nodes = [sub];
|
|
687
|
+
do {
|
|
688
|
+
sub = nodes.pop();
|
|
689
|
+
sub.flags = sub.flags & -33 | 16;
|
|
690
|
+
for (let link = sub.deps; link !== void 0; link = link.nextDep) if (link.dep.flags & 32) nodes.push(link.dep);
|
|
691
|
+
} while (nodes.length);
|
|
692
|
+
}
|
|
707
693
|
function shallowPropagate(link) {
|
|
708
694
|
do {
|
|
709
695
|
const sub = link.sub;
|
|
@@ -721,6 +707,71 @@ function isValidLink(checkLink, sub) {
|
|
|
721
707
|
}
|
|
722
708
|
return false;
|
|
723
709
|
}
|
|
710
|
+
function markRecursed(sub) {
|
|
711
|
+
const nodes = [sub];
|
|
712
|
+
do {
|
|
713
|
+
sub = nodes.pop();
|
|
714
|
+
for (let link = sub.deps; link !== void 0; link = link.nextDep) {
|
|
715
|
+
const dep = link.dep;
|
|
716
|
+
if ((dep.flags & 40) === 32) {
|
|
717
|
+
dep.flags |= 8;
|
|
718
|
+
nodes.push(dep);
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
} while (nodes.length);
|
|
722
|
+
}
|
|
723
|
+
//#endregion
|
|
724
|
+
//#region packages/reactivity/src/debug.ts
|
|
725
|
+
const triggered = [];
|
|
726
|
+
function onTrack(sub, debugInfo) {
|
|
727
|
+
if (sub.onTrack) sub.onTrack(extend({ effect: sub }, debugInfo));
|
|
728
|
+
}
|
|
729
|
+
function onTrigger(sub, debugInfo) {
|
|
730
|
+
if (sub.onTrigger) sub.onTrigger(extend({ effect: sub }, debugInfo));
|
|
731
|
+
}
|
|
732
|
+
function startTrigger() {
|
|
733
|
+
triggered.push([]);
|
|
734
|
+
}
|
|
735
|
+
function endTrigger(debugInfo) {
|
|
736
|
+
const subs = triggered.pop();
|
|
737
|
+
if (subs.length) {
|
|
738
|
+
startBatch();
|
|
739
|
+
try {
|
|
740
|
+
for (let i = 0; i < subs.length; i++) {
|
|
741
|
+
const sub = subs[i];
|
|
742
|
+
if (sub.flags & 3) onTrigger(sub, debugInfo);
|
|
743
|
+
}
|
|
744
|
+
} finally {
|
|
745
|
+
endBatch();
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
function setupOnTrigger(target) {
|
|
750
|
+
Object.defineProperty(target.prototype, "onTrigger", {
|
|
751
|
+
get() {
|
|
752
|
+
return this._onTrigger;
|
|
753
|
+
},
|
|
754
|
+
set(val) {
|
|
755
|
+
if (val && !this._onTrigger) setupFlagsHandler(this);
|
|
756
|
+
this._onTrigger = val;
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
function setupFlagsHandler(target) {
|
|
761
|
+
target._flags = target.flags;
|
|
762
|
+
Object.defineProperty(target, "flags", {
|
|
763
|
+
get() {
|
|
764
|
+
return target._flags;
|
|
765
|
+
},
|
|
766
|
+
set(value) {
|
|
767
|
+
if (!(target._flags & 48) && !!(value & 48)) {
|
|
768
|
+
if (triggered.length) triggered[triggered.length - 1].push(this);
|
|
769
|
+
else onTrigger(this);
|
|
770
|
+
}
|
|
771
|
+
target._flags = value;
|
|
772
|
+
}
|
|
773
|
+
});
|
|
774
|
+
}
|
|
724
775
|
//#endregion
|
|
725
776
|
//#region packages/reactivity/src/dep.ts
|
|
726
777
|
var Dep = class {
|
|
@@ -780,20 +831,12 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
780
831
|
if (!depsMap) return;
|
|
781
832
|
const run = (dep) => {
|
|
782
833
|
if (dep !== void 0 && dep.subs !== void 0) {
|
|
783
|
-
triggerEventInfos.push({
|
|
784
|
-
target,
|
|
785
|
-
type,
|
|
786
|
-
key,
|
|
787
|
-
newValue,
|
|
788
|
-
oldValue,
|
|
789
|
-
oldTarget
|
|
790
|
-
});
|
|
791
834
|
propagate(dep.subs);
|
|
792
835
|
shallowPropagate(dep.subs);
|
|
793
|
-
triggerEventInfos.pop();
|
|
794
836
|
}
|
|
795
837
|
};
|
|
796
838
|
startBatch();
|
|
839
|
+
startTrigger();
|
|
797
840
|
if (type === "clear") depsMap.forEach(run);
|
|
798
841
|
else {
|
|
799
842
|
const targetIsArray = isArray(target);
|
|
@@ -823,6 +866,14 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
823
866
|
}
|
|
824
867
|
}
|
|
825
868
|
}
|
|
869
|
+
endTrigger({
|
|
870
|
+
target,
|
|
871
|
+
type,
|
|
872
|
+
key,
|
|
873
|
+
newValue,
|
|
874
|
+
oldValue,
|
|
875
|
+
oldTarget
|
|
876
|
+
});
|
|
826
877
|
endBatch();
|
|
827
878
|
}
|
|
828
879
|
//#endregion
|
|
@@ -1033,7 +1084,7 @@ function noTracking(self, method, args = []) {
|
|
|
1033
1084
|
//#endregion
|
|
1034
1085
|
//#region packages/reactivity/src/baseHandlers.ts
|
|
1035
1086
|
const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
1036
|
-
const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
1087
|
+
const builtInSymbols = /*@__PURE__*/ new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
1037
1088
|
function hasOwnProperty(key) {
|
|
1038
1089
|
if (!isSymbol(key)) key = String(key);
|
|
1039
1090
|
const obj = /* @__PURE__ */ toRaw(this);
|
|
@@ -1627,6 +1678,10 @@ var ReactiveEffect = class {
|
|
|
1627
1678
|
get active() {
|
|
1628
1679
|
return !(this.flags & 1024);
|
|
1629
1680
|
}
|
|
1681
|
+
/** @internal */
|
|
1682
|
+
get running() {
|
|
1683
|
+
return !!(this.flags & 4);
|
|
1684
|
+
}
|
|
1630
1685
|
pause() {
|
|
1631
1686
|
this.flags |= 256;
|
|
1632
1687
|
}
|
|
@@ -1640,11 +1695,9 @@ var ReactiveEffect = class {
|
|
|
1640
1695
|
if (!this.active) return this.fn();
|
|
1641
1696
|
cleanup(this);
|
|
1642
1697
|
const prevSub = startTracking(this);
|
|
1643
|
-
incRunDepth();
|
|
1644
1698
|
try {
|
|
1645
1699
|
return this.fn();
|
|
1646
1700
|
} finally {
|
|
1647
|
-
decRunDepth();
|
|
1648
1701
|
endTracking(this, prevSub);
|
|
1649
1702
|
const flags = this.flags;
|
|
1650
1703
|
if ((flags & 136) === 136) {
|
|
@@ -1667,9 +1720,9 @@ var ReactiveEffect = class {
|
|
|
1667
1720
|
if (flags & 16) return true;
|
|
1668
1721
|
if (flags & 32) {
|
|
1669
1722
|
if (checkDirty(this.deps, this)) {
|
|
1670
|
-
this.
|
|
1723
|
+
if (this.active) this.flags |= 16;
|
|
1671
1724
|
return true;
|
|
1672
|
-
} else this.flags
|
|
1725
|
+
} else this.flags &= -33;
|
|
1673
1726
|
}
|
|
1674
1727
|
return false;
|
|
1675
1728
|
}
|
|
@@ -1715,8 +1768,10 @@ var EffectScope = class {
|
|
|
1715
1768
|
const flags = this.flags;
|
|
1716
1769
|
if (flags & 256) {
|
|
1717
1770
|
this.flags = flags & -257;
|
|
1718
|
-
|
|
1719
|
-
|
|
1771
|
+
const deps = [];
|
|
1772
|
+
for (let link = this.deps; link !== void 0; link = link.nextDep) deps.push(link.dep);
|
|
1773
|
+
for (let i = 0; i < deps.length; i++) {
|
|
1774
|
+
const dep = deps[i];
|
|
1720
1775
|
if ("resume" in dep) dep.resume();
|
|
1721
1776
|
}
|
|
1722
1777
|
}
|
|
@@ -1745,8 +1800,10 @@ var EffectScope = class {
|
|
|
1745
1800
|
while (dep !== void 0) {
|
|
1746
1801
|
const node = dep.dep;
|
|
1747
1802
|
if ("stop" in node) {
|
|
1748
|
-
|
|
1803
|
+
const prev = dep.prevDep;
|
|
1749
1804
|
node.stop();
|
|
1805
|
+
const next = prev !== void 0 ? prev.nextDep : this.deps;
|
|
1806
|
+
dep = next === dep ? dep.nextDep : next;
|
|
1750
1807
|
} else dep = unlink(dep, this);
|
|
1751
1808
|
}
|
|
1752
1809
|
cleanup(this);
|
|
@@ -1761,6 +1818,7 @@ function setCurrentScope(scope) {
|
|
|
1761
1818
|
}
|
|
1762
1819
|
//#endregion
|
|
1763
1820
|
//#region packages/reactivity/src/computed.ts
|
|
1821
|
+
const FAILED = 64;
|
|
1764
1822
|
/**
|
|
1765
1823
|
* @private exported by @vue/reactivity for Vue core use, but not exported from
|
|
1766
1824
|
* the main vue package
|
|
@@ -1809,12 +1867,24 @@ var ComputedRefImpl = class {
|
|
|
1809
1867
|
}
|
|
1810
1868
|
get value() {
|
|
1811
1869
|
const flags = this.flags;
|
|
1812
|
-
|
|
1813
|
-
if (this.
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1870
|
+
try {
|
|
1871
|
+
if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
|
|
1872
|
+
if (this.update()) {
|
|
1873
|
+
const subs = this.subs;
|
|
1874
|
+
if (subs !== void 0) shallowPropagate(subs);
|
|
1875
|
+
}
|
|
1876
|
+
} else if (flags & 32) this.flags = flags & -33;
|
|
1877
|
+
} catch (err) {
|
|
1878
|
+
if (activeSub !== void 0) {
|
|
1879
|
+
onTrack(activeSub, {
|
|
1880
|
+
target: this,
|
|
1881
|
+
type: "get",
|
|
1882
|
+
key: "value"
|
|
1883
|
+
});
|
|
1884
|
+
link(this, activeSub);
|
|
1885
|
+
} else if (activeEffectScope !== void 0) link(this, activeEffectScope);
|
|
1886
|
+
throw err;
|
|
1887
|
+
}
|
|
1818
1888
|
if (activeSub !== void 0) {
|
|
1819
1889
|
onTrack(activeSub, {
|
|
1820
1890
|
target: this,
|
|
@@ -1822,7 +1892,18 @@ var ComputedRefImpl = class {
|
|
|
1822
1892
|
key: "value"
|
|
1823
1893
|
});
|
|
1824
1894
|
link(this, activeSub);
|
|
1825
|
-
} else if (activeEffectScope !== void 0)
|
|
1895
|
+
} else if (activeEffectScope !== void 0) {
|
|
1896
|
+
if (activeEffectScope.active) link(this, activeEffectScope);
|
|
1897
|
+
else if (this.subs === void 0) {
|
|
1898
|
+
let dep = this.deps;
|
|
1899
|
+
if (dep !== void 0) {
|
|
1900
|
+
do
|
|
1901
|
+
dep = unlink(dep, this);
|
|
1902
|
+
while (dep !== void 0);
|
|
1903
|
+
this.flags |= 16;
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1826
1907
|
return this._value;
|
|
1827
1908
|
}
|
|
1828
1909
|
set value(newValue) {
|
|
@@ -1834,11 +1915,15 @@ var ComputedRefImpl = class {
|
|
|
1834
1915
|
try {
|
|
1835
1916
|
const oldValue = this._value;
|
|
1836
1917
|
const newValue = this.fn(oldValue);
|
|
1837
|
-
if (hasChanged(oldValue, newValue)) {
|
|
1918
|
+
if (hasChanged(oldValue, newValue) || this.flags & FAILED) {
|
|
1838
1919
|
this._value = newValue;
|
|
1920
|
+
this.flags &= -65;
|
|
1839
1921
|
return true;
|
|
1840
1922
|
}
|
|
1841
1923
|
return false;
|
|
1924
|
+
} catch (err) {
|
|
1925
|
+
this.flags |= FAILED;
|
|
1926
|
+
throw err;
|
|
1842
1927
|
} finally {
|
|
1843
1928
|
endTracking(this, prevSub);
|
|
1844
1929
|
}
|
|
@@ -1859,6 +1944,7 @@ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
|
1859
1944
|
cRef.onTrack = debugOptions.onTrack;
|
|
1860
1945
|
cRef.onTrigger = debugOptions.onTrigger;
|
|
1861
1946
|
}
|
|
1947
|
+
if (isSSR && activeEffectScope !== void 0) link(cRef, activeEffectScope);
|
|
1862
1948
|
return cRef;
|
|
1863
1949
|
}
|
|
1864
1950
|
//#endregion
|
|
@@ -2172,7 +2258,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
2172
2258
|
if (isFunction(fn)) {
|
|
2173
2259
|
const res = callWithErrorHandling(fn, instance, type, args);
|
|
2174
2260
|
if (res && isPromise(res)) res.catch((err) => {
|
|
2175
|
-
handleError(err, instance, type);
|
|
2261
|
+
handleError(err, instance, type, void 0, true);
|
|
2176
2262
|
});
|
|
2177
2263
|
return res;
|
|
2178
2264
|
}
|
|
@@ -2182,7 +2268,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
2182
2268
|
return values;
|
|
2183
2269
|
} else warn$1(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`);
|
|
2184
2270
|
}
|
|
2185
|
-
function handleError(err, instance, type, throwInDev = true) {
|
|
2271
|
+
function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
|
|
2186
2272
|
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
|
|
2187
2273
|
if (instance) {
|
|
2188
2274
|
let cur = instance.parent;
|
|
@@ -2190,7 +2276,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
2190
2276
|
const errorInfo = ErrorTypeStrings[type];
|
|
2191
2277
|
while (cur) {
|
|
2192
2278
|
const errorCapturedHooks = cur.ec;
|
|
2193
|
-
if (errorCapturedHooks) {
|
|
2279
|
+
if (errorCapturedHooks && !cur.isUnmounted && (!isAsyncError || cur.scope.active)) {
|
|
2194
2280
|
for (let i = 0; i < errorCapturedHooks.length; i++) if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) return;
|
|
2195
2281
|
}
|
|
2196
2282
|
cur = cur.parent;
|
|
@@ -2495,7 +2581,11 @@ function reload(id, newComp) {
|
|
|
2495
2581
|
updateComponentDef(record.initialDef, newComp);
|
|
2496
2582
|
const instances = [...record.instances];
|
|
2497
2583
|
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2498
|
-
for (const instance of instances)
|
|
2584
|
+
for (const instance of instances) {
|
|
2585
|
+
if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2586
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2587
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2588
|
+
}
|
|
2499
2589
|
const dirtyInstances = new Set(instances);
|
|
2500
2590
|
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2501
2591
|
runWithHmrUpdating(() => {
|
|
@@ -2536,7 +2626,25 @@ function reload(id, newComp) {
|
|
|
2536
2626
|
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2537
2627
|
}
|
|
2538
2628
|
parents.forEach((parent) => {
|
|
2539
|
-
|
|
2629
|
+
const children = instances.filter((instance) => instance.parent === parent);
|
|
2630
|
+
const update = () => {
|
|
2631
|
+
if (!parent.scope.active) return;
|
|
2632
|
+
const activeChildren = children.filter((instance) => instance.scope.active);
|
|
2633
|
+
if (!activeChildren.length) return;
|
|
2634
|
+
const pending = activeChildren.find((instance) => instance.asyncDep && !instance.asyncResolved) || locateUnresolvedAsyncRoot(parent);
|
|
2635
|
+
if (pending) {
|
|
2636
|
+
pending.asyncDep.catch(NOOP).then(() => {
|
|
2637
|
+
if (parent.scope.active && (pending.asyncResolved || !pending.scope.active)) queueJob(update);
|
|
2638
|
+
});
|
|
2639
|
+
return;
|
|
2640
|
+
}
|
|
2641
|
+
for (const instance of activeChildren) {
|
|
2642
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2643
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2644
|
+
if (!dirtyInstances) hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2645
|
+
dirtyInstances.add(instance);
|
|
2646
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2647
|
+
}
|
|
2540
2648
|
runWithHmrUpdating(() => {
|
|
2541
2649
|
if (parent.vapor) parent.hmrRerender();
|
|
2542
2650
|
else {
|
|
@@ -2547,7 +2655,12 @@ function reload(id, newComp) {
|
|
|
2547
2655
|
}
|
|
2548
2656
|
}
|
|
2549
2657
|
});
|
|
2550
|
-
|
|
2658
|
+
queuePostFlushCb(() => {
|
|
2659
|
+
hmrDirtyComponents.clear();
|
|
2660
|
+
hmrDirtyComponentsMode.clear();
|
|
2661
|
+
});
|
|
2662
|
+
};
|
|
2663
|
+
queueJob(update);
|
|
2551
2664
|
});
|
|
2552
2665
|
}
|
|
2553
2666
|
queuePostFlushCb(() => {
|
|
@@ -2694,18 +2807,35 @@ function validateDirectiveName(name) {
|
|
|
2694
2807
|
if (isBuiltInDirective(name)) warn$1("Do not use built-in directive ids as custom directive id: " + name);
|
|
2695
2808
|
}
|
|
2696
2809
|
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
2697
|
-
|
|
2810
|
+
let hookVNode = vnode;
|
|
2811
|
+
if (name === "beforeMount") vnode._mount = vnode;
|
|
2812
|
+
else if (name === "beforeUpdate") {
|
|
2813
|
+
const mount = prevVNode && prevVNode._mount;
|
|
2814
|
+
if (mount) {
|
|
2815
|
+
mount._latest = vnode;
|
|
2816
|
+
vnode._mount = mount;
|
|
2817
|
+
}
|
|
2818
|
+
} else if (name === "mounted") {
|
|
2819
|
+
const latest = vnode._latest;
|
|
2820
|
+
vnode._mount = vnode._latest = void 0;
|
|
2821
|
+
if (latest) {
|
|
2822
|
+
hookVNode = latest;
|
|
2823
|
+
latest._mount = void 0;
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
const bindings = hookVNode.dirs;
|
|
2698
2827
|
const oldBindings = prevVNode && prevVNode.dirs;
|
|
2699
2828
|
for (let i = 0; i < bindings.length; i++) {
|
|
2700
|
-
|
|
2829
|
+
let binding = bindings[i];
|
|
2701
2830
|
if (oldBindings) binding.oldValue = oldBindings[i].value;
|
|
2831
|
+
else if (name === "mounted" && binding.oldValue !== void 0) binding = extend({}, binding, { oldValue: void 0 });
|
|
2702
2832
|
let hook = binding.dir[name];
|
|
2703
2833
|
if (hook) {
|
|
2704
2834
|
const prevSub = setActiveSub();
|
|
2705
2835
|
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
2706
2836
|
vnode.el,
|
|
2707
2837
|
binding,
|
|
2708
|
-
|
|
2838
|
+
hookVNode,
|
|
2709
2839
|
prevVNode
|
|
2710
2840
|
]);
|
|
2711
2841
|
setActiveSub(prevSub);
|
|
@@ -2886,9 +3016,14 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
2886
3016
|
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild(subTree) || subTree : subTree, hooks);
|
|
2887
3017
|
}
|
|
2888
3018
|
} else if (vnode.shapeFlag & 128) {
|
|
2889
|
-
const
|
|
2890
|
-
|
|
2891
|
-
|
|
3019
|
+
const suspense = vnode.suspense;
|
|
3020
|
+
if (suspense) {
|
|
3021
|
+
const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
|
|
3022
|
+
if (branch) return setTransitionHooks(branch, hooks.clone(branch));
|
|
3023
|
+
} else {
|
|
3024
|
+
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3025
|
+
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
3026
|
+
}
|
|
2892
3027
|
} else {
|
|
2893
3028
|
vnode.transition = hooks;
|
|
2894
3029
|
if (vnode.type === Fragment && isArray(vnode.children)) {
|
|
@@ -3060,9 +3195,8 @@ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance())
|
|
|
3060
3195
|
}
|
|
3061
3196
|
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
3062
3197
|
const injected = injectHook(type, hook, keepAliveRoot, true);
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
}, target);
|
|
3198
|
+
const removal = injectHook("um", () => remove(keepAliveRoot[type], injected), target);
|
|
3199
|
+
removal.flags = 8;
|
|
3066
3200
|
}
|
|
3067
3201
|
//#endregion
|
|
3068
3202
|
//#region packages/runtime-core/src/apiLifecycle.ts
|
|
@@ -3151,6 +3285,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
|
3151
3285
|
ret.props = extend({}, ret.props, { key: branchKey });
|
|
3152
3286
|
ret.key = branchKey;
|
|
3153
3287
|
}
|
|
3288
|
+
if (isBlockTreeEnabled <= 0) {
|
|
3289
|
+
if (!ret.vs.props) ret.vs.props = ret.props;
|
|
3290
|
+
ret.props = ret.key != null ? { key: ret.key } : null;
|
|
3291
|
+
ret.vs.attrs = EMPTY_OBJ;
|
|
3292
|
+
}
|
|
3154
3293
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
3155
3294
|
return ret;
|
|
3156
3295
|
}
|
|
@@ -4649,8 +4788,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4649
4788
|
def(el, "__vnode", vnode, true);
|
|
4650
4789
|
def(el, "__vueParentComponent", parentComponent, true);
|
|
4651
4790
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
4652
|
-
if (transition)
|
|
4653
|
-
|
|
4791
|
+
if (transition) {
|
|
4792
|
+
if (!needTransition(parentSuspense, transition) && !transition.persisted) el[deferredEnterKey] = true;
|
|
4793
|
+
performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
|
|
4794
|
+
} else hostInsert(el, container, anchor);
|
|
4654
4795
|
if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
|
|
4655
4796
|
const isHmr = isHmrUpdating;
|
|
4656
4797
|
queuePostRenderEffect(() => {
|
|
@@ -4907,16 +5048,20 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4907
5048
|
} else {
|
|
4908
5049
|
let { next, bu, u, parent, vnode } = instance;
|
|
4909
5050
|
{
|
|
4910
|
-
const
|
|
4911
|
-
if (
|
|
5051
|
+
const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
|
|
5052
|
+
if (unresolvedAsyncRoot) {
|
|
4912
5053
|
if (next) {
|
|
4913
5054
|
next.el = vnode.el;
|
|
4914
5055
|
updateComponentPreRender(instance, next, optimized);
|
|
4915
5056
|
}
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
if (
|
|
4919
|
-
|
|
5057
|
+
unresolvedAsyncRoot.asyncDep.then(() => {
|
|
5058
|
+
const retry = () => {
|
|
5059
|
+
if (instance.effect.flags & 1024) return;
|
|
5060
|
+
if (parentSuspense && parentSuspense.pendingBranch) queuePostRenderEffect(retry, void 0, parentSuspense);
|
|
5061
|
+
else instance.update();
|
|
5062
|
+
};
|
|
5063
|
+
retry.flags = 24;
|
|
5064
|
+
queuePostRenderEffect(retry, void 0, parentSuspense);
|
|
4920
5065
|
});
|
|
4921
5066
|
return;
|
|
4922
5067
|
}
|
|
@@ -4939,7 +5084,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4939
5084
|
const prevTree = instance.subTree;
|
|
4940
5085
|
instance.subTree = nextTree;
|
|
4941
5086
|
startMeasure(instance, `patch`);
|
|
4942
|
-
patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, namespace);
|
|
5087
|
+
patch(prevTree, nextTree, hostParentNode(prevTree.el || resolveAsyncComponentPlaceholder(prevTree)), getNextHostNode(prevTree), instance, parentSuspense, namespace);
|
|
4943
5088
|
endMeasure(instance, `patch`);
|
|
4944
5089
|
next.el = nextTree.el;
|
|
4945
5090
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
@@ -5142,9 +5287,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5142
5287
|
}
|
|
5143
5288
|
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
5144
5289
|
if (shapeFlag & 256) {
|
|
5145
|
-
if (
|
|
5146
|
-
else parentComponent.ctx.deactivate(vnode);
|
|
5147
|
-
return;
|
|
5290
|
+
if (parentComponent.ctx.deactivate(vnode)) return;
|
|
5148
5291
|
}
|
|
5149
5292
|
if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
|
|
5150
5293
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
@@ -5224,12 +5367,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5224
5367
|
if (effect) {
|
|
5225
5368
|
effect.stop();
|
|
5226
5369
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5227
|
-
} else if (
|
|
5370
|
+
} else if (subTree) {
|
|
5228
5371
|
subTree.transition = instance.vnode.transition;
|
|
5229
5372
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5230
5373
|
}
|
|
5231
5374
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
5232
|
-
|
|
5375
|
+
const markUnmounted = () => instance.isUnmounted = true;
|
|
5376
|
+
markUnmounted.flags = 8;
|
|
5377
|
+
queuePostRenderEffect(markUnmounted, void 0, parentSuspense);
|
|
5233
5378
|
devtoolsComponentRemoved(instance);
|
|
5234
5379
|
};
|
|
5235
5380
|
const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
|
|
@@ -5343,11 +5488,11 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
5343
5488
|
c2.el && (c2.el.__vnode = c2);
|
|
5344
5489
|
}
|
|
5345
5490
|
}
|
|
5346
|
-
function
|
|
5491
|
+
function locateUnresolvedAsyncRoot(instance) {
|
|
5347
5492
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
5348
5493
|
if (subComponent) {
|
|
5349
5494
|
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
5350
|
-
else return
|
|
5495
|
+
else return locateUnresolvedAsyncRoot(subComponent);
|
|
5351
5496
|
}
|
|
5352
5497
|
}
|
|
5353
5498
|
function invalidateMount(hooks) {
|
|
@@ -5417,12 +5562,15 @@ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true
|
|
|
5417
5562
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
5418
5563
|
if (anchorVnode.placeholder) return anchorVnode.placeholder;
|
|
5419
5564
|
const instance = anchorVnode.component;
|
|
5420
|
-
if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
5565
|
+
if (instance && instance.subTree) return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
5566
|
+
const suspense = anchorVnode.suspense;
|
|
5567
|
+
if (suspense && suspense.activeBranch) return resolveAsyncComponentPlaceholder(suspense.activeBranch);
|
|
5421
5568
|
return null;
|
|
5422
5569
|
}
|
|
5423
5570
|
//#endregion
|
|
5424
5571
|
//#region packages/runtime-core/src/components/Suspense.ts
|
|
5425
5572
|
const isSuspense = (type) => type.__isSuspense;
|
|
5573
|
+
const deferredEnterKey = Symbol("_deferredEnter");
|
|
5426
5574
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
5427
5575
|
if (suspense && suspense.pendingBranch) {
|
|
5428
5576
|
if (isArray(fn)) suspense.effects.push(...fn);
|
|
@@ -5613,7 +5761,8 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
5613
5761
|
}
|
|
5614
5762
|
function guardReactiveProps(props) {
|
|
5615
5763
|
if (!props) return null;
|
|
5616
|
-
|
|
5764
|
+
if (/* @__PURE__ */ isProxy(props)) return extend({}, props);
|
|
5765
|
+
return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
|
|
5617
5766
|
}
|
|
5618
5767
|
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
|
|
5619
5768
|
const { props, ref, patchFlag, children, transition } = vnode;
|
|
@@ -5712,6 +5861,17 @@ function normalizeVNode$1(child) {
|
|
|
5712
5861
|
function cloneIfMounted(child) {
|
|
5713
5862
|
return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
|
|
5714
5863
|
}
|
|
5864
|
+
let deferElementSlots = false;
|
|
5865
|
+
/**
|
|
5866
|
+
* While enabled, compiled default slots passed as children of plain elements
|
|
5867
|
+
* are kept on the vnode so the server renderer can render them in push mode.
|
|
5868
|
+
* @internal
|
|
5869
|
+
*/
|
|
5870
|
+
function setDeferElementSlots$1(value) {
|
|
5871
|
+
const prev = deferElementSlots;
|
|
5872
|
+
deferElementSlots = value;
|
|
5873
|
+
return prev;
|
|
5874
|
+
}
|
|
5715
5875
|
function normalizeChildren(vnode, children) {
|
|
5716
5876
|
let type = 0;
|
|
5717
5877
|
const { shapeFlag } = vnode;
|
|
@@ -5720,6 +5880,11 @@ function normalizeChildren(vnode, children) {
|
|
|
5720
5880
|
else if (typeof children === "object") {
|
|
5721
5881
|
if (shapeFlag & 65) {
|
|
5722
5882
|
const slot = children.default;
|
|
5883
|
+
if (deferElementSlots && slot && slot._c && shapeFlag & 1) {
|
|
5884
|
+
vnode.children = children;
|
|
5885
|
+
vnode.shapeFlag |= 32;
|
|
5886
|
+
return;
|
|
5887
|
+
}
|
|
5723
5888
|
if (slot) {
|
|
5724
5889
|
slot._c && (slot._d = false);
|
|
5725
5890
|
normalizeChildren(vnode, slot());
|
|
@@ -5965,7 +6130,8 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
5965
6130
|
setInSSRSetupState(false);
|
|
5966
6131
|
}
|
|
5967
6132
|
}).catch((e) => {
|
|
5968
|
-
handleError(e, instance, 0);
|
|
6133
|
+
handleError(e, instance, 0, void 0, true);
|
|
6134
|
+
instance.ssrRender = (_, push) => push("<!---->");
|
|
5969
6135
|
});
|
|
5970
6136
|
else {
|
|
5971
6137
|
instance.asyncDep = setupResult;
|
|
@@ -6007,11 +6173,16 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
6007
6173
|
else warn$1(`Component is missing template or render function: `, Component);
|
|
6008
6174
|
}
|
|
6009
6175
|
}
|
|
6176
|
+
/**
|
|
6177
|
+
* Read through the setup context `attrs` proxy to get the raw attrs object.
|
|
6178
|
+
* @internal
|
|
6179
|
+
*/
|
|
6180
|
+
const rawAttrsKey = Symbol();
|
|
6010
6181
|
const attrsProxyHandlers = {
|
|
6011
6182
|
get(target, key) {
|
|
6012
6183
|
markAttrsAccessed();
|
|
6013
6184
|
track(target, "get", "");
|
|
6014
|
-
return target[key];
|
|
6185
|
+
return key === rawAttrsKey ? target : target[key];
|
|
6015
6186
|
},
|
|
6016
6187
|
set() {
|
|
6017
6188
|
warn$1(`setupContext.attrs is readonly.`);
|
|
@@ -6108,7 +6279,7 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
6108
6279
|
};
|
|
6109
6280
|
//#endregion
|
|
6110
6281
|
//#region packages/runtime-core/src/index.ts
|
|
6111
|
-
const version = "3.6.0-rc.
|
|
6282
|
+
const version = "3.6.0-rc.15";
|
|
6112
6283
|
const warn = warn$1;
|
|
6113
6284
|
/**
|
|
6114
6285
|
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
@@ -6127,7 +6298,8 @@ const ssrUtils = {
|
|
|
6127
6298
|
popWarningContext: popWarningContext$1,
|
|
6128
6299
|
VaporSlot: VaporSlot$1,
|
|
6129
6300
|
rawVaporSlotKey: rawVaporSlotKey$2,
|
|
6130
|
-
invokeSlotFallback: invokeSlotFallback$1
|
|
6301
|
+
invokeSlotFallback: invokeSlotFallback$1,
|
|
6302
|
+
setDeferElementSlots: setDeferElementSlots$1
|
|
6131
6303
|
};
|
|
6132
6304
|
//#endregion
|
|
6133
6305
|
//#region packages/runtime-dom/src/nodeOps.ts
|
|
@@ -6620,15 +6792,15 @@ const vModelSelect = {
|
|
|
6620
6792
|
vModelSelectInit(el, value, number);
|
|
6621
6793
|
el[assignKey] = getModelAssigner(vnode);
|
|
6622
6794
|
},
|
|
6623
|
-
mounted(el, { value }) {
|
|
6624
|
-
vModelSetSelected(el, value);
|
|
6795
|
+
mounted(el, { value, modifiers: { number } }) {
|
|
6796
|
+
vModelSetSelected(el, value, number);
|
|
6625
6797
|
},
|
|
6626
6798
|
beforeUpdate(el, { value }, vnode) {
|
|
6627
6799
|
el._modelValue = value;
|
|
6628
6800
|
el[assignKey] = getModelAssigner(vnode);
|
|
6629
6801
|
},
|
|
6630
|
-
updated(el, { value }) {
|
|
6631
|
-
vModelSetSelected(el, value);
|
|
6802
|
+
updated(el, { value, modifiers: { number } }) {
|
|
6803
|
+
vModelSetSelected(el, value, number);
|
|
6632
6804
|
}
|
|
6633
6805
|
};
|
|
6634
6806
|
/**
|
|
@@ -6663,14 +6835,14 @@ function isSameSelectValue(value, assignedValue, multiple) {
|
|
|
6663
6835
|
/**
|
|
6664
6836
|
* @internal
|
|
6665
6837
|
*/
|
|
6666
|
-
const vModelSetSelected = (el, value) => {
|
|
6838
|
+
const vModelSetSelected = (el, value, number = false) => {
|
|
6667
6839
|
el._modelValue = value;
|
|
6668
6840
|
const pending = el._pendingValue;
|
|
6669
6841
|
el._pendingValue = void 0;
|
|
6670
6842
|
if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
|
|
6671
|
-
setSelected(el, value);
|
|
6843
|
+
setSelected(el, value, number);
|
|
6672
6844
|
};
|
|
6673
|
-
function setSelected(el, value) {
|
|
6845
|
+
function setSelected(el, value, number) {
|
|
6674
6846
|
const isMultiple = el.multiple;
|
|
6675
6847
|
const isArrayValue = isArray(value);
|
|
6676
6848
|
if (isMultiple && !isArrayValue && !isSet(value)) {
|
|
@@ -6685,7 +6857,7 @@ function setSelected(el, value) {
|
|
|
6685
6857
|
const optionType = typeof optionValue;
|
|
6686
6858
|
if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
|
|
6687
6859
|
else option.selected = looseIndexOf(value, optionValue) > -1;
|
|
6688
|
-
} else option.selected = value.has(optionValue);
|
|
6860
|
+
} else option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
|
|
6689
6861
|
} else if (looseEqual(getValue(option), value)) {
|
|
6690
6862
|
if (el.selectedIndex !== i) el.selectedIndex = i;
|
|
6691
6863
|
return;
|
|
@@ -7072,7 +7244,15 @@ function ssrCompile(template, instance) {
|
|
|
7072
7244
|
}
|
|
7073
7245
|
//#endregion
|
|
7074
7246
|
//#region packages/server-renderer/src/render.ts
|
|
7075
|
-
const { createComponentInstance, setCurrentRenderingInstance, setupComponent, renderComponentRoot, isVNode: isVNode$2, normalizeVNode, pushWarningContext, popWarningContext, VaporSlot, rawVaporSlotKey, invokeSlotFallback } = ssrUtils;
|
|
7247
|
+
const { createComponentInstance, setCurrentRenderingInstance, setupComponent, renderComponentRoot, isVNode: isVNode$2, normalizeVNode, pushWarningContext, popWarningContext, VaporSlot, rawVaporSlotKey, invokeSlotFallback, setDeferElementSlots } = ssrUtils;
|
|
7248
|
+
function renderRoot(instance) {
|
|
7249
|
+
const prev = setDeferElementSlots(true);
|
|
7250
|
+
try {
|
|
7251
|
+
return renderComponentRoot(instance);
|
|
7252
|
+
} finally {
|
|
7253
|
+
setDeferElementSlots(prev);
|
|
7254
|
+
}
|
|
7255
|
+
}
|
|
7076
7256
|
function cleanupContext(context) {
|
|
7077
7257
|
let firstError;
|
|
7078
7258
|
if (context.__watcherHandles) {
|
|
@@ -7186,7 +7366,7 @@ function renderComponentSubTree(instance, slotScopeId) {
|
|
|
7186
7366
|
const comp = instance.type;
|
|
7187
7367
|
const { getBuffer, push } = createBuffer();
|
|
7188
7368
|
if (isFunction(comp)) {
|
|
7189
|
-
let root =
|
|
7369
|
+
let root = renderRoot(instance);
|
|
7190
7370
|
if (!comp.props) {
|
|
7191
7371
|
for (const key in instance.attrs) if (key.startsWith(`data-v-`)) (root.props || (root.props = {}))[key] = ``;
|
|
7192
7372
|
}
|
|
@@ -7224,7 +7404,7 @@ function renderComponentSubTree(instance, slotScopeId) {
|
|
|
7224
7404
|
} finally {
|
|
7225
7405
|
setCurrentRenderingInstance(prev);
|
|
7226
7406
|
}
|
|
7227
|
-
} else if (instance.render && instance.render !== NOOP) renderVNode(push, instance.subTree =
|
|
7407
|
+
} else if (instance.render && instance.render !== NOOP) renderVNode(push, instance.subTree = renderRoot(instance), instance, slotScopeId);
|
|
7228
7408
|
else {
|
|
7229
7409
|
const componentName = comp.name || comp.__file || `<Anonymous>`;
|
|
7230
7410
|
warn(`Component ${componentName} is missing template or render function.`);
|
|
@@ -7330,10 +7510,21 @@ function renderElementVNode(push, vnode, parentComponent, slotScopeId, renderChi
|
|
|
7330
7510
|
if (renderChildren) renderChildren();
|
|
7331
7511
|
else if (shapeFlag & 8) push(escapeHtml(children));
|
|
7332
7512
|
else if (shapeFlag & 16) renderVNodeChildren(push, children, parentComponent, slotScopeId);
|
|
7513
|
+
else if (shapeFlag & 32) renderElementSlot(push, children.default, parentComponent, slotScopeId);
|
|
7333
7514
|
}
|
|
7334
7515
|
push(`</${tag}>`);
|
|
7335
7516
|
}
|
|
7336
7517
|
}
|
|
7518
|
+
function renderElementSlot(push, slot, parentComponent, slotScopeId) {
|
|
7519
|
+
let ret;
|
|
7520
|
+
try {
|
|
7521
|
+
ret = slot(void 0, push, parentComponent, slotScopeId ? " " + slotScopeId.trim() : "");
|
|
7522
|
+
} catch (err) {
|
|
7523
|
+
handleError(err, parentComponent, 1);
|
|
7524
|
+
}
|
|
7525
|
+
if (isArray(ret)) renderVNodeChildren(push, ret, parentComponent, slotScopeId);
|
|
7526
|
+
else if (ret != null) renderVNode(push, normalizeVNode(ret), parentComponent, slotScopeId);
|
|
7527
|
+
}
|
|
7337
7528
|
function applySSRDirectives(vnode, rawProps, dirs) {
|
|
7338
7529
|
const toMerge = [];
|
|
7339
7530
|
for (let i = 0; i < dirs.length; i++) {
|