@@ -36,7 +36,6 @@ import { currentRenderingInstance } from './componentRenderUtils'
36
36
import { RendererNode , RendererElement } from './renderer'
37
37
import { NULL_DYNAMIC_COMPONENT } from './helpers/resolveAssets'
38
38
import { hmrDirtyComponents } from './hmr'
39
- import { shouldTrackInSlotRendering } from './helpers/renderSlot'
40
39
41
40
export const Fragment = ( Symbol ( __DEV__ ? 'Fragment' : undefined ) as any ) as {
42
41
__isFragment : true
@@ -153,7 +152,7 @@ export interface VNode<
153
152
// can divide a template into nested blocks, and within each block the node
154
153
// structure would be stable. This allows us to skip most children diffing
155
154
// and only worry about the dynamic nodes (indicated by patch flags).
156
- const blockStack : ( VNode [ ] | null ) [ ] = [ ]
155
+ export const blockStack : ( VNode [ ] | null ) [ ] = [ ]
157
156
let currentBlock : VNode [ ] | null = null
158
157
159
158
/**
@@ -176,6 +175,11 @@ export function openBlock(disableTracking = false) {
176
175
blockStack . push ( ( currentBlock = disableTracking ? null : [ ] ) )
177
176
}
178
177
178
+ export function closeBlock ( ) {
179
+ blockStack . pop ( )
180
+ currentBlock = blockStack [ blockStack . length - 1 ] || null
181
+ }
182
+
179
183
// Whether we should be tracking dynamic child nodes inside a block.
180
184
// Only tracks when this value is > 0
181
185
// We are not using a simple boolean because this value may need to be
@@ -227,8 +231,7 @@ export function createBlock(
227
231
// save current block children on the block vnode
228
232
vnode . dynamicChildren = currentBlock || EMPTY_ARR
229
233
// close block
230
- blockStack . pop ( )
231
- currentBlock = blockStack [ blockStack . length - 1 ] || null
234
+ closeBlock ( )
232
235
// a block is always going to be patched, so track it as a child of its
233
236
// parent block
234
237
if ( currentBlock ) {
@@ -403,7 +406,7 @@ function _createVNode(
403
406
normalizeChildren ( vnode , children )
404
407
405
408
if (
406
- ( shouldTrack > 0 || shouldTrackInSlotRendering > 0 ) &&
409
+ shouldTrack > 0 &&
407
410
// avoid a block node from tracking itself
408
411
! isBlockNode &&
409
412
// has current parent block
0 commit comments