@@ -182,8 +182,6 @@ export class Batch {
182182 #traverse_effect_tree( root ) {
183183 root . f ^= CLEAN ;
184184
185- var should_defer = false ;
186-
187185 /** @type {EffectTarget } */
188186 var target = {
189187 parent : null ,
@@ -236,25 +234,15 @@ export class Batch {
236234 effect = effect . next ;
237235
238236 while ( effect === null && parent !== null ) {
239- if ( parent . b !== null ) {
240- var ready = parent . b . local_pending_count === 0 ;
241-
242- if ( target . parent === null ) {
243- should_defer ||= ! ready ;
244- } else if ( parent === target . effect ) {
245- if ( ready ) {
246- // TODO can this happen?
247- target . parent . effects . push ( ...target . effects ) ;
248- target . parent . render_effects . push ( ...target . render_effects ) ;
249- target . parent . block_effects . push ( ...target . block_effects ) ;
250- } else {
251- this . #defer_effects( target . effects ) ;
252- this . #defer_effects( target . render_effects ) ;
253- this . #defer_effects( target . block_effects ) ;
254- }
255-
256- target = /** @type {EffectTarget } */ ( target . parent ) ;
257- }
237+ if ( parent === target . effect ) {
238+ // TODO rather than traversing into pending boundaries and deferring the effects,
239+ // could we just attach the effects _to_ the pending boundary and schedule them
240+ // once the boundary is ready?
241+ this . #defer_effects( target . effects ) ;
242+ this . #defer_effects( target . render_effects ) ;
243+ this . #defer_effects( target . block_effects ) ;
244+
245+ target = /** @type {EffectTarget } */ ( target . parent ) ;
258246 }
259247
260248 effect = parent . next ;
0 commit comments