@@ -56,15 +56,12 @@ export function executeTasks(
5656 container : Container ,
5757 cursor : Cursor
5858) : ValueOrPromise < void > {
59- if ( ! ( vNode . dirty & ChoreBits . TASKS ) ) {
60- return ;
61- }
59+ vNode . dirty &= ~ ChoreBits . TASKS ;
6260
6361 const elementSeq = container . getHostProp < unknown [ ] | null > ( vNode , ELEMENT_SEQ ) ;
6462
6563 if ( ! elementSeq || elementSeq . length === 0 ) {
6664 // No tasks to execute, clear the bit
67- vNode . dirty &= ~ ChoreBits . TASKS ;
6865 return ;
6966 }
7067
@@ -87,6 +84,7 @@ export function executeTasks(
8784 runResource ( task as ResourceDescriptor < TaskFn > , container , vNode ) ;
8885 } else if ( task . $flags$ & TaskFlags . VISIBLE_TASK ) {
8986 // VisibleTasks: store for execution after flush (don't execute now)
87+ // no dirty propagation needed, dirtyChildren array is enough
9088 vNode . dirty |= ChoreBits . VISIBLE_TASKS ;
9189 } else {
9290 // Regular tasks: chain promises only between each other
@@ -105,9 +103,6 @@ export function executeTasks(
105103 }
106104 }
107105
108- // Clear the TASKS bit after execution
109- vNode . dirty &= ~ ChoreBits . TASKS ;
110-
111106 if ( extraPromises ) {
112107 setExtraPromises ( isServerPlatform ( ) ? vNode : cursor , extraPromises ) ;
113108 }
@@ -125,23 +120,17 @@ export function setNodeDiffPayload(vNode: VNode, payload: JSXOutput | Signal<JSX
125120}
126121
127122export function executeNodeDiff ( vNode : VNode , container : Container ) : ValueOrPromise < void > {
128- if ( ! ( vNode . dirty & ChoreBits . NODE_DIFF ) ) {
129- return ;
130- }
123+ vNode . dirty &= ~ ChoreBits . NODE_DIFF ;
131124
132125 const domVNode = vNode as ElementVNode ;
133126 let jsx = getNodeDiffPayload ( vNode ) ;
134127 if ( ! jsx ) {
135- // No node diff payload, clear the bit
136- vNode . dirty &= ~ ChoreBits . NODE_DIFF ;
137128 return ;
138129 }
139130 if ( isSignal ( jsx ) ) {
140131 jsx = jsx . value as any ;
141132 }
142133 const result = vnode_diff ( container as ClientContainer , jsx , domVNode , null ) ;
143- //vnode diff done, clear the bit
144- vNode . dirty &= ~ ChoreBits . NODE_DIFF ;
145134 return result ;
146135}
147136
@@ -271,14 +260,13 @@ function setNodeProp(
271260 * @returns Void
272261 */
273262export function executeNodeProps ( vNode : VNode , container : Container ) : void {
274- if ( ! ( vNode . dirty & ChoreBits . NODE_PROPS ) || ! ( vNode . flags & VNodeFlags . Element ) ) {
263+ vNode . dirty &= ~ ChoreBits . NODE_PROPS ;
264+ if ( ! ( vNode . flags & VNodeFlags . Element ) ) {
275265 return ;
276266 }
277267
278268 const allPropData = getNodePropData ( vNode ) ;
279269 if ( ! allPropData || allPropData . size === 0 ) {
280- // No pending prop data, clear the bit
281- vNode . dirty &= ~ ChoreBits . NODE_PROPS ;
282270 return ;
283271 }
284272
@@ -311,26 +299,23 @@ export function executeNodeProps(vNode: VNode, container: Container): void {
311299
312300 // Clear pending prop data after processing
313301 clearNodePropData ( vNode ) ;
314- vNode . dirty &= ~ ChoreBits . NODE_PROPS ;
315302}
316303
317304/**
318- * Executes cleanup tasks for a vNode if the CLEANUP dirty bit is set .
305+ * Execute visible task cleanups and add promises to extraPromises .
319306 *
320307 * @param vNode - The vNode to cleanup
321308 * @param container - The container
322309 * @returns Void
323310 */
324311export function executeCleanup ( vNode : VNode , container : Container ) : void {
325- if ( ! ( vNode . dirty & ChoreBits . CLEANUP ) ) {
326- return ;
327- }
312+ vNode . dirty &= ~ ChoreBits . CLEANUP ;
328313
329314 if ( vnode_isVNode ( vNode ) ) {
315+ // TODO I dont think this runs the cleanups of visible tasks
316+ // TODO add promises to extraPromises
330317 clearAllEffects ( container , vNode ) ;
331318 }
332-
333- vNode . dirty &= ~ ChoreBits . CLEANUP ;
334319}
335320
336321/**
@@ -342,13 +327,12 @@ export function executeCleanup(vNode: VNode, container: Container): void {
342327 * @returns Promise if computation is async, void otherwise
343328 */
344329export function executeCompute ( vNode : VNode , container : Container ) : ValueOrPromise < void > {
345- if ( ! ( vNode . dirty & ChoreBits . COMPUTE ) ) {
346- return ;
347- }
330+ vNode . dirty &= ~ ChoreBits . COMPUTE ;
348331
349332 // Compute chores are typically handled by the reactive system.
350333 // This is a placeholder for explicit compute chores if needed.
351334
352- vNode . dirty &= ~ ChoreBits . COMPUTE ;
335+ // TODO remove or use
336+
353337 return ;
354338}
0 commit comments