@@ -36,7 +36,6 @@ import { currentRenderingInstance } from './componentRenderUtils'
3636import { RendererNode , RendererElement } from './renderer'
3737import { NULL_DYNAMIC_COMPONENT } from './helpers/resolveAssets'
3838import { hmrDirtyComponents } from './hmr'
39- import { shouldTrackInSlotRendering } from './helpers/renderSlot'
4039
4140export const Fragment = ( Symbol ( __DEV__ ? 'Fragment' : undefined ) as any ) as {
4241 __isFragment : true
@@ -153,7 +152,7 @@ export interface VNode<
153152// can divide a template into nested blocks, and within each block the node
154153// structure would be stable. This allows us to skip most children diffing
155154// and only worry about the dynamic nodes (indicated by patch flags).
156- const blockStack : ( VNode [ ] | null ) [ ] = [ ]
155+ export const blockStack : ( VNode [ ] | null ) [ ] = [ ]
157156let currentBlock : VNode [ ] | null = null
158157
159158/**
@@ -176,6 +175,11 @@ export function openBlock(disableTracking = false) {
176175 blockStack . push ( ( currentBlock = disableTracking ? null : [ ] ) )
177176}
178177
178+ export function closeBlock ( ) {
179+ blockStack . pop ( )
180+ currentBlock = blockStack [ blockStack . length - 1 ] || null
181+ }
182+
179183// Whether we should be tracking dynamic child nodes inside a block.
180184// Only tracks when this value is > 0
181185// We are not using a simple boolean because this value may need to be
@@ -227,8 +231,7 @@ export function createBlock(
227231 // save current block children on the block vnode
228232 vnode . dynamicChildren = currentBlock || EMPTY_ARR
229233 // close block
230- blockStack . pop ( )
231- currentBlock = blockStack [ blockStack . length - 1 ] || null
234+ closeBlock ( )
232235 // a block is always going to be patched, so track it as a child of its
233236 // parent block
234237 if ( currentBlock ) {
@@ -403,7 +406,7 @@ function _createVNode(
403406 normalizeChildren ( vnode , children )
404407
405408 if (
406- ( shouldTrack > 0 || shouldTrackInSlotRendering > 0 ) &&
409+ shouldTrack > 0 &&
407410 // avoid a block node from tracking itself
408411 ! isBlockNode &&
409412 // has current parent block
0 commit comments