Skip to content

Commit cdda49b

Browse files
committed
fix(runtime-core): adjust force diff of dev root fragments
fix #5946
1 parent b60cff0 commit cdda49b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/runtime-core/src/renderer.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -1064,8 +1064,12 @@ function baseCreateRenderer(
10641064

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

1067-
if (__DEV__ && isHmrUpdating) {
1068-
// HMR updated, force full diff
1067+
if (
1068+
__DEV__ &&
1069+
// #5523 dev root fragment may inherit directives
1070+
(isHmrUpdating || patchFlag & PatchFlags.DEV_ROOT_FRAGMENT)
1071+
) {
1072+
// HMR updated / Dev root fragment (w/ comments), force full diff
10691073
patchFlag = 0
10701074
optimized = false
10711075
dynamicChildren = null
@@ -1098,8 +1102,6 @@ function baseCreateRenderer(
10981102
if (
10991103
patchFlag > 0 &&
11001104
patchFlag & PatchFlags.STABLE_FRAGMENT &&
1101-
// #5523 dev root fragment may inherit directives so always force update
1102-
!(__DEV__ && patchFlag & PatchFlags.DEV_ROOT_FRAGMENT) &&
11031105
dynamicChildren &&
11041106
// #2715 the previous fragment could've been a BAILed one as a result
11051107
// of renderSlot() with no valid children

0 commit comments

Comments
 (0)