@@ -284,7 +284,6 @@ let globalMostRecentFallbackTime: number = 0;
284
284
const FALLBACK_THROTTLE_MS: number = 500;
285
285
const DEFAULT_TIMEOUT_MS: number = 5000;
286
286
287
- let nextEffect: Fiber | null = null;
288
287
let hasUncaughtError = false;
289
288
let firstUncaughtError = null;
290
289
let legacyErrorBoundariesThatAlreadyFailed: Set< mixed > | null = null;
@@ -1788,10 +1787,8 @@ function resetChildLanes(completedWork: Fiber) {
1788
1787
) ;
1789
1788
1790
1789
subtreeTag |= child . subtreeTag ;
1790
+ // TODO (effects) Document why this exception is important
1791
1791
subtreeTag |= child . effectTag & HostEffectMask ;
1792
- if ( child . deletions !== null ) {
1793
- subtreeTag |= Deletion ;
1794
- }
1795
1792
1796
1793
if ( ( child . effectTag & Incomplete ) !== NoEffect ) {
1797
1794
childrenDidNotComplete = true ;
@@ -1833,10 +1830,8 @@ function resetChildLanes(completedWork: Fiber) {
1833
1830
) ;
1834
1831
1835
1832
subtreeTag |= child . subtreeTag ;
1833
+ // TODO (effects) Document why this exception is important
1836
1834
subtreeTag |= child . effectTag & HostEffectMask ;
1837
- if ( child . deletions !== null ) {
1838
- subtreeTag |= Deletion ;
1839
- }
1840
1835
1841
1836
if ( ( child . effectTag & Incomplete ) !== NoEffect ) {
1842
1837
childrenDidNotComplete = true ;
@@ -1996,8 +1991,6 @@ function commitRootImpl(root, renderPriorityLevel) {
1996
1991
// layout, but class component lifecycles also fire here for legacy reasons.
1997
1992
commitLayoutEffects ( finishedWork , root , lanes ) ;
1998
1993
1999
- nextEffect = null ;
2000
-
2001
1994
// Tell Scheduler to yield at the end of the frame, so the browser has an
2002
1995
// opportunity to paint.
2003
1996
requestPaint ( ) ;
@@ -2030,19 +2023,7 @@ function commitRootImpl(root, renderPriorityLevel) {
2030
2023
pendingPassiveEffectsLanes = lanes ;
2031
2024
pendingPassiveEffectsRenderPriority = renderPriorityLevel ;
2032
2025
} else {
2033
- // We are done with the effect chain at this point so let's clear the
2034
- // nextEffect pointers to assist with GC. If we have passive effects, we'll
2035
- // clear this in flushPassiveEffects.
2036
- // TODO (effects) Traverse with subtreeTag Deletion and detatch deletions array only
2037
- nextEffect = firstEffect ;
2038
- while ( nextEffect !== null ) {
2039
- const nextNextEffect = nextEffect . nextEffect ;
2040
- nextEffect . nextEffect = null ;
2041
- if ( nextEffect . effectTag & Deletion ) {
2042
- detachFiberAfterEffects ( nextEffect ) ;
2043
- }
2044
- nextEffect = nextNextEffect ;
2045
- }
2026
+ // TODO (effects) Detach sibling pointers for deleted Fibers
2046
2027
}
2047
2028
2048
2029
// Read this again, since an effect might have updated it
@@ -2626,20 +2607,7 @@ function flushPassiveEffectsImpl() {
2626
2607
}
2627
2608
}
2628
2609
2629
- // Note: This currently assumes there are no passive effects on the root fiber
2630
- // because the root is not part of its own effect list.
2631
- // This could change in the future.
2632
- // TODO (effects) Traverse with subtreeTag Deletion and detatch deletions array only
2633
- let effect = root . current . firstEffect ;
2634
- while ( effect !== null ) {
2635
- const nextNextEffect = effect . nextEffect ;
2636
- // Remove nextEffect pointer to assist GC
2637
- effect . nextEffect = null ;
2638
- if ( effect . effectTag & Deletion ) {
2639
- detachFiberAfterEffects ( effect ) ;
2640
- }
2641
- effect = nextNextEffect ;
2642
- }
2610
+ // TODO (effects) Detach sibling pointers for deleted Fibers
2643
2611
2644
2612
if ( enableProfilerTimer && enableProfilerCommitHooks ) {
2645
2613
const profilerEffects = pendingPassiveProfilerEffects ;
@@ -3733,7 +3701,3 @@ export function act(callback: () => Thenable<mixed>): Thenable<void> {
3733
3701
} ;
3734
3702
}
3735
3703
}
3736
-
3737
- function detachFiberAfterEffects ( fiber : Fiber ) : void {
3738
- fiber . sibling = null ;
3739
- }
0 commit comments