@vue/compat 3.6.0-beta.8 → 3.6.0-rc.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/README.md +2 -2
- package/dist/vue-compat.d.ts +32 -18
- package/dist/vue.cjs.js +505 -229
- package/dist/vue.cjs.prod.js +414 -178
- package/dist/vue.esm-browser.js +476 -221
- package/dist/vue.esm-browser.prod.js +6 -6
- package/dist/vue.esm-bundler.js +489 -225
- package/dist/vue.global.js +476 -221
- package/dist/vue.global.prod.js +6 -6
- package/dist/vue.runtime.esm-browser.js +476 -221
- package/dist/vue.runtime.esm-browser.prod.js +6 -6
- package/dist/vue.runtime.esm-bundler.js +489 -225
- package/dist/vue.runtime.global.js +476 -221
- package/dist/vue.runtime.global.prod.js +6 -6
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-
|
|
2
|
+
* @vue/compat v3.6.0-rc.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -521,6 +521,13 @@ function warn$2(msg, ...args) {
|
|
|
521
521
|
const notifyBuffer = [];
|
|
522
522
|
let batchDepth = 0;
|
|
523
523
|
let activeSub = void 0;
|
|
524
|
+
let runDepth = 0;
|
|
525
|
+
function incRunDepth() {
|
|
526
|
+
++runDepth;
|
|
527
|
+
}
|
|
528
|
+
function decRunDepth() {
|
|
529
|
+
--runDepth;
|
|
530
|
+
}
|
|
524
531
|
let globalVersion = 0;
|
|
525
532
|
let notifyIndex = 0;
|
|
526
533
|
let notifyBufferLength = 0;
|
|
@@ -594,8 +601,10 @@ function propagate(link) {
|
|
|
594
601
|
const sub = link.sub;
|
|
595
602
|
let flags = sub.flags;
|
|
596
603
|
if (flags & 3) {
|
|
597
|
-
if (!(flags & 60))
|
|
598
|
-
|
|
604
|
+
if (!(flags & 60)) {
|
|
605
|
+
sub.flags = flags | 32;
|
|
606
|
+
if (runDepth) sub.flags |= 8;
|
|
607
|
+
} else if (!(flags & 12)) flags = 0;
|
|
599
608
|
else if (!(flags & 4)) sub.flags = flags & -9 | 32;
|
|
600
609
|
else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
601
610
|
sub.flags = flags | 40;
|
|
@@ -664,13 +673,13 @@ function checkDirty(link, sub) {
|
|
|
664
673
|
let dirty = false;
|
|
665
674
|
if (sub.flags & 16) dirty = true;
|
|
666
675
|
else if ((depFlags & 17) === 17) {
|
|
676
|
+
const subs = dep.subs;
|
|
667
677
|
if (dep.update()) {
|
|
668
|
-
const subs = dep.subs;
|
|
669
678
|
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
670
679
|
dirty = true;
|
|
671
680
|
}
|
|
672
681
|
} else if ((depFlags & 33) === 33) {
|
|
673
|
-
|
|
682
|
+
stack = {
|
|
674
683
|
value: link,
|
|
675
684
|
prev: stack
|
|
676
685
|
};
|
|
@@ -685,15 +694,12 @@ function checkDirty(link, sub) {
|
|
|
685
694
|
}
|
|
686
695
|
while (checkDepth) {
|
|
687
696
|
--checkDepth;
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
if (hasMultipleSubs) {
|
|
691
|
-
link = stack.value;
|
|
692
|
-
stack = stack.prev;
|
|
693
|
-
} else link = firstSub;
|
|
697
|
+
link = stack.value;
|
|
698
|
+
stack = stack.prev;
|
|
694
699
|
if (dirty) {
|
|
700
|
+
const subs = sub.subs;
|
|
695
701
|
if (sub.update()) {
|
|
696
|
-
if (
|
|
702
|
+
if (subs.nextSub !== void 0) shallowPropagate(subs);
|
|
697
703
|
sub = link.sub;
|
|
698
704
|
continue;
|
|
699
705
|
}
|
|
@@ -705,7 +711,7 @@ function checkDirty(link, sub) {
|
|
|
705
711
|
}
|
|
706
712
|
dirty = false;
|
|
707
713
|
}
|
|
708
|
-
return dirty;
|
|
714
|
+
return dirty && !!sub.flags;
|
|
709
715
|
} while (true);
|
|
710
716
|
}
|
|
711
717
|
function shallowPropagate(link) {
|
|
@@ -1088,7 +1094,7 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
|
|
|
1088
1094
|
}
|
|
1089
1095
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
1090
1096
|
const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
|
|
1091
|
-
if (target === /* @__PURE__ */ toRaw(receiver)) {
|
|
1097
|
+
if (target === /* @__PURE__ */ toRaw(receiver) && result) {
|
|
1092
1098
|
if (!hadKey) trigger(target, "add", key, value);
|
|
1093
1099
|
else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
|
|
1094
1100
|
}
|
|
@@ -1306,9 +1312,6 @@ function targetTypeMap(rawType) {
|
|
|
1306
1312
|
default: return 0;
|
|
1307
1313
|
}
|
|
1308
1314
|
}
|
|
1309
|
-
function getTargetType(value) {
|
|
1310
|
-
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
1311
|
-
}
|
|
1312
1315
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1313
1316
|
function reactive(target) {
|
|
1314
1317
|
if (/* @__PURE__ */ isReadonly(target)) return target;
|
|
@@ -1421,10 +1424,11 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
|
|
|
1421
1424
|
return target;
|
|
1422
1425
|
}
|
|
1423
1426
|
if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
|
|
1424
|
-
|
|
1425
|
-
if (targetType === 0) return target;
|
|
1427
|
+
if (target["__v_skip"] || !Object.isExtensible(target)) return target;
|
|
1426
1428
|
const existingProxy = proxyMap.get(target);
|
|
1427
1429
|
if (existingProxy) return existingProxy;
|
|
1430
|
+
const targetType = targetTypeMap(toRawType(target));
|
|
1431
|
+
if (targetType === 0) return target;
|
|
1428
1432
|
const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
|
|
1429
1433
|
proxyMap.set(target, proxy);
|
|
1430
1434
|
return proxy;
|
|
@@ -1772,16 +1776,16 @@ function toRefs(object) {
|
|
|
1772
1776
|
return ret;
|
|
1773
1777
|
}
|
|
1774
1778
|
var ObjectRefImpl = class {
|
|
1775
|
-
constructor(_object,
|
|
1779
|
+
constructor(_object, key, _defaultValue) {
|
|
1776
1780
|
this._object = _object;
|
|
1777
|
-
this._key = _key;
|
|
1778
1781
|
this._defaultValue = _defaultValue;
|
|
1779
1782
|
this["__v_isRef"] = true;
|
|
1780
1783
|
this._value = void 0;
|
|
1784
|
+
this._key = isSymbol(key) ? key : String(key);
|
|
1781
1785
|
this._raw = /* @__PURE__ */ toRaw(_object);
|
|
1782
1786
|
let shallow = true;
|
|
1783
1787
|
let obj = _object;
|
|
1784
|
-
if (!isArray(_object) || !isIntegerKey(
|
|
1788
|
+
if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) do
|
|
1785
1789
|
shallow = !/* @__PURE__ */ isProxy(obj) || /* @__PURE__ */ isShallow(obj);
|
|
1786
1790
|
while (shallow && (obj = obj["__v_raw"]));
|
|
1787
1791
|
this._shallow = shallow;
|
|
@@ -1857,9 +1861,11 @@ var ReactiveEffect = class {
|
|
|
1857
1861
|
if (!this.active) return this.fn();
|
|
1858
1862
|
cleanup(this);
|
|
1859
1863
|
const prevSub = startTracking(this);
|
|
1864
|
+
incRunDepth();
|
|
1860
1865
|
try {
|
|
1861
1866
|
return this.fn();
|
|
1862
1867
|
} finally {
|
|
1868
|
+
decRunDepth();
|
|
1863
1869
|
endTracking(this, prevSub);
|
|
1864
1870
|
const flags = this.flags;
|
|
1865
1871
|
if ((flags & 136) === 136) {
|
|
@@ -2240,8 +2246,9 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2240
2246
|
if (once && cb) {
|
|
2241
2247
|
const _cb = cb;
|
|
2242
2248
|
cb = (...args) => {
|
|
2243
|
-
_cb(...args);
|
|
2249
|
+
const res = _cb(...args);
|
|
2244
2250
|
this.stop();
|
|
2251
|
+
return res;
|
|
2245
2252
|
};
|
|
2246
2253
|
}
|
|
2247
2254
|
this.cb = cb;
|
|
@@ -2255,7 +2262,7 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2255
2262
|
if (!this.cb) return;
|
|
2256
2263
|
const { immediate, deep, call } = this.options;
|
|
2257
2264
|
if (initialRun && !immediate) return;
|
|
2258
|
-
if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2265
|
+
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2259
2266
|
cleanup(this);
|
|
2260
2267
|
const currentWatcher = activeWatcher;
|
|
2261
2268
|
activeWatcher = this;
|
|
@@ -2562,8 +2569,8 @@ function findInsertionIndex(order, queue, start, end) {
|
|
|
2562
2569
|
/**
|
|
2563
2570
|
* @internal for runtime-vapor only
|
|
2564
2571
|
*/
|
|
2565
|
-
function queueJob(job, id, isPre = false) {
|
|
2566
|
-
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2572
|
+
function queueJob(job, id, isPre = false, order = 0) {
|
|
2573
|
+
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : order ? id * 2 + 1 + order / (order + 1) : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
2567
2574
|
jobsLength++;
|
|
2568
2575
|
queueFlush();
|
|
2569
2576
|
}
|
|
@@ -2672,6 +2679,7 @@ function flushJobs(seen) {
|
|
|
2672
2679
|
}
|
|
2673
2680
|
flushIndex = 0;
|
|
2674
2681
|
jobsLength = 0;
|
|
2682
|
+
jobs.length = 0;
|
|
2675
2683
|
flushPostFlushCbs(seen);
|
|
2676
2684
|
currentFlushPromise = null;
|
|
2677
2685
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -2691,6 +2699,13 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
2691
2699
|
//#endregion
|
|
2692
2700
|
//#region packages/runtime-core/src/hmr.ts
|
|
2693
2701
|
let isHmrUpdating = false;
|
|
2702
|
+
const setHmrUpdating = (v) => {
|
|
2703
|
+
try {
|
|
2704
|
+
return isHmrUpdating;
|
|
2705
|
+
} finally {
|
|
2706
|
+
isHmrUpdating = v;
|
|
2707
|
+
}
|
|
2708
|
+
};
|
|
2694
2709
|
const hmrDirtyComponents = /* @__PURE__ */ new Map();
|
|
2695
2710
|
const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
|
|
2696
2711
|
getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
@@ -2722,6 +2737,14 @@ function createRecord(id, initialDef) {
|
|
|
2722
2737
|
function normalizeClassComponent(component) {
|
|
2723
2738
|
return isClassComponent(component) ? component.__vccOpts : component;
|
|
2724
2739
|
}
|
|
2740
|
+
function hasDirtyAncestor(instance, dirtyInstances) {
|
|
2741
|
+
let parent = instance.parent;
|
|
2742
|
+
while (parent) {
|
|
2743
|
+
if (dirtyInstances.has(parent)) return true;
|
|
2744
|
+
parent = parent.parent;
|
|
2745
|
+
}
|
|
2746
|
+
return false;
|
|
2747
|
+
}
|
|
2725
2748
|
function rerender(id, newRender) {
|
|
2726
2749
|
const record = map.get(id);
|
|
2727
2750
|
if (!record) return;
|
|
@@ -2753,42 +2776,69 @@ function reload(id, newComp) {
|
|
|
2753
2776
|
const isVapor = record.initialDef.__vapor;
|
|
2754
2777
|
updateComponentDef(record.initialDef, newComp);
|
|
2755
2778
|
const instances = [...record.instances];
|
|
2756
|
-
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2779
|
+
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2757
2780
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
const
|
|
2761
|
-
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2762
|
-
if (!dirtyInstances) {
|
|
2763
|
-
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2764
|
-
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2765
|
-
}
|
|
2766
|
-
dirtyInstances.add(instance);
|
|
2767
|
-
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2768
|
-
instance.appContext.propsCache.delete(instance.type);
|
|
2769
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
2770
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
2771
|
-
if (instance.ceReload) {
|
|
2772
|
-
dirtyInstances.add(instance);
|
|
2773
|
-
instance.ceReload(newComp.styles);
|
|
2774
|
-
dirtyInstances.delete(instance);
|
|
2775
|
-
} else if (instance.parent) queueJob(() => {
|
|
2776
|
-
isHmrUpdating = true;
|
|
2781
|
+
const dirtyInstances = new Set(instances);
|
|
2782
|
+
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2783
|
+
for (const instance of instances) {
|
|
2777
2784
|
const parent = instance.parent;
|
|
2778
|
-
if (parent
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2785
|
+
if (parent) {
|
|
2786
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
2787
|
+
rerenderedParents.add(parent);
|
|
2788
|
+
parent.hmrRerender();
|
|
2789
|
+
}
|
|
2790
|
+
} else instance.hmrReload(newComp);
|
|
2791
|
+
}
|
|
2792
|
+
} else {
|
|
2793
|
+
const parentUpdates = /* @__PURE__ */ new Map();
|
|
2794
|
+
const dirtyInstanceSet = new Set(instances);
|
|
2795
|
+
for (const instance of instances) {
|
|
2796
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2797
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2798
|
+
if (!dirtyInstances) {
|
|
2799
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2800
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2782
2801
|
}
|
|
2783
|
-
|
|
2784
|
-
|
|
2802
|
+
dirtyInstances.add(instance);
|
|
2803
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2804
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
2805
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
2806
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
2807
|
+
if (instance.ceReload) {
|
|
2808
|
+
dirtyInstances.add(instance);
|
|
2809
|
+
instance.ceReload(newComp.styles);
|
|
2810
|
+
dirtyInstances.delete(instance);
|
|
2811
|
+
} else if (instance.parent) {
|
|
2812
|
+
const parent = instance.parent;
|
|
2813
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
2814
|
+
let updates = parentUpdates.get(parent);
|
|
2815
|
+
if (!updates) parentUpdates.set(parent, updates = []);
|
|
2816
|
+
updates.push([instance, dirtyInstances]);
|
|
2817
|
+
}
|
|
2818
|
+
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
2819
|
+
else if (typeof window !== "undefined") window.location.reload();
|
|
2820
|
+
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2821
|
+
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2822
|
+
}
|
|
2823
|
+
parentUpdates.forEach((updates, parent) => {
|
|
2824
|
+
queueJob(() => {
|
|
2825
|
+
isHmrUpdating = true;
|
|
2826
|
+
if (parent.vapor) parent.hmrRerender();
|
|
2827
|
+
else {
|
|
2828
|
+
const i = parent;
|
|
2829
|
+
if (!(i.effect.flags & 1024)) {
|
|
2830
|
+
i.renderCache = [];
|
|
2831
|
+
i.effect.run();
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
nextTick(() => {
|
|
2835
|
+
isHmrUpdating = false;
|
|
2836
|
+
});
|
|
2837
|
+
updates.forEach(([instance, dirtyInstances]) => {
|
|
2838
|
+
dirtyInstances.delete(instance);
|
|
2839
|
+
});
|
|
2785
2840
|
});
|
|
2786
|
-
dirtyInstances.delete(instance);
|
|
2787
2841
|
});
|
|
2788
|
-
else if (instance.appContext.reload) instance.appContext.reload();
|
|
2789
|
-
else if (typeof window !== "undefined") window.location.reload();
|
|
2790
|
-
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2791
|
-
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2792
2842
|
}
|
|
2793
2843
|
queuePostFlushCb(() => {
|
|
2794
2844
|
hmrDirtyComponents.clear();
|
|
@@ -3255,10 +3305,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
3255
3305
|
const renderFnWithContext = (...args) => {
|
|
3256
3306
|
if (renderFnWithContext._d) setBlockTracking(-1);
|
|
3257
3307
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
3308
|
+
const prevStackSize = blockStack.length;
|
|
3258
3309
|
let res;
|
|
3259
3310
|
try {
|
|
3260
3311
|
res = fn(...args);
|
|
3261
3312
|
} finally {
|
|
3313
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
3262
3314
|
setCurrentRenderingInstance(prevInstance);
|
|
3263
3315
|
if (renderFnWithContext._d) setBlockTracking(1);
|
|
3264
3316
|
}
|
|
@@ -3473,6 +3525,7 @@ function createPathGetter(ctx, path) {
|
|
|
3473
3525
|
}
|
|
3474
3526
|
//#endregion
|
|
3475
3527
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
3528
|
+
const pendingMounts = /* @__PURE__ */ new WeakMap();
|
|
3476
3529
|
const TeleportEndKey = Symbol("_vte");
|
|
3477
3530
|
const isTeleport = (type) => type.__isTeleport;
|
|
3478
3531
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
@@ -3498,55 +3551,68 @@ const TeleportImpl = {
|
|
|
3498
3551
|
name: "Teleport",
|
|
3499
3552
|
__isTeleport: true,
|
|
3500
3553
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
3501
|
-
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
|
|
3554
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
3502
3555
|
const disabled = isTeleportDisabled(n2.props);
|
|
3503
|
-
let {
|
|
3556
|
+
let { dynamicChildren } = n2;
|
|
3504
3557
|
if (isHmrUpdating) {
|
|
3505
3558
|
optimized = false;
|
|
3506
3559
|
dynamicChildren = null;
|
|
3507
3560
|
}
|
|
3561
|
+
const mount = (vnode, container, anchor) => {
|
|
3562
|
+
if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3563
|
+
};
|
|
3564
|
+
const mountToTarget = (vnode = n2) => {
|
|
3565
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
3566
|
+
const target = vnode.target = resolveTarget(vnode.props, querySelector);
|
|
3567
|
+
const targetAnchor = prepareAnchor(target, vnode, createText, insert);
|
|
3568
|
+
if (target) {
|
|
3569
|
+
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3570
|
+
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3571
|
+
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3572
|
+
if (!disabled) {
|
|
3573
|
+
mount(vnode, target, targetAnchor);
|
|
3574
|
+
updateCssVars(vnode, false);
|
|
3575
|
+
}
|
|
3576
|
+
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3577
|
+
};
|
|
3578
|
+
const queuePendingMount = (vnode) => {
|
|
3579
|
+
const mountJob = () => {
|
|
3580
|
+
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
3581
|
+
pendingMounts.delete(vnode);
|
|
3582
|
+
if (isTeleportDisabled(vnode.props)) {
|
|
3583
|
+
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
|
|
3584
|
+
updateCssVars(vnode, true);
|
|
3585
|
+
}
|
|
3586
|
+
mountToTarget(vnode);
|
|
3587
|
+
};
|
|
3588
|
+
pendingMounts.set(vnode, mountJob);
|
|
3589
|
+
queuePostRenderEffect(mountJob, void 0, parentSuspense);
|
|
3590
|
+
};
|
|
3508
3591
|
if (n1 == null) {
|
|
3509
3592
|
const placeholder = n2.el = createComment("teleport start");
|
|
3510
3593
|
const mainAnchor = n2.anchor = createComment("teleport end");
|
|
3511
3594
|
insert(placeholder, container, anchor);
|
|
3512
3595
|
insert(mainAnchor, container, anchor);
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
3518
|
-
const targetAnchor = prepareAnchor(target, n2, createText, insert);
|
|
3519
|
-
if (target) {
|
|
3520
|
-
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
3521
|
-
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
3522
|
-
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3523
|
-
if (!disabled) {
|
|
3524
|
-
mount(target, targetAnchor);
|
|
3525
|
-
updateCssVars(n2, false);
|
|
3526
|
-
}
|
|
3527
|
-
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3528
|
-
};
|
|
3596
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
3597
|
+
queuePendingMount(n2);
|
|
3598
|
+
return;
|
|
3599
|
+
}
|
|
3529
3600
|
if (disabled) {
|
|
3530
|
-
mount(container, mainAnchor);
|
|
3601
|
+
mount(n2, container, mainAnchor);
|
|
3531
3602
|
updateCssVars(n2, true);
|
|
3532
3603
|
}
|
|
3533
|
-
|
|
3534
|
-
n2.el.__isMounted = false;
|
|
3535
|
-
queuePostRenderEffect(() => {
|
|
3536
|
-
mountToTarget();
|
|
3537
|
-
delete n2.el.__isMounted;
|
|
3538
|
-
}, void 0, parentSuspense);
|
|
3539
|
-
} else mountToTarget();
|
|
3604
|
+
mountToTarget();
|
|
3540
3605
|
} else {
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3606
|
+
n2.el = n1.el;
|
|
3607
|
+
const mainAnchor = n2.anchor = n1.anchor;
|
|
3608
|
+
const pendingMount = pendingMounts.get(n1);
|
|
3609
|
+
if (pendingMount) {
|
|
3610
|
+
pendingMount.flags |= 4;
|
|
3611
|
+
pendingMounts.delete(n1);
|
|
3612
|
+
queuePendingMount(n2);
|
|
3545
3613
|
return;
|
|
3546
3614
|
}
|
|
3547
|
-
n2.el = n1.el;
|
|
3548
3615
|
n2.targetStart = n1.targetStart;
|
|
3549
|
-
const mainAnchor = n2.anchor = n1.anchor;
|
|
3550
3616
|
const target = n2.target = n1.target;
|
|
3551
3617
|
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
3552
3618
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
@@ -3562,26 +3628,30 @@ const TeleportImpl = {
|
|
|
3562
3628
|
if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
|
|
3563
3629
|
else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
|
|
3564
3630
|
} else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
3565
|
-
const nextTarget =
|
|
3566
|
-
if (nextTarget)
|
|
3567
|
-
|
|
3631
|
+
const nextTarget = resolveTarget(n2.props, querySelector);
|
|
3632
|
+
if (nextTarget) {
|
|
3633
|
+
n2.target = nextTarget;
|
|
3634
|
+
moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
|
|
3635
|
+
} else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
|
|
3568
3636
|
} else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
|
|
3569
3637
|
updateCssVars(n2, disabled);
|
|
3570
3638
|
}
|
|
3571
3639
|
},
|
|
3572
3640
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
3573
3641
|
const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3642
|
+
const disabled = isTeleportDisabled(props);
|
|
3643
|
+
const shouldRemove = doRemove || !disabled;
|
|
3644
|
+
const pendingMount = pendingMounts.get(vnode);
|
|
3645
|
+
if (pendingMount) {
|
|
3646
|
+
pendingMount.flags |= 4;
|
|
3647
|
+
pendingMounts.delete(vnode);
|
|
3648
|
+
}
|
|
3649
|
+
if (targetStart) hostRemove(targetStart);
|
|
3650
|
+
if (targetAnchor) hostRemove(targetAnchor);
|
|
3578
3651
|
doRemove && hostRemove(anchor);
|
|
3579
|
-
if (shapeFlag & 16) {
|
|
3580
|
-
const
|
|
3581
|
-
|
|
3582
|
-
const child = children[i];
|
|
3583
|
-
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3584
|
-
}
|
|
3652
|
+
if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
3653
|
+
const child = children[i];
|
|
3654
|
+
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
3585
3655
|
}
|
|
3586
3656
|
},
|
|
3587
3657
|
move: moveTeleport,
|
|
@@ -3592,7 +3662,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
3592
3662
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
3593
3663
|
const isReorder = moveType === 2;
|
|
3594
3664
|
if (isReorder) insert(el, container, parentAnchor);
|
|
3595
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
3665
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
3596
3666
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
3597
3667
|
}
|
|
3598
3668
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -3717,8 +3787,8 @@ const BaseTransitionImpl = {
|
|
|
3717
3787
|
const state = useTransitionState();
|
|
3718
3788
|
return () => {
|
|
3719
3789
|
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
3720
|
-
|
|
3721
|
-
|
|
3790
|
+
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
3791
|
+
if (!child) return;
|
|
3722
3792
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3723
3793
|
const { mode } = rawProps;
|
|
3724
3794
|
checkTransitionMode(mode);
|
|
@@ -3834,7 +3904,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3834
3904
|
callHook(hook, [el]);
|
|
3835
3905
|
},
|
|
3836
3906
|
enter(el) {
|
|
3837
|
-
if (isLeaving()) return;
|
|
3907
|
+
if (!isHmrUpdating && isLeaving()) return;
|
|
3838
3908
|
let hook = onEnter;
|
|
3839
3909
|
let afterHook = onAfterEnter;
|
|
3840
3910
|
let cancelHook = onEnterCancelled;
|
|
@@ -4171,7 +4241,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4171
4241
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4172
4242
|
break;
|
|
4173
4243
|
case VaporSlot:
|
|
4174
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
|
|
4244
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
4175
4245
|
break;
|
|
4176
4246
|
default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
|
|
4177
4247
|
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
@@ -4181,16 +4251,31 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4181
4251
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
4182
4252
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
4183
4253
|
else nextNode = nextSibling(node);
|
|
4184
|
-
if (vnode.type.__vapor)
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
}
|
|
4192
|
-
|
|
4193
|
-
|
|
4254
|
+
if (vnode.type.__vapor) {
|
|
4255
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeBeforeMount;
|
|
4256
|
+
getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
|
|
4257
|
+
if (vnode.dirs) {
|
|
4258
|
+
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
4259
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
4260
|
+
}
|
|
4261
|
+
}, () => {
|
|
4262
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
|
|
4263
|
+
});
|
|
4264
|
+
if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
4265
|
+
const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
|
|
4266
|
+
if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
|
|
4267
|
+
} else {
|
|
4268
|
+
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
4269
|
+
const component = vnode.component;
|
|
4270
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved || component.asyncDep && !component.asyncResolved) {
|
|
4271
|
+
let subTree;
|
|
4272
|
+
if (isFragmentStart) {
|
|
4273
|
+
subTree = createVNode(Fragment);
|
|
4274
|
+
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
4275
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
4276
|
+
subTree.el = node;
|
|
4277
|
+
component.subTree = subTree;
|
|
4278
|
+
}
|
|
4194
4279
|
}
|
|
4195
4280
|
} else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
|
|
4196
4281
|
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
@@ -4202,7 +4287,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4202
4287
|
};
|
|
4203
4288
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
4204
4289
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
4205
|
-
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
4290
|
+
const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
4206
4291
|
const forcePatch = type === "input" || type === "option";
|
|
4207
4292
|
{
|
|
4208
4293
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
@@ -4220,15 +4305,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4220
4305
|
}
|
|
4221
4306
|
if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
|
|
4222
4307
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4223
|
-
|
|
4308
|
+
if (next && !isMismatchAllowed(el, 1)) {
|
|
4309
|
+
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
4310
|
+
logMismatchError();
|
|
4311
|
+
}
|
|
4224
4312
|
while (next) {
|
|
4225
|
-
if (!isMismatchAllowed(el, 1)) {
|
|
4226
|
-
if (!hasWarned) {
|
|
4227
|
-
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
4228
|
-
hasWarned = true;
|
|
4229
|
-
}
|
|
4230
|
-
logMismatchError();
|
|
4231
|
-
}
|
|
4232
4313
|
const cur = next;
|
|
4233
4314
|
next = next.nextSibling;
|
|
4234
4315
|
remove(cur);
|
|
@@ -4247,9 +4328,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4247
4328
|
}
|
|
4248
4329
|
if (props) {
|
|
4249
4330
|
const isCustomElement = el.tagName.includes("-");
|
|
4331
|
+
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
4250
4332
|
for (const key in props) {
|
|
4251
4333
|
if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
|
|
4252
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key)) patchProp(el, key, null, props[key],
|
|
4334
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
4253
4335
|
}
|
|
4254
4336
|
}
|
|
4255
4337
|
let vnodeHooks;
|
|
@@ -4267,7 +4349,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4267
4349
|
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
4268
4350
|
const children = parentVNode.children;
|
|
4269
4351
|
const l = children.length;
|
|
4270
|
-
let
|
|
4352
|
+
let hasCheckedMismatch = false;
|
|
4271
4353
|
for (let i = 0; i < l; i++) {
|
|
4272
4354
|
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
4273
4355
|
const isText = vnode.type === Text;
|
|
@@ -4281,12 +4363,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4281
4363
|
node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
4282
4364
|
} else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
|
|
4283
4365
|
else {
|
|
4284
|
-
if (!
|
|
4285
|
-
|
|
4366
|
+
if (!hasCheckedMismatch) {
|
|
4367
|
+
hasCheckedMismatch = true;
|
|
4368
|
+
if (!isMismatchAllowed(container, 1)) {
|
|
4286
4369
|
warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
|
|
4287
|
-
|
|
4370
|
+
logMismatchError();
|
|
4288
4371
|
}
|
|
4289
|
-
logMismatchError();
|
|
4290
4372
|
}
|
|
4291
4373
|
patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
4292
4374
|
}
|
|
@@ -4306,7 +4388,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4306
4388
|
}
|
|
4307
4389
|
};
|
|
4308
4390
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
4309
|
-
if (!
|
|
4391
|
+
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
4310
4392
|
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
|
|
4311
4393
|
logMismatchError();
|
|
4312
4394
|
}
|
|
@@ -4470,7 +4552,9 @@ const MismatchTypeString = {
|
|
|
4470
4552
|
};
|
|
4471
4553
|
function isMismatchAllowed(el, allowedType) {
|
|
4472
4554
|
if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
|
|
4473
|
-
|
|
4555
|
+
return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
|
|
4556
|
+
}
|
|
4557
|
+
function isMismatchAllowedByAttr(allowedAttr, allowedType) {
|
|
4474
4558
|
if (allowedAttr == null) return false;
|
|
4475
4559
|
else if (allowedAttr === "") return true;
|
|
4476
4560
|
else {
|
|
@@ -4479,6 +4563,16 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
4479
4563
|
return list.includes(MismatchTypeString[allowedType]);
|
|
4480
4564
|
}
|
|
4481
4565
|
}
|
|
4566
|
+
function isNodeMismatchAllowed(node, vnode) {
|
|
4567
|
+
return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
|
|
4568
|
+
}
|
|
4569
|
+
function isMismatchAllowedByNode(node) {
|
|
4570
|
+
return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
|
|
4571
|
+
}
|
|
4572
|
+
function isMismatchAllowedByVNode({ props }) {
|
|
4573
|
+
const allowedAttr = props && props[allowMismatchAttr];
|
|
4574
|
+
return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
|
|
4575
|
+
}
|
|
4482
4576
|
//#endregion
|
|
4483
4577
|
//#region packages/runtime-core/src/hydrationStrategies.ts
|
|
4484
4578
|
let requestIdleCallback;
|
|
@@ -4597,11 +4691,16 @@ function defineAsyncComponent(source) {
|
|
|
4597
4691
|
onError(err);
|
|
4598
4692
|
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
4599
4693
|
});
|
|
4600
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
4694
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
4601
4695
|
load().then(() => {
|
|
4696
|
+
if (instance.isUnmounted) return;
|
|
4602
4697
|
loaded.value = true;
|
|
4603
4698
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
4604
4699
|
}).catch((err) => {
|
|
4700
|
+
if (instance.isUnmounted) {
|
|
4701
|
+
setPendingRequest(null);
|
|
4702
|
+
return;
|
|
4703
|
+
}
|
|
4605
4704
|
onError(err);
|
|
4606
4705
|
error.value = err;
|
|
4607
4706
|
});
|
|
@@ -4659,14 +4758,22 @@ function createAsyncComponentContext(source) {
|
|
|
4659
4758
|
setPendingRequest: (request) => pendingRequest = request
|
|
4660
4759
|
};
|
|
4661
4760
|
}
|
|
4662
|
-
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
4761
|
+
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
4663
4762
|
const loaded = /* @__PURE__ */ ref(false);
|
|
4664
4763
|
const error = /* @__PURE__ */ ref();
|
|
4665
4764
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
4666
|
-
|
|
4765
|
+
let timeoutTimer;
|
|
4766
|
+
let delayTimer;
|
|
4767
|
+
if (instance) onUnmounted(() => {
|
|
4768
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
4769
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
4770
|
+
}, instance);
|
|
4771
|
+
if (delay) delayTimer = setTimeout(() => {
|
|
4772
|
+
if (instance && instance.isUnmounted) return;
|
|
4667
4773
|
delayed.value = false;
|
|
4668
4774
|
}, delay);
|
|
4669
|
-
if (timeout != null) setTimeout(() => {
|
|
4775
|
+
if (timeout != null) timeoutTimer = setTimeout(() => {
|
|
4776
|
+
if (instance && instance.isUnmounted) return;
|
|
4670
4777
|
if (!loaded.value && !error.value) {
|
|
4671
4778
|
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
4672
4779
|
onError(err);
|
|
@@ -4684,6 +4791,7 @@ const useAsyncComponentState = (delay, timeout, onError) => {
|
|
|
4684
4791
|
* @internal
|
|
4685
4792
|
*/
|
|
4686
4793
|
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
4794
|
+
const wasConnected = el.isConnected;
|
|
4687
4795
|
let patched = false;
|
|
4688
4796
|
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
4689
4797
|
const performHydrate = () => {
|
|
@@ -4694,6 +4802,7 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
|
|
|
4694
4802
|
}
|
|
4695
4803
|
return;
|
|
4696
4804
|
}
|
|
4805
|
+
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
4697
4806
|
hydrate();
|
|
4698
4807
|
};
|
|
4699
4808
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -5274,8 +5383,9 @@ function createSlots(slots, dynamicSlots) {
|
|
|
5274
5383
|
* Compiler runtime helper for rendering `<slot/>`
|
|
5275
5384
|
* @private
|
|
5276
5385
|
*/
|
|
5277
|
-
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
5386
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
5278
5387
|
let slot = slots[name];
|
|
5388
|
+
if (fallback) fallback.__vdom = true;
|
|
5279
5389
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
5280
5390
|
if (vaporSlot) {
|
|
5281
5391
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
@@ -5283,25 +5393,35 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
5283
5393
|
slot: vaporSlot,
|
|
5284
5394
|
fallback
|
|
5285
5395
|
};
|
|
5396
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
5286
5397
|
return ret;
|
|
5287
5398
|
}
|
|
5288
5399
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
5289
|
-
const
|
|
5290
|
-
|
|
5291
|
-
|
|
5400
|
+
const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
|
|
5401
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
5402
|
+
if (name !== "default") slotProps.name = name;
|
|
5403
|
+
return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
|
|
5292
5404
|
}
|
|
5293
5405
|
if (slot && slot.length > 1) {
|
|
5294
5406
|
warn$1("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.");
|
|
5295
5407
|
slot = () => [];
|
|
5296
5408
|
}
|
|
5297
5409
|
if (slot && slot._c) slot._d = false;
|
|
5410
|
+
const prevStackSize = blockStack.length;
|
|
5298
5411
|
openBlock();
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5412
|
+
let rendered;
|
|
5413
|
+
try {
|
|
5414
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
5415
|
+
ensureVaporSlotFallback(validSlotContent, fallback);
|
|
5416
|
+
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
5417
|
+
rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
5418
|
+
} catch (err) {
|
|
5419
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
5420
|
+
throw err;
|
|
5421
|
+
} finally {
|
|
5422
|
+
if (slot && slot._c) slot._d = true;
|
|
5423
|
+
}
|
|
5303
5424
|
if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
5304
|
-
if (slot && slot._c) slot._d = true;
|
|
5305
5425
|
return rendered;
|
|
5306
5426
|
}
|
|
5307
5427
|
function ensureValidVNode(vnodes) {
|
|
@@ -5314,9 +5434,7 @@ function ensureValidVNode(vnodes) {
|
|
|
5314
5434
|
}
|
|
5315
5435
|
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
5316
5436
|
let vaporSlot;
|
|
5317
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs))
|
|
5318
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
5319
|
-
}
|
|
5437
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
5320
5438
|
}
|
|
5321
5439
|
//#endregion
|
|
5322
5440
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
@@ -5871,26 +5989,39 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
5871
5989
|
function withAsyncContext(getAwaitable) {
|
|
5872
5990
|
const ctx = getCurrentGenericInstance();
|
|
5873
5991
|
const inSSRSetup = isInSSRComponentSetup;
|
|
5992
|
+
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
5874
5993
|
if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
5875
5994
|
let awaitable = getAwaitable();
|
|
5876
5995
|
setCurrentInstance(null, void 0);
|
|
5877
5996
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5878
5997
|
const restore = () => {
|
|
5998
|
+
const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
5879
5999
|
setCurrentInstance(ctx);
|
|
5880
6000
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
6001
|
+
const reset = restoreAsyncContext && restoreAsyncContext();
|
|
6002
|
+
return () => {
|
|
6003
|
+
if (reset) reset();
|
|
6004
|
+
if (resetStoppedScope) resetStoppedScope.reset();
|
|
6005
|
+
};
|
|
5881
6006
|
};
|
|
5882
6007
|
const cleanup = () => {
|
|
5883
6008
|
setCurrentInstance(null, void 0);
|
|
5884
6009
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5885
6010
|
};
|
|
5886
6011
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
5887
|
-
restore();
|
|
5888
|
-
Promise.resolve().then(() => Promise.resolve().then(
|
|
6012
|
+
const reset = restore();
|
|
6013
|
+
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
6014
|
+
if (reset) reset();
|
|
6015
|
+
cleanup();
|
|
6016
|
+
}));
|
|
5889
6017
|
throw e;
|
|
5890
6018
|
});
|
|
5891
6019
|
return [awaitable, () => {
|
|
5892
|
-
restore();
|
|
5893
|
-
Promise.resolve().then(
|
|
6020
|
+
const reset = restore();
|
|
6021
|
+
Promise.resolve().then(() => {
|
|
6022
|
+
if (reset) reset();
|
|
6023
|
+
cleanup();
|
|
6024
|
+
});
|
|
5894
6025
|
}];
|
|
5895
6026
|
}
|
|
5896
6027
|
//#endregion
|
|
@@ -6208,7 +6339,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6208
6339
|
if (options.el) return vm.$mount(options.el);
|
|
6209
6340
|
else return vm;
|
|
6210
6341
|
}
|
|
6211
|
-
Vue.version = `2.6.14-compat:3.6.0-
|
|
6342
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.1`;
|
|
6212
6343
|
Vue.config = singletonApp.config;
|
|
6213
6344
|
Vue.use = (plugin, ...options) => {
|
|
6214
6345
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -6463,7 +6594,9 @@ function defineReactive(obj, key, val) {
|
|
|
6463
6594
|
else Object.keys(val).forEach((key) => {
|
|
6464
6595
|
try {
|
|
6465
6596
|
defineReactiveSimple(val, key, val[key]);
|
|
6466
|
-
} catch (e) {
|
|
6597
|
+
} catch (e) {
|
|
6598
|
+
warn$1(`Failed making property "${key}" reactive:`, e);
|
|
6599
|
+
}
|
|
6467
6600
|
});
|
|
6468
6601
|
}
|
|
6469
6602
|
const i = obj.$;
|
|
@@ -6708,12 +6841,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
6708
6841
|
for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
|
|
6709
6842
|
else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
|
|
6710
6843
|
}
|
|
6711
|
-
|
|
6844
|
+
const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
|
|
6845
|
+
if (!hasVModel) {
|
|
6712
6846
|
localValue = value;
|
|
6713
6847
|
trigger();
|
|
6714
6848
|
}
|
|
6715
6849
|
i.emit(`update:${name}`, emittedValue);
|
|
6716
|
-
if (hasChanged(value,
|
|
6850
|
+
if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
|
|
6717
6851
|
prevSetValue = value;
|
|
6718
6852
|
prevEmittedValue = emittedValue;
|
|
6719
6853
|
}
|
|
@@ -6826,7 +6960,8 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
6826
6960
|
function isEmitListener(options, key) {
|
|
6827
6961
|
if (!options || !isOn(key)) return false;
|
|
6828
6962
|
if (key.startsWith(compatModelEventPrefix)) return true;
|
|
6829
|
-
key = key.slice(2)
|
|
6963
|
+
key = key.slice(2);
|
|
6964
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
6830
6965
|
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
6831
6966
|
}
|
|
6832
6967
|
//#endregion
|
|
@@ -7020,15 +7155,19 @@ function hasPropValueChanged(nextProps, prevProps, key) {
|
|
|
7020
7155
|
if (key === "style" && isObject(nextProp) && isObject(prevProp)) return !looseEqual(nextProp, prevProp);
|
|
7021
7156
|
return nextProp !== prevProp;
|
|
7022
7157
|
}
|
|
7023
|
-
function updateHOCHostEl({ vnode, parent }, el) {
|
|
7158
|
+
function updateHOCHostEl({ vnode, parent, suspense }, el) {
|
|
7024
7159
|
while (parent && !parent.vapor) {
|
|
7025
7160
|
const root = parent.subTree;
|
|
7026
|
-
if (root.suspense && root.suspense.activeBranch === vnode)
|
|
7161
|
+
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
7162
|
+
root.suspense.vnode.el = root.el = el;
|
|
7163
|
+
vnode = root;
|
|
7164
|
+
}
|
|
7027
7165
|
if (root === vnode) {
|
|
7028
7166
|
(vnode = parent.vnode).el = el;
|
|
7029
7167
|
parent = parent.parent;
|
|
7030
7168
|
} else break;
|
|
7031
7169
|
}
|
|
7170
|
+
if (suspense && suspense.activeBranch === vnode) suspense.vnode.el = el;
|
|
7032
7171
|
}
|
|
7033
7172
|
//#endregion
|
|
7034
7173
|
//#region packages/runtime-core/src/compat/props.ts
|
|
@@ -7340,7 +7479,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
7340
7479
|
const receivedType = toRawType(value);
|
|
7341
7480
|
const expectedValue = styleValue(value, expectedType);
|
|
7342
7481
|
const receivedValue = styleValue(value, receivedType);
|
|
7343
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) &&
|
|
7482
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
|
|
7344
7483
|
message += `, got ${receivedType} `;
|
|
7345
7484
|
if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
|
|
7346
7485
|
return message;
|
|
@@ -7349,7 +7488,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
7349
7488
|
* dev only
|
|
7350
7489
|
*/
|
|
7351
7490
|
function styleValue(value, type) {
|
|
7352
|
-
if (
|
|
7491
|
+
if (isSymbol(value)) return value.toString();
|
|
7492
|
+
else if (type === "String") return `"${value}"`;
|
|
7353
7493
|
else if (type === "Number") return `${Number(value)}`;
|
|
7354
7494
|
else return `${value}`;
|
|
7355
7495
|
}
|
|
@@ -7366,8 +7506,11 @@ function isExplicable(type) {
|
|
|
7366
7506
|
/**
|
|
7367
7507
|
* dev only
|
|
7368
7508
|
*/
|
|
7369
|
-
function
|
|
7370
|
-
return args.
|
|
7509
|
+
function isCoercible(...args) {
|
|
7510
|
+
return args.every((elem) => {
|
|
7511
|
+
const value = elem.toLowerCase();
|
|
7512
|
+
return value !== "boolean" && value !== "symbol";
|
|
7513
|
+
});
|
|
7371
7514
|
}
|
|
7372
7515
|
//#endregion
|
|
7373
7516
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
@@ -7637,10 +7780,19 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7637
7780
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
7638
7781
|
if (transition) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
|
|
7639
7782
|
else hostInsert(el, container, anchor);
|
|
7640
|
-
if ((vnodeHook = props && props.onVnodeMounted) || dirs)
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7783
|
+
if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
|
|
7784
|
+
const isHmr = isHmrUpdating;
|
|
7785
|
+
queuePostRenderEffect(() => {
|
|
7786
|
+
let prev;
|
|
7787
|
+
prev = setHmrUpdating(isHmr);
|
|
7788
|
+
try {
|
|
7789
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
7790
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
7791
|
+
} finally {
|
|
7792
|
+
setHmrUpdating(prev);
|
|
7793
|
+
}
|
|
7794
|
+
}, void 0, parentSuspense);
|
|
7795
|
+
}
|
|
7644
7796
|
};
|
|
7645
7797
|
const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
|
|
7646
7798
|
if (scopeId) hostSetScopeId(el, scopeId);
|
|
@@ -7663,7 +7815,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7663
7815
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
7664
7816
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
7665
7817
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
7666
|
-
if (isHmrUpdating) {
|
|
7818
|
+
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
7667
7819
|
patchFlag = 0;
|
|
7668
7820
|
optimized = false;
|
|
7669
7821
|
dynamicChildren = null;
|
|
@@ -7743,19 +7895,35 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7743
7895
|
n2.slotScopeIds = slotScopeIds;
|
|
7744
7896
|
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
|
|
7745
7897
|
else {
|
|
7898
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
7746
7899
|
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
7747
7900
|
if (n2.dirs) {
|
|
7748
7901
|
invokeDirectiveHook(n2, null, parentComponent, "created");
|
|
7749
7902
|
invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
|
|
7750
7903
|
}
|
|
7904
|
+
}, () => {
|
|
7905
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
7751
7906
|
});
|
|
7752
7907
|
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
7908
|
+
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
7909
|
+
if (vnodeMountedHook) {
|
|
7910
|
+
const scopedVNode = n2;
|
|
7911
|
+
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
7912
|
+
}
|
|
7753
7913
|
}
|
|
7754
7914
|
else {
|
|
7755
|
-
|
|
7915
|
+
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
7916
|
+
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
7756
7917
|
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
7918
|
+
}, () => {
|
|
7919
|
+
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
7920
|
+
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
7757
7921
|
});
|
|
7758
|
-
|
|
7922
|
+
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
7923
|
+
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
7924
|
+
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
7925
|
+
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
7926
|
+
}, void 0, parentSuspense);
|
|
7759
7927
|
}
|
|
7760
7928
|
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
7761
7929
|
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
@@ -8111,8 +8279,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8111
8279
|
else hostInsert(el, container, anchor);
|
|
8112
8280
|
};
|
|
8113
8281
|
const performLeave = () => {
|
|
8282
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
8114
8283
|
if (el._isLeaving) el[leaveCbKey](true);
|
|
8115
|
-
|
|
8284
|
+
if (transition.persisted && !wasLeaving) remove();
|
|
8285
|
+
else leave(el, () => {
|
|
8116
8286
|
remove();
|
|
8117
8287
|
afterLeave && afterLeave();
|
|
8118
8288
|
});
|
|
@@ -8123,7 +8293,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8123
8293
|
else hostInsert(el, container, anchor);
|
|
8124
8294
|
};
|
|
8125
8295
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
8126
|
-
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex } = vnode;
|
|
8296
|
+
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
8127
8297
|
if (patchFlag === -2) optimized = false;
|
|
8128
8298
|
if (ref != null) {
|
|
8129
8299
|
const prevSub = setActiveSub();
|
|
@@ -8143,7 +8313,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8143
8313
|
if (shapeFlag & 6) if (isVaporComponent(type)) {
|
|
8144
8314
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
8145
8315
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
8146
|
-
if (
|
|
8316
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
8317
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
8318
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8319
|
+
}, void 0, parentSuspense);
|
|
8147
8320
|
return;
|
|
8148
8321
|
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
8149
8322
|
else {
|
|
@@ -8161,9 +8334,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8161
8334
|
}
|
|
8162
8335
|
if (doRemove) remove(vnode);
|
|
8163
8336
|
}
|
|
8164
|
-
|
|
8337
|
+
const shouldInvalidateMemo = memo != null && cacheIndex == null;
|
|
8338
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) queuePostRenderEffect(() => {
|
|
8165
8339
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
8166
8340
|
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
8341
|
+
if (shouldInvalidateMemo) vnode.el = null;
|
|
8167
8342
|
}, void 0, parentSuspense);
|
|
8168
8343
|
};
|
|
8169
8344
|
const remove = (vnode) => {
|
|
@@ -8203,7 +8378,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8203
8378
|
if (effect) {
|
|
8204
8379
|
effect.stop();
|
|
8205
8380
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
8206
|
-
}
|
|
8381
|
+
} else if (doRemove && subTree && instance.vnode.el) remove(subTree);
|
|
8207
8382
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
8208
8383
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
|
|
8209
8384
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
@@ -8330,6 +8505,10 @@ function invalidateMount(hooks) {
|
|
|
8330
8505
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
8331
8506
|
}
|
|
8332
8507
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
8508
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
8509
|
+
insert();
|
|
8510
|
+
return;
|
|
8511
|
+
}
|
|
8333
8512
|
if (force || needTransition(parentSuspense, transition)) {
|
|
8334
8513
|
transition.beforeEnter(el);
|
|
8335
8514
|
insert();
|
|
@@ -8518,6 +8697,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8518
8697
|
pendingId: suspenseId++,
|
|
8519
8698
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
8520
8699
|
activeBranch: null,
|
|
8700
|
+
isFallbackMountPending: false,
|
|
8521
8701
|
pendingBranch: null,
|
|
8522
8702
|
isInFallback: !isHydrating,
|
|
8523
8703
|
isHydrating,
|
|
@@ -8531,20 +8711,25 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8531
8711
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
8532
8712
|
else if (!resume) {
|
|
8533
8713
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
8714
|
+
let hasUpdatedAnchor = false;
|
|
8534
8715
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
8535
8716
|
if (pendingId === suspense.pendingId) {
|
|
8536
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
8717
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
8537
8718
|
queuePostFlushCb(effects);
|
|
8538
8719
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
8539
8720
|
}
|
|
8540
8721
|
};
|
|
8541
|
-
if (activeBranch) {
|
|
8542
|
-
if (parentNode(activeBranch.el) === container)
|
|
8722
|
+
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
8723
|
+
if (parentNode(activeBranch.el) === container) {
|
|
8724
|
+
anchor = next(activeBranch);
|
|
8725
|
+
hasUpdatedAnchor = true;
|
|
8726
|
+
}
|
|
8543
8727
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
8544
8728
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
8545
8729
|
}
|
|
8546
8730
|
if (!delayEnter) move(pendingBranch, container, anchor, 0, parentComponent);
|
|
8547
8731
|
}
|
|
8732
|
+
suspense.isFallbackMountPending = false;
|
|
8548
8733
|
setActiveBranch(suspense, pendingBranch);
|
|
8549
8734
|
suspense.pendingBranch = null;
|
|
8550
8735
|
suspense.isInFallback = false;
|
|
@@ -8574,12 +8759,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8574
8759
|
triggerEvent(vnode, "onFallback");
|
|
8575
8760
|
const anchor = next(activeBranch);
|
|
8576
8761
|
const mountFallback = () => {
|
|
8762
|
+
suspense.isFallbackMountPending = false;
|
|
8577
8763
|
if (!suspense.isInFallback) return;
|
|
8578
8764
|
patch(null, fallbackVNode, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
8579
8765
|
setActiveBranch(suspense, fallbackVNode);
|
|
8580
8766
|
};
|
|
8581
8767
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
8582
|
-
if (delayEnter)
|
|
8768
|
+
if (delayEnter) {
|
|
8769
|
+
suspense.isFallbackMountPending = true;
|
|
8770
|
+
activeBranch.transition.afterLeave = mountFallback;
|
|
8771
|
+
}
|
|
8583
8772
|
suspense.isInFallback = true;
|
|
8584
8773
|
unmount(activeBranch, parentComponent, null, true);
|
|
8585
8774
|
if (!delayEnter) mountFallback();
|
|
@@ -8598,6 +8787,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
8598
8787
|
handleError(err, instance, 0);
|
|
8599
8788
|
}).then((asyncSetupResult) => {
|
|
8600
8789
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
8790
|
+
setCurrentInstance(null, void 0);
|
|
8601
8791
|
instance.asyncResolved = true;
|
|
8602
8792
|
onResolve(asyncSetupResult);
|
|
8603
8793
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -8930,12 +9120,30 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
8930
9120
|
el: vnode.el,
|
|
8931
9121
|
anchor: vnode.anchor,
|
|
8932
9122
|
ctx: vnode.ctx,
|
|
8933
|
-
ce: vnode.ce
|
|
9123
|
+
ce: vnode.ce,
|
|
9124
|
+
vi: vnode.vi,
|
|
9125
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
9126
|
+
vb: vnode.vb
|
|
8934
9127
|
};
|
|
8935
9128
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
8936
9129
|
defineLegacyVNodeProperties(cloned);
|
|
8937
9130
|
return cloned;
|
|
8938
9131
|
}
|
|
9132
|
+
function cloneVaporSlotMeta(vnode) {
|
|
9133
|
+
const vaporSlot = vnode.vs;
|
|
9134
|
+
if (!vaporSlot) return vaporSlot;
|
|
9135
|
+
const cloned = {
|
|
9136
|
+
slot: vaporSlot.slot,
|
|
9137
|
+
fallback: vaporSlot.fallback,
|
|
9138
|
+
outletFallback: vaporSlot.outletFallback
|
|
9139
|
+
};
|
|
9140
|
+
if (vnode.el) {
|
|
9141
|
+
cloned.state = vaporSlot.state;
|
|
9142
|
+
cloned.ref = vaporSlot.ref;
|
|
9143
|
+
cloned.scope = vaporSlot.scope;
|
|
9144
|
+
}
|
|
9145
|
+
return cloned;
|
|
9146
|
+
}
|
|
8939
9147
|
/**
|
|
8940
9148
|
* Dev only, for HMR of hoisted vnodes reused in v-for
|
|
8941
9149
|
* https://github.com/vitejs/vite/issues/2022
|
|
@@ -8998,6 +9206,10 @@ function normalizeChildren(vnode, children) {
|
|
|
8998
9206
|
}
|
|
8999
9207
|
}
|
|
9000
9208
|
else if (isFunction(children)) {
|
|
9209
|
+
if (shapeFlag & 65) {
|
|
9210
|
+
normalizeChildren(vnode, { default: children });
|
|
9211
|
+
return;
|
|
9212
|
+
}
|
|
9001
9213
|
children = {
|
|
9002
9214
|
default: children,
|
|
9003
9215
|
_ctx: currentRenderingInstance
|
|
@@ -9024,6 +9236,7 @@ function mergeProps(...args) {
|
|
|
9024
9236
|
const existing = ret[key];
|
|
9025
9237
|
const incoming = toMerge[key];
|
|
9026
9238
|
if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) ret[key] = existing ? [].concat(existing, incoming) : incoming;
|
|
9239
|
+
else if (incoming == null && existing == null && !isModelListener(key)) ret[key] = incoming;
|
|
9027
9240
|
} else if (key !== "") ret[key] = toMerge[key];
|
|
9028
9241
|
}
|
|
9029
9242
|
return ret;
|
|
@@ -9594,7 +9807,7 @@ function isMemoSame(cached, memo) {
|
|
|
9594
9807
|
}
|
|
9595
9808
|
//#endregion
|
|
9596
9809
|
//#region packages/runtime-core/src/index.ts
|
|
9597
|
-
const version = "3.6.0-
|
|
9810
|
+
const version = "3.6.0-rc.1";
|
|
9598
9811
|
const warn = warn$1;
|
|
9599
9812
|
/**
|
|
9600
9813
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -10082,7 +10295,10 @@ function patchStyle(el, prev, next) {
|
|
|
10082
10295
|
}
|
|
10083
10296
|
for (const key in next) {
|
|
10084
10297
|
if (key === "display") hasControlledDisplay = true;
|
|
10085
|
-
|
|
10298
|
+
const value = next[key];
|
|
10299
|
+
if (value != null) {
|
|
10300
|
+
if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
|
|
10301
|
+
} else setStyle(style, key, "");
|
|
10086
10302
|
}
|
|
10087
10303
|
} else if (isCssString) {
|
|
10088
10304
|
if (prev !== next) {
|
|
@@ -10130,6 +10346,14 @@ function autoPrefix(style, rawName) {
|
|
|
10130
10346
|
}
|
|
10131
10347
|
return rawName;
|
|
10132
10348
|
}
|
|
10349
|
+
/**
|
|
10350
|
+
* Browsers update textarea width/height directly during native resize.
|
|
10351
|
+
* Only special-case this common textarea path for now; other resize scenarios
|
|
10352
|
+
* still follow normal vnode style patching.
|
|
10353
|
+
*/
|
|
10354
|
+
function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
10355
|
+
return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
|
|
10356
|
+
}
|
|
10133
10357
|
//#endregion
|
|
10134
10358
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
10135
10359
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
@@ -10213,7 +10437,7 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
10213
10437
|
const existingInvoker = invokers[rawName];
|
|
10214
10438
|
if (nextValue && existingInvoker) existingInvoker.value = sanitizeEventValue(nextValue, rawName);
|
|
10215
10439
|
else {
|
|
10216
|
-
const [name, options] =
|
|
10440
|
+
const [name, options] = parseEventName(rawName);
|
|
10217
10441
|
if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(sanitizeEventValue(nextValue, rawName), instance), options);
|
|
10218
10442
|
else if (existingInvoker) {
|
|
10219
10443
|
removeEventListener(el, name, existingInvoker, options);
|
|
@@ -10221,16 +10445,15 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
|
10221
10445
|
}
|
|
10222
10446
|
}
|
|
10223
10447
|
}
|
|
10224
|
-
const optionsModifierRE = /(
|
|
10225
|
-
|
|
10448
|
+
const optionsModifierRE = /(Once|Passive|Capture)$/;
|
|
10449
|
+
const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
|
|
10450
|
+
function parseEventName(name) {
|
|
10226
10451
|
let options;
|
|
10227
|
-
|
|
10228
|
-
|
|
10229
|
-
|
|
10230
|
-
|
|
10231
|
-
|
|
10232
|
-
options[m[0].toLowerCase()] = true;
|
|
10233
|
-
}
|
|
10452
|
+
let m;
|
|
10453
|
+
while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
|
|
10454
|
+
if (!options) options = {};
|
|
10455
|
+
name = name.slice(0, name.length - m[1].length);
|
|
10456
|
+
options[m[1].toLowerCase()] = true;
|
|
10234
10457
|
}
|
|
10235
10458
|
return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
|
|
10236
10459
|
}
|
|
@@ -10241,7 +10464,21 @@ function createInvoker(initialValue, instance) {
|
|
|
10241
10464
|
const invoker = (e) => {
|
|
10242
10465
|
if (!e._vts) e._vts = Date.now();
|
|
10243
10466
|
else if (e._vts <= invoker.attached) return;
|
|
10244
|
-
|
|
10467
|
+
const value = invoker.value;
|
|
10468
|
+
if (isArray(value)) {
|
|
10469
|
+
const originalStop = e.stopImmediatePropagation;
|
|
10470
|
+
e.stopImmediatePropagation = () => {
|
|
10471
|
+
originalStop.call(e);
|
|
10472
|
+
e._stopped = true;
|
|
10473
|
+
};
|
|
10474
|
+
const handlers = value.slice();
|
|
10475
|
+
const args = [e];
|
|
10476
|
+
for (let i = 0; i < handlers.length; i++) {
|
|
10477
|
+
if (e._stopped) break;
|
|
10478
|
+
const handler = handlers[i];
|
|
10479
|
+
if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
|
|
10480
|
+
}
|
|
10481
|
+
} else callWithAsyncErrorHandling(value, instance, 5, [e]);
|
|
10245
10482
|
};
|
|
10246
10483
|
invoker.value = initialValue;
|
|
10247
10484
|
invoker.attached = getNow();
|
|
@@ -10252,16 +10489,6 @@ function sanitizeEventValue(value, propName) {
|
|
|
10252
10489
|
warn(`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?\nExpected function or array of functions, received type ${typeof value}.`);
|
|
10253
10490
|
return NOOP;
|
|
10254
10491
|
}
|
|
10255
|
-
function patchStopImmediatePropagation(e, value) {
|
|
10256
|
-
if (isArray(value)) {
|
|
10257
|
-
const originalStop = e.stopImmediatePropagation;
|
|
10258
|
-
e.stopImmediatePropagation = () => {
|
|
10259
|
-
originalStop.call(e);
|
|
10260
|
-
e._stopped = true;
|
|
10261
|
-
};
|
|
10262
|
-
return value.map((fn) => (e) => !e._stopped && fn && fn(e));
|
|
10263
|
-
} else return value;
|
|
10264
|
-
}
|
|
10265
10492
|
//#endregion
|
|
10266
10493
|
//#region packages/runtime-dom/src/patchProp.ts
|
|
10267
10494
|
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
|
|
@@ -10589,7 +10816,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
10589
10816
|
replacementNodes.push(child);
|
|
10590
10817
|
}
|
|
10591
10818
|
parent.removeChild(o);
|
|
10592
|
-
slotReplacements.set(o,
|
|
10819
|
+
slotReplacements.set(o, {
|
|
10820
|
+
nodes: replacementNodes,
|
|
10821
|
+
usedFallback: !content
|
|
10822
|
+
});
|
|
10593
10823
|
}
|
|
10594
10824
|
this._updateSlotNodes(slotReplacements);
|
|
10595
10825
|
}
|
|
@@ -10779,7 +11009,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
|
|
|
10779
11009
|
prevChildren = [];
|
|
10780
11010
|
if (children) for (let i = 0; i < children.length; i++) {
|
|
10781
11011
|
const child = children[i];
|
|
10782
|
-
if (child.el && child.el instanceof Element) {
|
|
11012
|
+
if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
|
|
10783
11013
|
prevChildren.push(child);
|
|
10784
11014
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
10785
11015
|
positionMap.set(child, getPosition(child.el));
|
|
@@ -10920,7 +11150,8 @@ const vModelTextUpdate = (el, oldValue, value, trim, number, lazy) => {
|
|
|
10920
11150
|
const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
|
|
10921
11151
|
const newValue = value == null ? "" : value;
|
|
10922
11152
|
if (elValue === newValue) return;
|
|
10923
|
-
|
|
11153
|
+
const rootNode = el.getRootNode();
|
|
11154
|
+
if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
|
|
10924
11155
|
if (lazy && value === oldValue) return;
|
|
10925
11156
|
if (trim && el.value.trim() === newValue) return;
|
|
10926
11157
|
}
|
|
@@ -11002,7 +11233,8 @@ const vModelSelect = {
|
|
|
11002
11233
|
mounted(el, { value }) {
|
|
11003
11234
|
vModelSetSelected(el, value);
|
|
11004
11235
|
},
|
|
11005
|
-
beforeUpdate(el,
|
|
11236
|
+
beforeUpdate(el, { value }, vnode) {
|
|
11237
|
+
el._modelValue = value;
|
|
11006
11238
|
el[assignKey] = getModelAssigner(vnode);
|
|
11007
11239
|
},
|
|
11008
11240
|
updated(el, { value }) {
|
|
@@ -11013,10 +11245,10 @@ const vModelSelect = {
|
|
|
11013
11245
|
* @internal
|
|
11014
11246
|
*/
|
|
11015
11247
|
const vModelSelectInit = (el, value, number, set) => {
|
|
11016
|
-
|
|
11248
|
+
el._modelValue = value;
|
|
11017
11249
|
addEventListener(el, "change", () => {
|
|
11018
11250
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
|
|
11019
|
-
(set || el[assignKey])(el.multiple ?
|
|
11251
|
+
(set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
|
|
11020
11252
|
el._assigning = true;
|
|
11021
11253
|
nextTick(() => {
|
|
11022
11254
|
el._assigning = false;
|
|
@@ -11027,6 +11259,7 @@ const vModelSelectInit = (el, value, number, set) => {
|
|
|
11027
11259
|
* @internal
|
|
11028
11260
|
*/
|
|
11029
11261
|
const vModelSetSelected = (el, value) => {
|
|
11262
|
+
el._modelValue = value;
|
|
11030
11263
|
if (el._assigning) return;
|
|
11031
11264
|
const isMultiple = el.multiple;
|
|
11032
11265
|
const isArrayValue = isArray(value);
|
|
@@ -12692,6 +12925,7 @@ function getUnnormalizedProps(props, callPath = []) {
|
|
|
12692
12925
|
return [props, callPath];
|
|
12693
12926
|
}
|
|
12694
12927
|
function injectProp(node, prop, context) {
|
|
12928
|
+
if (node.type !== 13 && injectSlotKey(node, prop)) return;
|
|
12695
12929
|
let propsWithInjection;
|
|
12696
12930
|
/**
|
|
12697
12931
|
* 1. mergeProps(...)
|
|
@@ -12730,6 +12964,20 @@ function injectProp(node, prop, context) {
|
|
|
12730
12964
|
else if (parentCall) parentCall.arguments[0] = propsWithInjection;
|
|
12731
12965
|
else node.arguments[2] = propsWithInjection;
|
|
12732
12966
|
}
|
|
12967
|
+
function injectSlotKey(node, prop) {
|
|
12968
|
+
var _node$arguments, _node$arguments2, _node$arguments3;
|
|
12969
|
+
if (prop.key.type !== 4 || prop.key.content !== "key") return false;
|
|
12970
|
+
const props = node.arguments[2];
|
|
12971
|
+
if (props && !isString(props)) {
|
|
12972
|
+
const [unnormalizedProps] = getUnnormalizedProps(props);
|
|
12973
|
+
if (unnormalizedProps && !isString(unnormalizedProps) && unnormalizedProps.type === 15 && hasProp(prop, unnormalizedProps)) return true;
|
|
12974
|
+
}
|
|
12975
|
+
(_node$arguments = node.arguments)[2] || (_node$arguments[2] = "{}");
|
|
12976
|
+
(_node$arguments2 = node.arguments)[3] || (_node$arguments2[3] = "undefined");
|
|
12977
|
+
(_node$arguments3 = node.arguments)[4] || (_node$arguments3[4] = "undefined");
|
|
12978
|
+
node.arguments[5] = prop.value;
|
|
12979
|
+
return true;
|
|
12980
|
+
}
|
|
12733
12981
|
function hasProp(prop, props) {
|
|
12734
12982
|
let result = false;
|
|
12735
12983
|
if (prop.key.type === 4) {
|
|
@@ -12999,7 +13247,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
12999
13247
|
}
|
|
13000
13248
|
},
|
|
13001
13249
|
oncdata(start, end) {
|
|
13002
|
-
if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
|
|
13250
|
+
if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
|
|
13003
13251
|
else emitError(1, start - 9);
|
|
13004
13252
|
},
|
|
13005
13253
|
onprocessinginstruction(start) {
|
|
@@ -13491,7 +13739,7 @@ function getSelfName(filename) {
|
|
|
13491
13739
|
const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
|
|
13492
13740
|
return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
|
|
13493
13741
|
}
|
|
13494
|
-
function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
|
|
13742
|
+
function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, eventDelegation = true, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
|
|
13495
13743
|
const context = {
|
|
13496
13744
|
filename,
|
|
13497
13745
|
selfName: getSelfName(filename),
|
|
@@ -13513,6 +13761,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
13513
13761
|
bindingMetadata,
|
|
13514
13762
|
inline,
|
|
13515
13763
|
isTS,
|
|
13764
|
+
eventDelegation,
|
|
13516
13765
|
onError,
|
|
13517
13766
|
onWarn,
|
|
13518
13767
|
compatConfig,
|
|
@@ -13524,8 +13773,10 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
13524
13773
|
imports: [],
|
|
13525
13774
|
cached: [],
|
|
13526
13775
|
constantCache: /* @__PURE__ */ new WeakMap(),
|
|
13776
|
+
vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
|
|
13527
13777
|
temps: 0,
|
|
13528
13778
|
identifiers: Object.create(null),
|
|
13779
|
+
identifierScopes: Object.create(null),
|
|
13529
13780
|
scopes: {
|
|
13530
13781
|
vFor: 0,
|
|
13531
13782
|
vSlot: 0,
|
|
@@ -13576,8 +13827,12 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
13576
13827
|
context.parent.children.splice(removalIndex, 1);
|
|
13577
13828
|
},
|
|
13578
13829
|
onNodeRemoved: NOOP,
|
|
13579
|
-
addIdentifiers(exp) {},
|
|
13830
|
+
addIdentifiers(exp, type = "local") {},
|
|
13580
13831
|
removeIdentifiers(exp) {},
|
|
13832
|
+
isSlotScopeIdentifier(name) {
|
|
13833
|
+
const scopes = context.identifierScopes[name];
|
|
13834
|
+
return scopes ? scopes[scopes.length - 1] === "slot" : false;
|
|
13835
|
+
},
|
|
13581
13836
|
hoist(exp) {
|
|
13582
13837
|
if (isString(exp)) exp = createSimpleExpression(exp);
|
|
13583
13838
|
context.hoists.push(exp);
|
|
@@ -13931,6 +14186,7 @@ function genNode(node, context) {
|
|
|
13931
14186
|
case 24: break;
|
|
13932
14187
|
case 25: break;
|
|
13933
14188
|
case 26: break;
|
|
14189
|
+
/* v8 ignore start */
|
|
13934
14190
|
case 10: break;
|
|
13935
14191
|
default:
|
|
13936
14192
|
assert(false, `unhandled codegen node type: ${node.type}`);
|
|
@@ -14148,7 +14404,7 @@ const transformExpression = (node, context) => {
|
|
|
14148
14404
|
if (dir.type === 7 && dir.name !== "for") {
|
|
14149
14405
|
const exp = dir.exp;
|
|
14150
14406
|
const arg = dir.arg;
|
|
14151
|
-
if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
|
|
14407
|
+
if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
|
|
14152
14408
|
if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
|
|
14153
14409
|
}
|
|
14154
14410
|
}
|
|
@@ -14289,10 +14545,9 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
|
|
|
14289
14545
|
const isTemplate = isTemplateNode(node);
|
|
14290
14546
|
const memo = findDir(node, "memo");
|
|
14291
14547
|
const keyProp = findProp(node, `key`, false, true);
|
|
14292
|
-
|
|
14548
|
+
keyProp && keyProp.type;
|
|
14293
14549
|
let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
|
|
14294
|
-
|
|
14295
|
-
const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
14550
|
+
const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
14296
14551
|
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
14297
14552
|
const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
|
|
14298
14553
|
forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);
|
|
@@ -14336,7 +14591,7 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
|
|
|
14336
14591
|
`)`
|
|
14337
14592
|
]),
|
|
14338
14593
|
createCompoundExpression([
|
|
14339
|
-
`if (_cached`,
|
|
14594
|
+
`if (_cached && _cached.el`,
|
|
14340
14595
|
...keyExp ? [` && _cached.key === `, keyExp] : [],
|
|
14341
14596
|
` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
|
|
14342
14597
|
]),
|
|
@@ -15069,7 +15324,7 @@ function rewriteFilter(node, context) {
|
|
|
15069
15324
|
const child = node.children[i];
|
|
15070
15325
|
if (typeof child !== "object") continue;
|
|
15071
15326
|
if (child.type === 4) parseFilter(child, context);
|
|
15072
|
-
else if (child.type === 8) rewriteFilter(
|
|
15327
|
+
else if (child.type === 8) rewriteFilter(child, context);
|
|
15073
15328
|
else if (child.type === 5) rewriteFilter(child.content, context);
|
|
15074
15329
|
}
|
|
15075
15330
|
}
|
|
@@ -15504,7 +15759,7 @@ function postTransformTransition(node, onError, hasMultipleChildren = defaultHas
|
|
|
15504
15759
|
source: ""
|
|
15505
15760
|
}));
|
|
15506
15761
|
const child = node.children[0];
|
|
15507
|
-
if (child.type === 1) {
|
|
15762
|
+
if (child.type === 1 && !findDir(child, "if")) {
|
|
15508
15763
|
for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
|
|
15509
15764
|
type: 6,
|
|
15510
15765
|
name: "persisted",
|