mirror of https://github.com/vuejs/core.git
perf: optimize hydration node management in createFor
This commit is contained in:
parent
12d5bb5653
commit
3fc644e22a
|
@ -131,20 +131,17 @@ export const createFor = (
|
||||||
|
|
||||||
if (!isMounted) {
|
if (!isMounted) {
|
||||||
isMounted = true
|
isMounted = true
|
||||||
|
let prevNodes: Block
|
||||||
for (let i = 0; i < newLength; i++) {
|
for (let i = 0; i < newLength; i++) {
|
||||||
if (isHydrating && isComponent && i > 0) {
|
if (isHydrating && isComponent && i > 0) {
|
||||||
setCurrentHydrationNode(
|
setCurrentHydrationNode(findLastChild(prevNodes!)!.nextSibling)
|
||||||
findLastChild(newBlocks[i - 1].nodes)!.nextSibling,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
mount(source, i)
|
prevNodes = mount(source, i).nodes
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isHydrating) {
|
if (isHydrating) {
|
||||||
if (isComponent) {
|
if (isComponent) {
|
||||||
setCurrentHydrationNode(
|
setCurrentHydrationNode(findLastChild(prevNodes!)!.nextSibling)
|
||||||
findLastChild(newBlocks[newLength - 1].nodes)!.nextSibling,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
parentAnchor =
|
parentAnchor =
|
||||||
newLength === 0
|
newLength === 0
|
||||||
|
|
Loading…
Reference in New Issue