@vue/runtime-core 3.6.0-rc.8 → 3.6.0-rc.9
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 +28 -10
- package/dist/runtime-core.cjs.prod.js +28 -10
- package/dist/runtime-core.d.ts +3 -3
- package/dist/runtime-core.esm-bundler.js +29 -11
- package/package.json +3 -3
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.9
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -1727,12 +1727,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1727
1727
|
} else {
|
|
1728
1728
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
1729
1729
|
const component = vnode.component;
|
|
1730
|
-
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep
|
|
1730
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
1731
1731
|
let subTree;
|
|
1732
1732
|
if (isFragmentStart) {
|
|
1733
1733
|
subTree = createVNode(Static);
|
|
1734
1734
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1735
|
-
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
1735
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
1736
1736
|
subTree.el = node;
|
|
1737
1737
|
component.subTree = subTree;
|
|
1738
1738
|
}
|
|
@@ -4364,6 +4364,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4364
4364
|
optimized = false;
|
|
4365
4365
|
n2.dynamicChildren = null;
|
|
4366
4366
|
}
|
|
4367
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
4368
|
+
if (n2.dynamicChildren === _vue_shared.EMPTY_ARR) n2.dynamicChildren = [];
|
|
4369
|
+
n2.dynamicChildren.hasOnce = true;
|
|
4370
|
+
}
|
|
4367
4371
|
const { type, ref, shapeFlag } = n2;
|
|
4368
4372
|
switch (type) {
|
|
4369
4373
|
case Text:
|
|
@@ -4680,6 +4684,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4680
4684
|
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
4681
4685
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4682
4686
|
pushWarningContext(n2);
|
|
4687
|
+
n2.el = n1.el;
|
|
4683
4688
|
updateComponentPreRender(instance, n2, optimized);
|
|
4684
4689
|
popWarningContext();
|
|
4685
4690
|
return;
|
|
@@ -4988,13 +4993,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4988
4993
|
};
|
|
4989
4994
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
4990
4995
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
4991
|
-
if (patchFlag === -2) optimized = false;
|
|
4996
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
4992
4997
|
if (ref != null) {
|
|
4993
4998
|
const prevSub = (0, _vue_reactivity.setActiveSub)();
|
|
4994
4999
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
4995
5000
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
4996
5001
|
}
|
|
4997
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
5002
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
4998
5003
|
if (shapeFlag & 256) {
|
|
4999
5004
|
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
5000
5005
|
else parentComponent.ctx.deactivate(vnode);
|
|
@@ -5048,6 +5053,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5048
5053
|
}
|
|
5049
5054
|
if (type === Static) {
|
|
5050
5055
|
removeStaticNode(vnode);
|
|
5056
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
5051
5057
|
return;
|
|
5052
5058
|
}
|
|
5053
5059
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -5072,7 +5078,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5072
5078
|
if (effect) {
|
|
5073
5079
|
effect.stop();
|
|
5074
5080
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5075
|
-
} else if (
|
|
5081
|
+
} else if (instance.vnode.el && subTree) {
|
|
5082
|
+
subTree.transition = instance.vnode.transition;
|
|
5083
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5084
|
+
}
|
|
5076
5085
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
5077
5086
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
5078
5087
|
devtoolsComponentRemoved(instance);
|
|
@@ -5278,7 +5287,7 @@ const Suspense = {
|
|
|
5278
5287
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
5279
5288
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
5280
5289
|
else {
|
|
5281
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
5290
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
5282
5291
|
n2.suspense = n1.suspense;
|
|
5283
5292
|
n2.suspense.vnode = n2;
|
|
5284
5293
|
n2.el = n1.el;
|
|
@@ -5316,7 +5325,9 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5316
5325
|
if (pendingBranch) {
|
|
5317
5326
|
suspense.pendingBranch = newBranch;
|
|
5318
5327
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
5319
|
-
|
|
5328
|
+
suspense.deps++;
|
|
5329
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
5330
|
+
suspense.deps--;
|
|
5320
5331
|
if (suspense.deps <= 0) suspense.resolve();
|
|
5321
5332
|
else if (isInFallback) {
|
|
5322
5333
|
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
@@ -5452,6 +5463,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5452
5463
|
suspense.effects = [];
|
|
5453
5464
|
if (isSuspensible) {
|
|
5454
5465
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
5466
|
+
parentSuspenseId = void 0;
|
|
5455
5467
|
parentSuspense.deps--;
|
|
5456
5468
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
5457
5469
|
}
|
|
@@ -5489,11 +5501,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5489
5501
|
registerDep(instance, onResolve) {
|
|
5490
5502
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
5491
5503
|
if (isInPendingSuspense) suspense.deps++;
|
|
5504
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
5492
5505
|
instance.asyncDep.catch((err) => {
|
|
5493
5506
|
handleError(err, instance, 0);
|
|
5494
5507
|
}).then((asyncSetupResult) => {
|
|
5495
5508
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
5496
5509
|
setCurrentInstance(null, void 0);
|
|
5510
|
+
if (hydratedEl && !instance.scope.active) {
|
|
5511
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
5512
|
+
return;
|
|
5513
|
+
}
|
|
5497
5514
|
instance.asyncResolved = true;
|
|
5498
5515
|
onResolve(asyncSetupResult);
|
|
5499
5516
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -5806,7 +5823,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5806
5823
|
vs: cloneVaporSlotMeta(vnode),
|
|
5807
5824
|
vb: vnode.vb,
|
|
5808
5825
|
ibu: vnode.ibu,
|
|
5809
|
-
iu: vnode.iu
|
|
5826
|
+
iu: vnode.iu,
|
|
5827
|
+
cacheIndex: vnode.cacheIndex
|
|
5810
5828
|
};
|
|
5811
5829
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5812
5830
|
return cloned;
|
|
@@ -6517,7 +6535,7 @@ function isMemoSame(cached, memo) {
|
|
|
6517
6535
|
}
|
|
6518
6536
|
//#endregion
|
|
6519
6537
|
//#region packages/runtime-core/src/index.ts
|
|
6520
|
-
const version = "3.6.0-rc.
|
|
6538
|
+
const version = "3.6.0-rc.9";
|
|
6521
6539
|
const warn = warn$1;
|
|
6522
6540
|
/**
|
|
6523
6541
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.9
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -1304,12 +1304,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1304
1304
|
} else {
|
|
1305
1305
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
1306
1306
|
const component = vnode.component;
|
|
1307
|
-
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep
|
|
1307
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
1308
1308
|
let subTree;
|
|
1309
1309
|
if (isFragmentStart) {
|
|
1310
1310
|
subTree = createVNode(Static);
|
|
1311
1311
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1312
|
-
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
1312
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
1313
1313
|
subTree.el = node;
|
|
1314
1314
|
component.subTree = subTree;
|
|
1315
1315
|
}
|
|
@@ -3352,6 +3352,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3352
3352
|
optimized = false;
|
|
3353
3353
|
n2.dynamicChildren = null;
|
|
3354
3354
|
}
|
|
3355
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
3356
|
+
if (n2.dynamicChildren === _vue_shared.EMPTY_ARR) n2.dynamicChildren = [];
|
|
3357
|
+
n2.dynamicChildren.hasOnce = true;
|
|
3358
|
+
}
|
|
3355
3359
|
const { type, ref, shapeFlag } = n2;
|
|
3356
3360
|
switch (type) {
|
|
3357
3361
|
case Text:
|
|
@@ -3625,6 +3629,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3625
3629
|
const instance = n2.component = n1.component;
|
|
3626
3630
|
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
3627
3631
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
3632
|
+
n2.el = n1.el;
|
|
3628
3633
|
updateComponentPreRender(instance, n2, optimized);
|
|
3629
3634
|
return;
|
|
3630
3635
|
} else {
|
|
@@ -3911,13 +3916,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3911
3916
|
};
|
|
3912
3917
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
3913
3918
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
3914
|
-
if (patchFlag === -2) optimized = false;
|
|
3919
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
3915
3920
|
if (ref != null) {
|
|
3916
3921
|
const prevSub = (0, _vue_reactivity.setActiveSub)();
|
|
3917
3922
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
3918
3923
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
3919
3924
|
}
|
|
3920
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
3925
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
3921
3926
|
if (shapeFlag & 256) {
|
|
3922
3927
|
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
3923
3928
|
else parentComponent.ctx.deactivate(vnode);
|
|
@@ -3967,6 +3972,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3967
3972
|
}
|
|
3968
3973
|
if (type === Static) {
|
|
3969
3974
|
removeStaticNode(vnode);
|
|
3975
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
3970
3976
|
return;
|
|
3971
3977
|
}
|
|
3972
3978
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -3990,7 +3996,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3990
3996
|
if (effect) {
|
|
3991
3997
|
effect.stop();
|
|
3992
3998
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
3993
|
-
} else if (
|
|
3999
|
+
} else if (instance.vnode.el && subTree) {
|
|
4000
|
+
subTree.transition = instance.vnode.transition;
|
|
4001
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
4002
|
+
}
|
|
3994
4003
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
3995
4004
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
3996
4005
|
};
|
|
@@ -4185,7 +4194,7 @@ const Suspense = {
|
|
|
4185
4194
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
4186
4195
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
4187
4196
|
else {
|
|
4188
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
4197
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
4189
4198
|
n2.suspense = n1.suspense;
|
|
4190
4199
|
n2.suspense.vnode = n2;
|
|
4191
4200
|
n2.el = n1.el;
|
|
@@ -4223,7 +4232,9 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
4223
4232
|
if (pendingBranch) {
|
|
4224
4233
|
suspense.pendingBranch = newBranch;
|
|
4225
4234
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
4226
|
-
|
|
4235
|
+
suspense.deps++;
|
|
4236
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
4237
|
+
suspense.deps--;
|
|
4227
4238
|
if (suspense.deps <= 0) suspense.resolve();
|
|
4228
4239
|
else if (isInFallback) {
|
|
4229
4240
|
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
@@ -4350,6 +4361,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4350
4361
|
suspense.effects = [];
|
|
4351
4362
|
if (isSuspensible) {
|
|
4352
4363
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
4364
|
+
parentSuspenseId = void 0;
|
|
4353
4365
|
parentSuspense.deps--;
|
|
4354
4366
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
4355
4367
|
}
|
|
@@ -4387,11 +4399,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4387
4399
|
registerDep(instance, onResolve) {
|
|
4388
4400
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
4389
4401
|
if (isInPendingSuspense) suspense.deps++;
|
|
4402
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
4390
4403
|
instance.asyncDep.catch((err) => {
|
|
4391
4404
|
handleError(err, instance, 0);
|
|
4392
4405
|
}).then((asyncSetupResult) => {
|
|
4393
4406
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
4394
4407
|
setCurrentInstance(null, void 0);
|
|
4408
|
+
if (hydratedEl && !instance.scope.active) {
|
|
4409
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
4410
|
+
return;
|
|
4411
|
+
}
|
|
4395
4412
|
instance.asyncResolved = true;
|
|
4396
4413
|
onResolve(asyncSetupResult);
|
|
4397
4414
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -4663,7 +4680,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
4663
4680
|
vs: cloneVaporSlotMeta(vnode),
|
|
4664
4681
|
vb: vnode.vb,
|
|
4665
4682
|
ibu: vnode.ibu,
|
|
4666
|
-
iu: vnode.iu
|
|
4683
|
+
iu: vnode.iu,
|
|
4684
|
+
cacheIndex: vnode.cacheIndex
|
|
4667
4685
|
};
|
|
4668
4686
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
4669
4687
|
return cloned;
|
|
@@ -5110,7 +5128,7 @@ function isMemoSame(cached, memo) {
|
|
|
5110
5128
|
}
|
|
5111
5129
|
//#endregion
|
|
5112
5130
|
//#region packages/runtime-core/src/index.ts
|
|
5113
|
-
const version = "3.6.0-rc.
|
|
5131
|
+
const version = "3.6.0-rc.9";
|
|
5114
5132
|
const warn = _vue_shared.NOOP;
|
|
5115
5133
|
/**
|
|
5116
5134
|
* Runtime error messages. Only exposed in dev or esm builds.
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -81,11 +81,11 @@ type PropConstructor<T = any> = {
|
|
|
81
81
|
} | {
|
|
82
82
|
(): T;
|
|
83
83
|
} | PropMethod<T>;
|
|
84
|
-
type PropMethod<T, TConstructor = any> =
|
|
84
|
+
type PropMethod<T, TConstructor = any> = {
|
|
85
85
|
new (): TConstructor;
|
|
86
86
|
(): T;
|
|
87
87
|
readonly prototype: TConstructor;
|
|
88
|
-
}
|
|
88
|
+
};
|
|
89
89
|
type RequiredKeys<T> = { [K in keyof T]: T[K] extends {
|
|
90
90
|
required: true;
|
|
91
91
|
} | {
|
|
@@ -114,7 +114,7 @@ type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends
|
|
|
114
114
|
type: DateConstructor;
|
|
115
115
|
}] ? Date : [T] extends [(infer U)[] | {
|
|
116
116
|
type: (infer U)[];
|
|
117
|
-
}] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<V, V, D> : V : V : T;
|
|
117
|
+
}] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<V, V, unknown extends D ? V : D> : V : V : T;
|
|
118
118
|
/**
|
|
119
119
|
* Extract prop types from a runtime props options object.
|
|
120
120
|
* The extracted types are **internal** - i.e. the resolved props received by
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.9
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -1762,12 +1762,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1762
1762
|
} else {
|
|
1763
1763
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
1764
1764
|
const component = vnode.component;
|
|
1765
|
-
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep
|
|
1765
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
1766
1766
|
let subTree;
|
|
1767
1767
|
if (isFragmentStart) {
|
|
1768
1768
|
subTree = createVNode(Static);
|
|
1769
1769
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1770
|
-
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
1770
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
1771
1771
|
subTree.el = node;
|
|
1772
1772
|
component.subTree = subTree;
|
|
1773
1773
|
}
|
|
@@ -4456,6 +4456,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4456
4456
|
optimized = false;
|
|
4457
4457
|
n2.dynamicChildren = null;
|
|
4458
4458
|
}
|
|
4459
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
4460
|
+
if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
|
|
4461
|
+
n2.dynamicChildren.hasOnce = true;
|
|
4462
|
+
}
|
|
4459
4463
|
const { type, ref, shapeFlag } = n2;
|
|
4460
4464
|
switch (type) {
|
|
4461
4465
|
case Text:
|
|
@@ -4779,6 +4783,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4779
4783
|
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
4780
4784
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4781
4785
|
if (!!(process.env.NODE_ENV !== "production")) pushWarningContext(n2);
|
|
4786
|
+
n2.el = n1.el;
|
|
4782
4787
|
updateComponentPreRender(instance, n2, optimized);
|
|
4783
4788
|
if (!!(process.env.NODE_ENV !== "production")) popWarningContext();
|
|
4784
4789
|
return;
|
|
@@ -5089,13 +5094,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5089
5094
|
};
|
|
5090
5095
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
5091
5096
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
5092
|
-
if (patchFlag === -2) optimized = false;
|
|
5097
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
5093
5098
|
if (ref != null) {
|
|
5094
5099
|
const prevSub = setActiveSub();
|
|
5095
5100
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
5096
5101
|
setActiveSub(prevSub);
|
|
5097
5102
|
}
|
|
5098
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
5103
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
5099
5104
|
if (shapeFlag & 256) {
|
|
5100
5105
|
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
5101
5106
|
else parentComponent.ctx.deactivate(vnode);
|
|
@@ -5149,6 +5154,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5149
5154
|
}
|
|
5150
5155
|
if (type === Static) {
|
|
5151
5156
|
removeStaticNode(vnode);
|
|
5157
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
5152
5158
|
return;
|
|
5153
5159
|
}
|
|
5154
5160
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -5173,7 +5179,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5173
5179
|
if (effect) {
|
|
5174
5180
|
effect.stop();
|
|
5175
5181
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5176
|
-
} else if (
|
|
5182
|
+
} else if (instance.vnode.el && subTree) {
|
|
5183
|
+
subTree.transition = instance.vnode.transition;
|
|
5184
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5185
|
+
}
|
|
5177
5186
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
5178
5187
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
5179
5188
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) devtoolsComponentRemoved(instance);
|
|
@@ -5379,7 +5388,7 @@ const Suspense = {
|
|
|
5379
5388
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
5380
5389
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
5381
5390
|
else {
|
|
5382
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
5391
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
5383
5392
|
n2.suspense = n1.suspense;
|
|
5384
5393
|
n2.suspense.vnode = n2;
|
|
5385
5394
|
n2.el = n1.el;
|
|
@@ -5417,7 +5426,9 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5417
5426
|
if (pendingBranch) {
|
|
5418
5427
|
suspense.pendingBranch = newBranch;
|
|
5419
5428
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
5420
|
-
|
|
5429
|
+
suspense.deps++;
|
|
5430
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
5431
|
+
suspense.deps--;
|
|
5421
5432
|
if (suspense.deps <= 0) suspense.resolve();
|
|
5422
5433
|
else if (isInFallback) {
|
|
5423
5434
|
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
@@ -5555,6 +5566,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5555
5566
|
suspense.effects = [];
|
|
5556
5567
|
if (isSuspensible) {
|
|
5557
5568
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
5569
|
+
parentSuspenseId = void 0;
|
|
5558
5570
|
parentSuspense.deps--;
|
|
5559
5571
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
5560
5572
|
}
|
|
@@ -5592,11 +5604,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5592
5604
|
registerDep(instance, onResolve) {
|
|
5593
5605
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
5594
5606
|
if (isInPendingSuspense) suspense.deps++;
|
|
5607
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
5595
5608
|
instance.asyncDep.catch((err) => {
|
|
5596
5609
|
handleError(err, instance, 0);
|
|
5597
5610
|
}).then((asyncSetupResult) => {
|
|
5598
5611
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
5599
5612
|
setCurrentInstance(null, void 0);
|
|
5613
|
+
if (hydratedEl && !instance.scope.active) {
|
|
5614
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
5615
|
+
return;
|
|
5616
|
+
}
|
|
5600
5617
|
instance.asyncResolved = true;
|
|
5601
5618
|
onResolve(asyncSetupResult);
|
|
5602
5619
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -5909,7 +5926,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5909
5926
|
vs: cloneVaporSlotMeta(vnode),
|
|
5910
5927
|
vb: vnode.vb,
|
|
5911
5928
|
ibu: vnode.ibu,
|
|
5912
|
-
iu: vnode.iu
|
|
5929
|
+
iu: vnode.iu,
|
|
5930
|
+
cacheIndex: vnode.cacheIndex
|
|
5913
5931
|
};
|
|
5914
5932
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5915
5933
|
return cloned;
|
|
@@ -6639,7 +6657,7 @@ function isMemoSame(cached, memo) {
|
|
|
6639
6657
|
}
|
|
6640
6658
|
//#endregion
|
|
6641
6659
|
//#region packages/runtime-core/src/index.ts
|
|
6642
|
-
const version = "3.6.0-rc.
|
|
6660
|
+
const version = "3.6.0-rc.9";
|
|
6643
6661
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
6644
6662
|
/**
|
|
6645
6663
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -6674,4 +6692,4 @@ const resolveFilter = null;
|
|
|
6674
6692
|
const compatUtils = null;
|
|
6675
6693
|
const DeprecationTypes = null;
|
|
6676
6694
|
//#endregion
|
|
6677
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, TriggerOpTypes, VaporSlot, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureValidVNode, ensureVaporSlotFallback, expose, filterModelListeners, flushOnAppMount, getAttributeMismatch, getComponentName, getContainerType, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeClass, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepareTransitionLeave, prepareTransitionSwitch, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, rawVaporSlotKey, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, vdomSlotFallbackKey, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|
|
6695
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, TriggerOpTypes, VaporSlot, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, defaultPropGetter, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureValidVNode, ensureVaporSlotFallback, expose, filterModelListeners, flushOnAppMount, getAttributeMismatch, getComponentName, getContainerType, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeClass, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepareTransitionLeave, prepareTransitionSwitch, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, rawVaporSlotKey, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, vdomSlotFallbackKey, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.6.0-rc.
|
|
3
|
+
"version": "3.6.0-rc.9",
|
|
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-rc.
|
|
50
|
-
"@vue/reactivity": "3.6.0-rc.
|
|
49
|
+
"@vue/shared": "3.6.0-rc.9",
|
|
50
|
+
"@vue/reactivity": "3.6.0-rc.9"
|
|
51
51
|
}
|
|
52
52
|
}
|