@@ -37,8 +37,6 @@ import type {
37
37
import type { UpdateQueue } from './ReactFiberClassUpdateQueue' ;
38
38
import type { RootState } from './ReactFiberRoot' ;
39
39
import type { TracingMarkerInstance } from './ReactFiberTracingMarkerComponent' ;
40
- import type { TransitionStatus } from './ReactFiberConfig' ;
41
- import type { Hook } from './ReactFiberHooks' ;
42
40
43
41
import {
44
42
markComponentRenderStarted ,
@@ -100,7 +98,6 @@ import {
100
98
enableProfilerCommitHooks ,
101
99
enableProfilerTimer ,
102
100
enableScopeAPI ,
103
- enableLazyContextPropagation ,
104
101
enableSchedulingProfiler ,
105
102
enableTransitionTracing ,
106
103
enableLegacyHidden ,
@@ -272,7 +269,6 @@ import {
272
269
createClassErrorUpdate ,
273
270
initializeClassErrorUpdate ,
274
271
} from './ReactFiberThrow' ;
275
- import is from 'shared/objectIs' ;
276
272
import {
277
273
getForksAtLevel ,
278
274
isForkedChild ,
@@ -843,7 +839,7 @@ function deferHiddenOffscreenComponent(
843
839
844
840
pushOffscreenSuspenseHandler ( workInProgress ) ;
845
841
846
- if ( enableLazyContextPropagation && current !== null ) {
842
+ if ( current !== null ) {
847
843
// Since this tree will resume rendering in a separate render, we need
848
844
// to propagate parent contexts now so we don't lose track of which
849
845
// ones changed.
@@ -1636,26 +1632,6 @@ function updateHostComponent(
1636
1632
} else {
1637
1633
HostTransitionContext . _currentValue2 = newState ;
1638
1634
}
1639
- if (enableLazyContextPropagation) {
1640
- // In the lazy propagation implementation, we don't scan for matching
1641
- // consumers until something bails out.
1642
- } else {
1643
- if ( didReceiveUpdate ) {
1644
- if ( current !== null ) {
1645
- const oldStateHook : Hook = current . memoizedState ;
1646
- const oldState : TransitionStatus = oldStateHook . memoizedState ;
1647
- // This uses regular equality instead of Object.is because we assume
1648
- // that host transition state doesn't include NaN as a valid type.
1649
- if ( oldState !== newState ) {
1650
- propagateContextChange (
1651
- workInProgress ,
1652
- HostTransitionContext ,
1653
- renderLanes ,
1654
- ) ;
1655
- }
1656
- }
1657
- }
1658
- }
1659
1635
}
1660
1636
1661
1637
markRef ( current , workInProgress ) ;
@@ -2706,10 +2682,7 @@ function updateDehydratedSuspenseComponent(
2706
2682
}
2707
2683
2708
2684
if (
2709
- enableLazyContextPropagation &&
2710
2685
// TODO: Factoring is a little weird, since we check this right below, too.
2711
- // But don't want to re-arrange the if-else chain until/unless this
2712
- // feature lands.
2713
2686
! didReceiveUpdate
2714
2687
) {
2715
2688
// We need to check if any children have context before we decide to bail
@@ -3300,8 +3273,6 @@ function updateContextProvider(
3300
3273
context = workInProgress . type . _context ;
3301
3274
}
3302
3275
const newProps = workInProgress . pendingProps ;
3303
- const oldProps = workInProgress . memoizedProps ;
3304
-
3305
3276
const newValue = newProps . value ;
3306
3277
3307
3278
if ( __DEV__ ) {
@@ -3317,34 +3288,6 @@ function updateContextProvider(
3317
3288
3318
3289
pushProvider ( workInProgress , context , newValue ) ;
3319
3290
3320
- if ( enableLazyContextPropagation ) {
3321
- // In the lazy propagation implementation, we don't scan for matching
3322
- // consumers until something bails out, because until something bails out
3323
- // we're going to visit those nodes, anyway. The trade-off is that it shifts
3324
- // responsibility to the consumer to track whether something has changed.
3325
- } else {
3326
- if ( oldProps !== null ) {
3327
- const oldValue = oldProps . value ;
3328
- if ( is ( oldValue , newValue ) ) {
3329
- // No change. Bailout early if children are the same.
3330
- if (
3331
- oldProps . children === newProps . children &&
3332
- ! hasLegacyContextChanged ( )
3333
- ) {
3334
- return bailoutOnAlreadyFinishedWork (
3335
- current ,
3336
- workInProgress ,
3337
- renderLanes ,
3338
- ) ;
3339
- }
3340
- } else {
3341
- // The context value changed. Search for matching consumers and schedule
3342
- // them to update.
3343
- propagateContextChange ( workInProgress , context , renderLanes ) ;
3344
- }
3345
- }
3346
- }
3347
-
3348
3291
const newChildren = newProps . children ;
3349
3292
reconcileChildren ( current , workInProgress , newChildren , renderLanes ) ;
3350
3293
return workInProgress . child ;
@@ -3463,7 +3406,7 @@ function bailoutOnAlreadyFinishedWork(
3463
3406
// TODO: Once we add back resuming, we should check if the children are
3464
3407
// a work-in-progress set. If so, we need to transfer their effects.
3465
3408
3466
- if ( enableLazyContextPropagation && current !== null ) {
3409
+ if ( current !== null ) {
3467
3410
// Before bailing out, check if there are any context changes in
3468
3411
// the children.
3469
3412
lazilyPropagateParentContextChanges ( current , workInProgress , renderLanes ) ;
@@ -3564,11 +3507,9 @@ function checkScheduledUpdateOrContext(
3564
3507
}
3565
3508
// No pending update, but because context is propagated lazily, we need
3566
3509
// to check for a context change before we bail out.
3567
- if ( enableLazyContextPropagation ) {
3568
- const dependencies = current . dependencies ;
3569
- if ( dependencies !== null && checkIfContextChanged ( dependencies ) ) {
3570
- return true ;
3571
- }
3510
+ const dependencies = current . dependencies ;
3511
+ if ( dependencies !== null && checkIfContextChanged ( dependencies ) ) {
3512
+ return true ;
3572
3513
}
3573
3514
return false ;
3574
3515
}
@@ -3706,7 +3647,7 @@ function attemptEarlyBailoutIfNoScheduledUpdate(
3706
3647
workInProgress . childLanes ,
3707
3648
) ;
3708
3649
3709
- if ( enableLazyContextPropagation && ! hasChildWork ) {
3650
+ if ( ! hasChildWork ) {
3710
3651
// Context changes may not have been propagated yet. We need to do
3711
3652
// that now, before we can decide whether to bail out.
3712
3653
// TODO: We use `childLanes` as a heuristic for whether there is
0 commit comments