@vue/runtime-core 3.6.0-beta.12 → 3.6.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-beta.
|
|
2
|
+
* @vue/runtime-core v3.6.0-beta.14
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -383,6 +383,7 @@ function flushJobs(seen) {
|
|
|
383
383
|
}
|
|
384
384
|
flushIndex = 0;
|
|
385
385
|
jobsLength = 0;
|
|
386
|
+
jobs.length = 0;
|
|
386
387
|
flushPostFlushCbs(seen);
|
|
387
388
|
currentFlushPromise = null;
|
|
388
389
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -440,6 +441,14 @@ function createRecord(id, initialDef) {
|
|
|
440
441
|
function normalizeClassComponent(component) {
|
|
441
442
|
return isClassComponent(component) ? component.__vccOpts : component;
|
|
442
443
|
}
|
|
444
|
+
function hasDirtyAncestor(instance, dirtyInstances) {
|
|
445
|
+
let parent = instance.parent;
|
|
446
|
+
while (parent) {
|
|
447
|
+
if (dirtyInstances.has(parent)) return true;
|
|
448
|
+
parent = parent.parent;
|
|
449
|
+
}
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
443
452
|
function rerender(id, newRender) {
|
|
444
453
|
const record = map.get(id);
|
|
445
454
|
if (!record) return;
|
|
@@ -471,42 +480,69 @@ function reload(id, newComp) {
|
|
|
471
480
|
const isVapor = record.initialDef.__vapor;
|
|
472
481
|
updateComponentDef(record.initialDef, newComp);
|
|
473
482
|
const instances = [...record.instances];
|
|
474
|
-
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
483
|
+
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
475
484
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
const
|
|
479
|
-
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
480
|
-
if (!dirtyInstances) {
|
|
481
|
-
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
482
|
-
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
483
|
-
}
|
|
484
|
-
dirtyInstances.add(instance);
|
|
485
|
-
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
486
|
-
instance.appContext.propsCache.delete(instance.type);
|
|
487
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
488
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
489
|
-
if (instance.ceReload) {
|
|
490
|
-
dirtyInstances.add(instance);
|
|
491
|
-
instance.ceReload(newComp.styles);
|
|
492
|
-
dirtyInstances.delete(instance);
|
|
493
|
-
} else if (instance.parent) queueJob(() => {
|
|
494
|
-
isHmrUpdating = true;
|
|
485
|
+
const dirtyInstances = new Set(instances);
|
|
486
|
+
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
487
|
+
for (const instance of instances) {
|
|
495
488
|
const parent = instance.parent;
|
|
496
|
-
if (parent
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
489
|
+
if (parent) {
|
|
490
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
491
|
+
rerenderedParents.add(parent);
|
|
492
|
+
parent.hmrRerender();
|
|
493
|
+
}
|
|
494
|
+
} else instance.hmrReload(newComp);
|
|
495
|
+
}
|
|
496
|
+
} else {
|
|
497
|
+
const parentUpdates = /* @__PURE__ */ new Map();
|
|
498
|
+
const dirtyInstanceSet = new Set(instances);
|
|
499
|
+
for (const instance of instances) {
|
|
500
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
501
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
502
|
+
if (!dirtyInstances) {
|
|
503
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
504
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
500
505
|
}
|
|
501
|
-
|
|
502
|
-
|
|
506
|
+
dirtyInstances.add(instance);
|
|
507
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
508
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
509
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
510
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
511
|
+
if (instance.ceReload) {
|
|
512
|
+
dirtyInstances.add(instance);
|
|
513
|
+
instance.ceReload(newComp.styles);
|
|
514
|
+
dirtyInstances.delete(instance);
|
|
515
|
+
} else if (instance.parent) {
|
|
516
|
+
const parent = instance.parent;
|
|
517
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
518
|
+
let updates = parentUpdates.get(parent);
|
|
519
|
+
if (!updates) parentUpdates.set(parent, updates = []);
|
|
520
|
+
updates.push([instance, dirtyInstances]);
|
|
521
|
+
}
|
|
522
|
+
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
523
|
+
else if (typeof window !== "undefined") window.location.reload();
|
|
524
|
+
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
525
|
+
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
526
|
+
}
|
|
527
|
+
parentUpdates.forEach((updates, parent) => {
|
|
528
|
+
queueJob(() => {
|
|
529
|
+
isHmrUpdating = true;
|
|
530
|
+
if (parent.vapor) parent.hmrRerender();
|
|
531
|
+
else {
|
|
532
|
+
const i = parent;
|
|
533
|
+
if (!(i.effect.flags & 1024)) {
|
|
534
|
+
i.renderCache = [];
|
|
535
|
+
i.effect.run();
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
nextTick(() => {
|
|
539
|
+
isHmrUpdating = false;
|
|
540
|
+
});
|
|
541
|
+
updates.forEach(([instance, dirtyInstances]) => {
|
|
542
|
+
dirtyInstances.delete(instance);
|
|
543
|
+
});
|
|
503
544
|
});
|
|
504
|
-
dirtyInstances.delete(instance);
|
|
505
545
|
});
|
|
506
|
-
else if (instance.appContext.reload) instance.appContext.reload();
|
|
507
|
-
else if (typeof window !== "undefined") window.location.reload();
|
|
508
|
-
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
509
|
-
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
510
546
|
}
|
|
511
547
|
queuePostFlushCb(() => {
|
|
512
548
|
hmrDirtyComponents.clear();
|
|
@@ -970,17 +1006,16 @@ const TeleportImpl = {
|
|
|
970
1006
|
},
|
|
971
1007
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
972
1008
|
const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
|
|
973
|
-
|
|
1009
|
+
const shouldRemove = doRemove || !isTeleportDisabled(props);
|
|
974
1010
|
const pendingMount = pendingMounts.get(vnode);
|
|
975
1011
|
if (pendingMount) {
|
|
976
1012
|
pendingMount.flags |= 4;
|
|
977
1013
|
pendingMounts.delete(vnode);
|
|
978
|
-
shouldRemove = false;
|
|
979
1014
|
}
|
|
980
1015
|
if (targetStart) hostRemove(targetStart);
|
|
981
1016
|
if (targetAnchor) hostRemove(targetAnchor);
|
|
982
1017
|
doRemove && hostRemove(anchor);
|
|
983
|
-
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
1018
|
+
if (!pendingMount && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
984
1019
|
const child = children[i];
|
|
985
1020
|
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
986
1021
|
}
|
|
@@ -1632,15 +1667,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1632
1667
|
}
|
|
1633
1668
|
if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
|
|
1634
1669
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1635
|
-
|
|
1670
|
+
if (next && !isMismatchAllowed(el, 1)) {
|
|
1671
|
+
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
1672
|
+
logMismatchError();
|
|
1673
|
+
}
|
|
1636
1674
|
while (next) {
|
|
1637
|
-
if (!isMismatchAllowed(el, 1)) {
|
|
1638
|
-
if (!hasWarned) {
|
|
1639
|
-
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
1640
|
-
hasWarned = true;
|
|
1641
|
-
}
|
|
1642
|
-
logMismatchError();
|
|
1643
|
-
}
|
|
1644
1675
|
const cur = next;
|
|
1645
1676
|
next = next.nextSibling;
|
|
1646
1677
|
remove(cur);
|
|
@@ -1679,7 +1710,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1679
1710
|
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
1680
1711
|
const children = parentVNode.children;
|
|
1681
1712
|
const l = children.length;
|
|
1682
|
-
let
|
|
1713
|
+
let hasCheckedMismatch = false;
|
|
1683
1714
|
for (let i = 0; i < l; i++) {
|
|
1684
1715
|
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
1685
1716
|
const isText = vnode.type === Text;
|
|
@@ -1693,12 +1724,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1693
1724
|
node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1694
1725
|
} else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
|
|
1695
1726
|
else {
|
|
1696
|
-
if (!
|
|
1697
|
-
|
|
1727
|
+
if (!hasCheckedMismatch) {
|
|
1728
|
+
hasCheckedMismatch = true;
|
|
1729
|
+
if (!isMismatchAllowed(container, 1)) {
|
|
1698
1730
|
warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
|
|
1699
|
-
|
|
1731
|
+
logMismatchError();
|
|
1700
1732
|
}
|
|
1701
|
-
logMismatchError();
|
|
1702
1733
|
}
|
|
1703
1734
|
patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
1704
1735
|
}
|
|
@@ -2485,6 +2516,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
2485
2516
|
slot: vaporSlot,
|
|
2486
2517
|
fallback
|
|
2487
2518
|
};
|
|
2519
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
2488
2520
|
return ret;
|
|
2489
2521
|
}
|
|
2490
2522
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
@@ -4716,8 +4748,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4716
4748
|
else hostInsert(el, container, anchor);
|
|
4717
4749
|
};
|
|
4718
4750
|
const performLeave = () => {
|
|
4751
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
4719
4752
|
if (el._isLeaving) el[leaveCbKey](true);
|
|
4720
|
-
|
|
4753
|
+
if (transition.persisted && !wasLeaving) remove();
|
|
4754
|
+
else leave(el, () => {
|
|
4721
4755
|
remove();
|
|
4722
4756
|
afterLeave && afterLeave();
|
|
4723
4757
|
});
|
|
@@ -4938,6 +4972,10 @@ function invalidateMount(hooks) {
|
|
|
4938
4972
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
4939
4973
|
}
|
|
4940
4974
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
4975
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
4976
|
+
insert();
|
|
4977
|
+
return;
|
|
4978
|
+
}
|
|
4941
4979
|
if (force || needTransition(parentSuspense, transition)) {
|
|
4942
4980
|
transition.beforeEnter(el);
|
|
4943
4981
|
insert();
|
|
@@ -6194,7 +6232,7 @@ function isMemoSame(cached, memo) {
|
|
|
6194
6232
|
}
|
|
6195
6233
|
//#endregion
|
|
6196
6234
|
//#region packages/runtime-core/src/index.ts
|
|
6197
|
-
const version = "3.6.0-beta.
|
|
6235
|
+
const version = "3.6.0-beta.14";
|
|
6198
6236
|
const warn = warn$1;
|
|
6199
6237
|
/**
|
|
6200
6238
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-beta.
|
|
2
|
+
* @vue/runtime-core v3.6.0-beta.14
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -273,6 +273,7 @@ function flushJobs(seen) {
|
|
|
273
273
|
}
|
|
274
274
|
flushIndex = 0;
|
|
275
275
|
jobsLength = 0;
|
|
276
|
+
jobs.length = 0;
|
|
276
277
|
flushPostFlushCbs(seen);
|
|
277
278
|
currentFlushPromise = null;
|
|
278
279
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -623,17 +624,16 @@ const TeleportImpl = {
|
|
|
623
624
|
},
|
|
624
625
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
625
626
|
const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
|
|
626
|
-
|
|
627
|
+
const shouldRemove = doRemove || !isTeleportDisabled(props);
|
|
627
628
|
const pendingMount = pendingMounts.get(vnode);
|
|
628
629
|
if (pendingMount) {
|
|
629
630
|
pendingMount.flags |= 4;
|
|
630
631
|
pendingMounts.delete(vnode);
|
|
631
|
-
shouldRemove = false;
|
|
632
632
|
}
|
|
633
633
|
if (targetStart) hostRemove(targetStart);
|
|
634
634
|
if (targetAnchor) hostRemove(targetAnchor);
|
|
635
635
|
doRemove && hostRemove(anchor);
|
|
636
|
-
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
636
|
+
if (!pendingMount && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
637
637
|
const child = children[i];
|
|
638
638
|
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
639
639
|
}
|
|
@@ -1256,8 +1256,8 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1256
1256
|
}
|
|
1257
1257
|
if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
|
|
1258
1258
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1259
|
+
if (next && !isMismatchAllowed(el, 1)) logMismatchError();
|
|
1259
1260
|
while (next) {
|
|
1260
|
-
if (!isMismatchAllowed(el, 1)) logMismatchError();
|
|
1261
1261
|
const cur = next;
|
|
1262
1262
|
next = next.nextSibling;
|
|
1263
1263
|
remove(cur);
|
|
@@ -1293,6 +1293,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1293
1293
|
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
1294
1294
|
const children = parentVNode.children;
|
|
1295
1295
|
const l = children.length;
|
|
1296
|
+
let hasCheckedMismatch = false;
|
|
1296
1297
|
for (let i = 0; i < l; i++) {
|
|
1297
1298
|
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
1298
1299
|
const isText = vnode.type === Text;
|
|
@@ -1306,7 +1307,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1306
1307
|
node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1307
1308
|
} else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
|
|
1308
1309
|
else {
|
|
1309
|
-
if (!
|
|
1310
|
+
if (!hasCheckedMismatch) {
|
|
1311
|
+
hasCheckedMismatch = true;
|
|
1312
|
+
if (!isMismatchAllowed(container, 1)) logMismatchError();
|
|
1313
|
+
}
|
|
1310
1314
|
patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
1311
1315
|
}
|
|
1312
1316
|
}
|
|
@@ -1964,6 +1968,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
1964
1968
|
slot: vaporSlot,
|
|
1965
1969
|
fallback
|
|
1966
1970
|
};
|
|
1971
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
1967
1972
|
return ret;
|
|
1968
1973
|
}
|
|
1969
1974
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
@@ -3709,8 +3714,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3709
3714
|
else hostInsert(el, container, anchor);
|
|
3710
3715
|
};
|
|
3711
3716
|
const performLeave = () => {
|
|
3717
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
3712
3718
|
if (el._isLeaving) el[leaveCbKey](true);
|
|
3713
|
-
|
|
3719
|
+
if (transition.persisted && !wasLeaving) remove();
|
|
3720
|
+
else leave(el, () => {
|
|
3714
3721
|
remove();
|
|
3715
3722
|
afterLeave && afterLeave();
|
|
3716
3723
|
});
|
|
@@ -3919,6 +3926,10 @@ function invalidateMount(hooks) {
|
|
|
3919
3926
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
3920
3927
|
}
|
|
3921
3928
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
3929
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
3930
|
+
insert();
|
|
3931
|
+
return;
|
|
3932
|
+
}
|
|
3922
3933
|
if (force || needTransition(parentSuspense, transition)) {
|
|
3923
3934
|
transition.beforeEnter(el);
|
|
3924
3935
|
insert();
|
|
@@ -4882,7 +4893,7 @@ function isMemoSame(cached, memo) {
|
|
|
4882
4893
|
}
|
|
4883
4894
|
//#endregion
|
|
4884
4895
|
//#region packages/runtime-core/src/index.ts
|
|
4885
|
-
const version = "3.6.0-beta.
|
|
4896
|
+
const version = "3.6.0-beta.14";
|
|
4886
4897
|
const warn = _vue_shared.NOOP;
|
|
4887
4898
|
/**
|
|
4888
4899
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-beta.
|
|
2
|
+
* @vue/runtime-core v3.6.0-beta.14
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -389,6 +389,7 @@ function flushJobs(seen) {
|
|
|
389
389
|
}
|
|
390
390
|
flushIndex = 0;
|
|
391
391
|
jobsLength = 0;
|
|
392
|
+
jobs.length = 0;
|
|
392
393
|
flushPostFlushCbs(seen);
|
|
393
394
|
currentFlushPromise = null;
|
|
394
395
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -446,6 +447,14 @@ function createRecord(id, initialDef) {
|
|
|
446
447
|
function normalizeClassComponent(component) {
|
|
447
448
|
return isClassComponent(component) ? component.__vccOpts : component;
|
|
448
449
|
}
|
|
450
|
+
function hasDirtyAncestor(instance, dirtyInstances) {
|
|
451
|
+
let parent = instance.parent;
|
|
452
|
+
while (parent) {
|
|
453
|
+
if (dirtyInstances.has(parent)) return true;
|
|
454
|
+
parent = parent.parent;
|
|
455
|
+
}
|
|
456
|
+
return false;
|
|
457
|
+
}
|
|
449
458
|
function rerender(id, newRender) {
|
|
450
459
|
const record = map.get(id);
|
|
451
460
|
if (!record) return;
|
|
@@ -477,42 +486,69 @@ function reload(id, newComp) {
|
|
|
477
486
|
const isVapor = record.initialDef.__vapor;
|
|
478
487
|
updateComponentDef(record.initialDef, newComp);
|
|
479
488
|
const instances = [...record.instances];
|
|
480
|
-
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
489
|
+
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
481
490
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
const
|
|
485
|
-
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
486
|
-
if (!dirtyInstances) {
|
|
487
|
-
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
488
|
-
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
489
|
-
}
|
|
490
|
-
dirtyInstances.add(instance);
|
|
491
|
-
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
492
|
-
instance.appContext.propsCache.delete(instance.type);
|
|
493
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
494
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
495
|
-
if (instance.ceReload) {
|
|
496
|
-
dirtyInstances.add(instance);
|
|
497
|
-
instance.ceReload(newComp.styles);
|
|
498
|
-
dirtyInstances.delete(instance);
|
|
499
|
-
} else if (instance.parent) queueJob(() => {
|
|
500
|
-
isHmrUpdating = true;
|
|
491
|
+
const dirtyInstances = new Set(instances);
|
|
492
|
+
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
493
|
+
for (const instance of instances) {
|
|
501
494
|
const parent = instance.parent;
|
|
502
|
-
if (parent
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
495
|
+
if (parent) {
|
|
496
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
497
|
+
rerenderedParents.add(parent);
|
|
498
|
+
parent.hmrRerender();
|
|
499
|
+
}
|
|
500
|
+
} else instance.hmrReload(newComp);
|
|
501
|
+
}
|
|
502
|
+
} else {
|
|
503
|
+
const parentUpdates = /* @__PURE__ */ new Map();
|
|
504
|
+
const dirtyInstanceSet = new Set(instances);
|
|
505
|
+
for (const instance of instances) {
|
|
506
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
507
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
508
|
+
if (!dirtyInstances) {
|
|
509
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
510
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
506
511
|
}
|
|
507
|
-
|
|
508
|
-
|
|
512
|
+
dirtyInstances.add(instance);
|
|
513
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
514
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
515
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
516
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
517
|
+
if (instance.ceReload) {
|
|
518
|
+
dirtyInstances.add(instance);
|
|
519
|
+
instance.ceReload(newComp.styles);
|
|
520
|
+
dirtyInstances.delete(instance);
|
|
521
|
+
} else if (instance.parent) {
|
|
522
|
+
const parent = instance.parent;
|
|
523
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
524
|
+
let updates = parentUpdates.get(parent);
|
|
525
|
+
if (!updates) parentUpdates.set(parent, updates = []);
|
|
526
|
+
updates.push([instance, dirtyInstances]);
|
|
527
|
+
}
|
|
528
|
+
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
529
|
+
else if (typeof window !== "undefined") window.location.reload();
|
|
530
|
+
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
531
|
+
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
532
|
+
}
|
|
533
|
+
parentUpdates.forEach((updates, parent) => {
|
|
534
|
+
queueJob(() => {
|
|
535
|
+
isHmrUpdating = true;
|
|
536
|
+
if (parent.vapor) parent.hmrRerender();
|
|
537
|
+
else {
|
|
538
|
+
const i = parent;
|
|
539
|
+
if (!(i.effect.flags & 1024)) {
|
|
540
|
+
i.renderCache = [];
|
|
541
|
+
i.effect.run();
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
nextTick(() => {
|
|
545
|
+
isHmrUpdating = false;
|
|
546
|
+
});
|
|
547
|
+
updates.forEach(([instance, dirtyInstances]) => {
|
|
548
|
+
dirtyInstances.delete(instance);
|
|
549
|
+
});
|
|
509
550
|
});
|
|
510
|
-
dirtyInstances.delete(instance);
|
|
511
551
|
});
|
|
512
|
-
else if (instance.appContext.reload) instance.appContext.reload();
|
|
513
|
-
else if (typeof window !== "undefined") window.location.reload();
|
|
514
|
-
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
515
|
-
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
516
552
|
}
|
|
517
553
|
queuePostFlushCb(() => {
|
|
518
554
|
hmrDirtyComponents.clear();
|
|
@@ -978,17 +1014,16 @@ const TeleportImpl = {
|
|
|
978
1014
|
},
|
|
979
1015
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
980
1016
|
const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
|
|
981
|
-
|
|
1017
|
+
const shouldRemove = doRemove || !isTeleportDisabled(props);
|
|
982
1018
|
const pendingMount = pendingMounts.get(vnode);
|
|
983
1019
|
if (pendingMount) {
|
|
984
1020
|
pendingMount.flags |= 4;
|
|
985
1021
|
pendingMounts.delete(vnode);
|
|
986
|
-
shouldRemove = false;
|
|
987
1022
|
}
|
|
988
1023
|
if (targetStart) hostRemove(targetStart);
|
|
989
1024
|
if (targetAnchor) hostRemove(targetAnchor);
|
|
990
1025
|
doRemove && hostRemove(anchor);
|
|
991
|
-
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
1026
|
+
if (!pendingMount && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
992
1027
|
const child = children[i];
|
|
993
1028
|
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
994
1029
|
}
|
|
@@ -1654,15 +1689,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1654
1689
|
}
|
|
1655
1690
|
if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
|
|
1656
1691
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1657
|
-
|
|
1692
|
+
if (next && !isMismatchAllowed(el, 1)) {
|
|
1693
|
+
(process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
1694
|
+
logMismatchError();
|
|
1695
|
+
}
|
|
1658
1696
|
while (next) {
|
|
1659
|
-
if (!isMismatchAllowed(el, 1)) {
|
|
1660
|
-
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
|
|
1661
|
-
warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
|
|
1662
|
-
hasWarned = true;
|
|
1663
|
-
}
|
|
1664
|
-
logMismatchError();
|
|
1665
|
-
}
|
|
1666
1697
|
const cur = next;
|
|
1667
1698
|
next = next.nextSibling;
|
|
1668
1699
|
remove(cur);
|
|
@@ -1704,7 +1735,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1704
1735
|
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
1705
1736
|
const children = parentVNode.children;
|
|
1706
1737
|
const l = children.length;
|
|
1707
|
-
let
|
|
1738
|
+
let hasCheckedMismatch = false;
|
|
1708
1739
|
for (let i = 0; i < l; i++) {
|
|
1709
1740
|
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
1710
1741
|
const isText = vnode.type === Text;
|
|
@@ -1718,12 +1749,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1718
1749
|
node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1719
1750
|
} else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
|
|
1720
1751
|
else {
|
|
1721
|
-
if (!
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1752
|
+
if (!hasCheckedMismatch) {
|
|
1753
|
+
hasCheckedMismatch = true;
|
|
1754
|
+
if (!isMismatchAllowed(container, 1)) {
|
|
1755
|
+
(process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
|
|
1756
|
+
logMismatchError();
|
|
1725
1757
|
}
|
|
1726
|
-
logMismatchError();
|
|
1727
1758
|
}
|
|
1728
1759
|
patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
1729
1760
|
}
|
|
@@ -2522,6 +2553,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
2522
2553
|
slot: vaporSlot,
|
|
2523
2554
|
fallback
|
|
2524
2555
|
};
|
|
2556
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
2525
2557
|
return ret;
|
|
2526
2558
|
}
|
|
2527
2559
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
@@ -4803,8 +4835,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4803
4835
|
else hostInsert(el, container, anchor);
|
|
4804
4836
|
};
|
|
4805
4837
|
const performLeave = () => {
|
|
4838
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
4806
4839
|
if (el._isLeaving) el[leaveCbKey](true);
|
|
4807
|
-
|
|
4840
|
+
if (transition.persisted && !wasLeaving) remove();
|
|
4841
|
+
else leave(el, () => {
|
|
4808
4842
|
remove();
|
|
4809
4843
|
afterLeave && afterLeave();
|
|
4810
4844
|
});
|
|
@@ -5025,6 +5059,10 @@ function invalidateMount(hooks) {
|
|
|
5025
5059
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
5026
5060
|
}
|
|
5027
5061
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
5062
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
5063
|
+
insert();
|
|
5064
|
+
return;
|
|
5065
|
+
}
|
|
5028
5066
|
if (force || needTransition(parentSuspense, transition)) {
|
|
5029
5067
|
transition.beforeEnter(el);
|
|
5030
5068
|
insert();
|
|
@@ -6302,7 +6340,7 @@ function isMemoSame(cached, memo) {
|
|
|
6302
6340
|
}
|
|
6303
6341
|
//#endregion
|
|
6304
6342
|
//#region packages/runtime-core/src/index.ts
|
|
6305
|
-
const version = "3.6.0-beta.
|
|
6343
|
+
const version = "3.6.0-beta.14";
|
|
6306
6344
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
6307
6345
|
/**
|
|
6308
6346
|
* Runtime error messages. Only exposed in dev or esm builds.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.6.0-beta.
|
|
3
|
+
"version": "3.6.0-beta.14",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@vue/shared": "3.6.0-beta.
|
|
50
|
-
"@vue/reactivity": "3.6.0-beta.
|
|
49
|
+
"@vue/shared": "3.6.0-beta.14",
|
|
50
|
+
"@vue/reactivity": "3.6.0-beta.14"
|
|
51
51
|
}
|
|
52
52
|
}
|