@@ -632,32 +632,28 @@ function baseCreateRenderer(
632
632
}
633
633
}
634
634
635
- /**
636
- * Dev / HMR only
637
- */
638
635
const moveStaticNode = (
639
- vnode : VNode ,
636
+ { el , anchor } : VNode ,
640
637
container : RendererElement ,
641
- anchor : RendererNode | null
638
+ nextSibling : RendererNode | null
642
639
) => {
643
- let cur = vnode . el
644
- const end = vnode . anchor !
645
- while ( cur && cur !== end ) {
646
- const next = hostNextSibling ( cur )
647
- hostInsert ( cur , container , anchor )
648
- cur = next
640
+ let next
641
+ while ( el && el !== anchor ) {
642
+ next = hostNextSibling ( el )
643
+ hostInsert ( el , container , nextSibling )
644
+ el = next
649
645
}
650
- hostInsert ( end , container , anchor )
646
+ hostInsert ( anchor ! , container , nextSibling )
651
647
}
652
648
653
- const removeStaticNode = ( vnode : VNode ) => {
654
- let cur = vnode . el
655
- while ( cur && cur !== vnode . anchor ) {
656
- const next = hostNextSibling ( cur )
657
- hostRemove ( cur )
658
- cur = next
649
+ const removeStaticNode = ( { el , anchor } : VNode ) => {
650
+ let next
651
+ while ( el && el !== anchor ) {
652
+ next = hostNextSibling ( el )
653
+ hostRemove ( el )
654
+ el = next
659
655
}
660
- hostRemove ( vnode . anchor ! )
656
+ hostRemove ( anchor ! )
661
657
}
662
658
663
659
const processElement = (
@@ -1934,8 +1930,7 @@ function baseCreateRenderer(
1934
1930
return
1935
1931
}
1936
1932
1937
- // static node move can only happen when force updating HMR
1938
- if ( __DEV__ && type === Static ) {
1933
+ if ( type === Static ) {
1939
1934
moveStaticNode ( vnode , container , anchor )
1940
1935
return
1941
1936
}
0 commit comments