Skip to content

Commit

Permalink
fix(runtime-core): adjust force diff of dev root fragments
Browse files Browse the repository at this point in the history
fix #5946
  • Loading branch information
yyx990803 committed May 18, 2022
1 parent b60cff0 commit cdda49b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/runtime-core/src/renderer.ts
Expand Up @@ -1064,8 +1064,12 @@ function baseCreateRenderer(

let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2

if (__DEV__ && isHmrUpdating) {
// HMR updated, force full diff
if (
__DEV__ &&
// #5523 dev root fragment may inherit directives
(isHmrUpdating || patchFlag & PatchFlags.DEV_ROOT_FRAGMENT)
) {
// HMR updated / Dev root fragment (w/ comments), force full diff
patchFlag = 0
optimized = false
dynamicChildren = null
Expand Down Expand Up @@ -1098,8 +1102,6 @@ function baseCreateRenderer(
if (
patchFlag > 0 &&
patchFlag & PatchFlags.STABLE_FRAGMENT &&
// #5523 dev root fragment may inherit directives so always force update
!(__DEV__ && patchFlag & PatchFlags.DEV_ROOT_FRAGMENT) &&
dynamicChildren &&
// #2715 the previous fragment could've been a BAILed one as a result
// of renderSlot() with no valid children
Expand Down

0 comments on commit cdda49b

Please sign in to comment.