Skip to content

Commit b0ce267

Browse files
committed
Clean up deferRenderPhaseUpdateToNextBatch (#26511)
This is a change to some undefined behavior that we though we would do at one point but decided not to roll out. It's already disabled everywhere, so this just deletes the branch from the implementation and the tests. DiffTrain build for [2d51251](2d51251)
1 parent 14a8309 commit b0ce267

18 files changed

+196
-388
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4c2fc01900f50b5b1081a2fb8609ea2668bc05b6
1+
2d51251e608b7b1a8baf79ae6bdba81ed8e1939a

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-www-modern-da3586f6";
30+
var ReactVersion = "18.3.0-www-modern-8f791852";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-classic-7abd5856";
72+
var ReactVersion = "18.3.0-www-classic-4dc1bcfd";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -169,8 +169,6 @@ var revertRemovalOfSiblingPrerendering =
169169
dynamicFeatureFlags.revertRemovalOfSiblingPrerendering,
170170
replayFailedUnitOfWorkWithInvokeGuardedCallback =
171171
dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback,
172-
deferRenderPhaseUpdateToNextBatch =
173-
dynamicFeatureFlags.deferRenderPhaseUpdateToNextBatch,
174172
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
175173
skipUnmountedBoundaries = dynamicFeatureFlags.skipUnmountedBoundaries,
176174
enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning,
@@ -4408,7 +4406,7 @@ function enqueueUpdate(fiber, update, lane) {
44084406
}
44094407
}
44104408

4411-
if (isUnsafeClassRenderPhaseUpdate(fiber)) {
4409+
if (isUnsafeClassRenderPhaseUpdate()) {
44124410
// This is an unsafe render phase update. Add directly to the update
44134411
// queue so we can process it immediately during the current render.
44144412
var pending = sharedQueue.pending;
@@ -23509,7 +23507,6 @@ function requestUpdateLane(fiber) {
2350923507
if ((mode & ConcurrentMode) === NoMode) {
2351023508
return SyncLane;
2351123509
} else if (
23512-
!deferRenderPhaseUpdateToNextBatch &&
2351323510
(executionContext & RenderContext) !== NoContext &&
2351423511
workInProgressRootRenderLanes !== NoLanes
2351523512
) {
@@ -23673,14 +23670,8 @@ function scheduleUpdateOnFiber(root, fiber, lane, eventTime) {
2367323670

2367423671
if (root === workInProgressRoot) {
2367523672
// Received an update to a tree that's in the middle of rendering. Mark
23676-
// that there was an interleaved update work on this root. Unless the
23677-
// `deferRenderPhaseUpdateToNextBatch` flag is off and this is a render
23678-
// phase update. In that case, we don't treat render phase updates as if
23679-
// they were interleaved, for backwards compat reasons.
23680-
if (
23681-
deferRenderPhaseUpdateToNextBatch ||
23682-
(executionContext & RenderContext) === NoContext
23683-
) {
23673+
// that there was an interleaved update work on this root.
23674+
if ((executionContext & RenderContext) === NoContext) {
2368423675
workInProgressRootInterleavedUpdatedLanes = mergeLanes(
2368523676
workInProgressRootInterleavedUpdatedLanes,
2368623677
lane
@@ -23719,13 +23710,7 @@ function scheduleUpdateOnFiber(root, fiber, lane, eventTime) {
2371923710
function isUnsafeClassRenderPhaseUpdate(fiber) {
2372023711
// Check if this is a render phase update. Only called by class components,
2372123712
// which special (deprecated) behavior for UNSAFE_componentWillReceive props.
23722-
return (
23723-
// TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We
23724-
// decided not to enable it.
23725-
(!deferRenderPhaseUpdateToNextBatch ||
23726-
(fiber.mode & ConcurrentMode) === NoMode) &&
23727-
(executionContext & RenderContext) !== NoContext
23728-
);
23713+
return (executionContext & RenderContext) !== NoContext;
2372923714
} // Use this function to schedule a task for a root. There's only one task per
2373023715
// root; if a task was already scheduled, we'll check to make sure the priority
2373123716
// of the existing task is the same as the priority of the next level that the

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-modern-fdfa6ecf";
72+
var ReactVersion = "18.3.0-www-modern-58325a38";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -169,8 +169,6 @@ var revertRemovalOfSiblingPrerendering =
169169
dynamicFeatureFlags.revertRemovalOfSiblingPrerendering,
170170
replayFailedUnitOfWorkWithInvokeGuardedCallback =
171171
dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback,
172-
deferRenderPhaseUpdateToNextBatch =
173-
dynamicFeatureFlags.deferRenderPhaseUpdateToNextBatch,
174172
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
175173
skipUnmountedBoundaries = dynamicFeatureFlags.skipUnmountedBoundaries,
176174
enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning,
@@ -4164,7 +4162,7 @@ function enqueueUpdate(fiber, update, lane) {
41644162
}
41654163
}
41664164

4167-
if (isUnsafeClassRenderPhaseUpdate(fiber)) {
4165+
if (isUnsafeClassRenderPhaseUpdate()) {
41684166
// This is an unsafe render phase update. Add directly to the update
41694167
// queue so we can process it immediately during the current render.
41704168
var pending = sharedQueue.pending;
@@ -23169,7 +23167,6 @@ function requestUpdateLane(fiber) {
2316923167
if ((mode & ConcurrentMode) === NoMode) {
2317023168
return SyncLane;
2317123169
} else if (
23172-
!deferRenderPhaseUpdateToNextBatch &&
2317323170
(executionContext & RenderContext) !== NoContext &&
2317423171
workInProgressRootRenderLanes !== NoLanes
2317523172
) {
@@ -23333,14 +23330,8 @@ function scheduleUpdateOnFiber(root, fiber, lane, eventTime) {
2333323330

2333423331
if (root === workInProgressRoot) {
2333523332
// Received an update to a tree that's in the middle of rendering. Mark
23336-
// that there was an interleaved update work on this root. Unless the
23337-
// `deferRenderPhaseUpdateToNextBatch` flag is off and this is a render
23338-
// phase update. In that case, we don't treat render phase updates as if
23339-
// they were interleaved, for backwards compat reasons.
23340-
if (
23341-
deferRenderPhaseUpdateToNextBatch ||
23342-
(executionContext & RenderContext) === NoContext
23343-
) {
23333+
// that there was an interleaved update work on this root.
23334+
if ((executionContext & RenderContext) === NoContext) {
2334423335
workInProgressRootInterleavedUpdatedLanes = mergeLanes(
2334523336
workInProgressRootInterleavedUpdatedLanes,
2334623337
lane
@@ -23379,13 +23370,7 @@ function scheduleUpdateOnFiber(root, fiber, lane, eventTime) {
2337923370
function isUnsafeClassRenderPhaseUpdate(fiber) {
2338023371
// Check if this is a render phase update. Only called by class components,
2338123372
// which special (deprecated) behavior for UNSAFE_componentWillReceive props.
23382-
return (
23383-
// TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We
23384-
// decided not to enable it.
23385-
(!deferRenderPhaseUpdateToNextBatch ||
23386-
(fiber.mode & ConcurrentMode) === NoMode) &&
23387-
(executionContext & RenderContext) !== NoContext
23388-
);
23373+
return (executionContext & RenderContext) !== NoContext;
2338923374
} // Use this function to schedule a task for a root. There's only one task per
2339023375
// root; if a task was already scheduled, we'll check to make sure the priority
2339123376
// of the existing task is the same as the priority of the next level that the

compiled/facebook-www/ReactART-prod.classic.js

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ var ReactSharedInternals =
6565
dynamicFeatureFlags = require("ReactFeatureFlags"),
6666
revertRemovalOfSiblingPrerendering =
6767
dynamicFeatureFlags.revertRemovalOfSiblingPrerendering,
68-
deferRenderPhaseUpdateToNextBatch =
69-
dynamicFeatureFlags.deferRenderPhaseUpdateToNextBatch,
7068
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
7169
skipUnmountedBoundaries = dynamicFeatureFlags.skipUnmountedBoundaries,
7270
enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning,
@@ -1164,22 +1162,18 @@ function enqueueUpdate(fiber, update, lane) {
11641162
var updateQueue = fiber.updateQueue;
11651163
if (null === updateQueue) return null;
11661164
updateQueue = updateQueue.shared;
1167-
if (
1168-
(deferRenderPhaseUpdateToNextBatch && 0 !== (fiber.mode & 1)) ||
1169-
0 === (executionContext & 2)
1170-
)
1171-
return (
1172-
enqueueUpdate$1(fiber, updateQueue, update, lane),
1173-
getRootForUpdatedFiber(fiber)
1174-
);
1175-
var pending = updateQueue.pending;
1176-
null === pending
1177-
? (update.next = update)
1178-
: ((update.next = pending.next), (pending.next = update));
1179-
updateQueue.pending = update;
1180-
update = getRootForUpdatedFiber(fiber);
1181-
markUpdateLaneFromFiberToRoot(fiber, null, lane);
1182-
return update;
1165+
if (0 !== (executionContext & 2)) {
1166+
var pending = updateQueue.pending;
1167+
null === pending
1168+
? (update.next = update)
1169+
: ((update.next = pending.next), (pending.next = update));
1170+
updateQueue.pending = update;
1171+
update = getRootForUpdatedFiber(fiber);
1172+
markUpdateLaneFromFiberToRoot(fiber, null, lane);
1173+
return update;
1174+
}
1175+
enqueueUpdate$1(fiber, updateQueue, update, lane);
1176+
return getRootForUpdatedFiber(fiber);
11831177
}
11841178
function entangleTransitions(root, fiber, lane) {
11851179
fiber = fiber.updateQueue;
@@ -7815,11 +7809,7 @@ function requestEventTime() {
78157809
}
78167810
function requestUpdateLane(fiber) {
78177811
if (0 === (fiber.mode & 1)) return 2;
7818-
if (
7819-
!deferRenderPhaseUpdateToNextBatch &&
7820-
0 !== (executionContext & 2) &&
7821-
0 !== workInProgressRootRenderLanes
7822-
)
7812+
if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes)
78237813
return workInProgressRootRenderLanes & -workInProgressRootRenderLanes;
78247814
if (null !== ReactCurrentBatchConfig$1.transition)
78257815
return (
@@ -7853,12 +7843,11 @@ function scheduleUpdateOnFiber(root, fiber, lane, eventTime) {
78537843
transitionLanesMap[index$7] = transitions;
78547844
}
78557845
}
7856-
if (root === workInProgressRoot) {
7857-
if (deferRenderPhaseUpdateToNextBatch || 0 === (executionContext & 2))
7858-
workInProgressRootInterleavedUpdatedLanes |= lane;
7846+
root === workInProgressRoot &&
7847+
(0 === (executionContext & 2) &&
7848+
(workInProgressRootInterleavedUpdatedLanes |= lane),
78597849
4 === workInProgressRootExitStatus &&
7860-
markRootSuspended(root, workInProgressRootRenderLanes);
7861-
}
7850+
markRootSuspended(root, workInProgressRootRenderLanes));
78627851
ensureRootIsScheduled(root, eventTime);
78637852
2 === lane &&
78647853
0 === executionContext &&
@@ -10034,7 +10023,7 @@ var slice = Array.prototype.slice,
1003410023
return null;
1003510024
},
1003610025
bundleType: 0,
10037-
version: "18.3.0-www-classic-add426f7",
10026+
version: "18.3.0-www-classic-942a9e22",
1003810027
rendererPackageName: "react-art"
1003910028
};
1004010029
var internals$jscomp$inline_1324 = {
@@ -10065,7 +10054,7 @@ var internals$jscomp$inline_1324 = {
1006510054
scheduleRoot: null,
1006610055
setRefreshHandler: null,
1006710056
getCurrentFiber: null,
10068-
reconcilerVersion: "18.3.0-www-classic-add426f7"
10057+
reconcilerVersion: "18.3.0-www-classic-942a9e22"
1006910058
};
1007010059
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1007110060
var hook$jscomp$inline_1325 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled/facebook-www/ReactART-prod.modern.js

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ var ReactSharedInternals =
6565
dynamicFeatureFlags = require("ReactFeatureFlags"),
6666
revertRemovalOfSiblingPrerendering =
6767
dynamicFeatureFlags.revertRemovalOfSiblingPrerendering,
68-
deferRenderPhaseUpdateToNextBatch =
69-
dynamicFeatureFlags.deferRenderPhaseUpdateToNextBatch,
7068
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
7169
skipUnmountedBoundaries = dynamicFeatureFlags.skipUnmountedBoundaries,
7270
enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning,
@@ -970,22 +968,18 @@ function enqueueUpdate(fiber, update, lane) {
970968
var updateQueue = fiber.updateQueue;
971969
if (null === updateQueue) return null;
972970
updateQueue = updateQueue.shared;
973-
if (
974-
(deferRenderPhaseUpdateToNextBatch && 0 !== (fiber.mode & 1)) ||
975-
0 === (executionContext & 2)
976-
)
977-
return (
978-
enqueueUpdate$1(fiber, updateQueue, update, lane),
979-
getRootForUpdatedFiber(fiber)
980-
);
981-
var pending = updateQueue.pending;
982-
null === pending
983-
? (update.next = update)
984-
: ((update.next = pending.next), (pending.next = update));
985-
updateQueue.pending = update;
986-
update = getRootForUpdatedFiber(fiber);
987-
markUpdateLaneFromFiberToRoot(fiber, null, lane);
988-
return update;
971+
if (0 !== (executionContext & 2)) {
972+
var pending = updateQueue.pending;
973+
null === pending
974+
? (update.next = update)
975+
: ((update.next = pending.next), (pending.next = update));
976+
updateQueue.pending = update;
977+
update = getRootForUpdatedFiber(fiber);
978+
markUpdateLaneFromFiberToRoot(fiber, null, lane);
979+
return update;
980+
}
981+
enqueueUpdate$1(fiber, updateQueue, update, lane);
982+
return getRootForUpdatedFiber(fiber);
989983
}
990984
function entangleTransitions(root, fiber, lane) {
991985
fiber = fiber.updateQueue;
@@ -7547,11 +7541,7 @@ function requestEventTime() {
75477541
}
75487542
function requestUpdateLane(fiber) {
75497543
if (0 === (fiber.mode & 1)) return 2;
7550-
if (
7551-
!deferRenderPhaseUpdateToNextBatch &&
7552-
0 !== (executionContext & 2) &&
7553-
0 !== workInProgressRootRenderLanes
7554-
)
7544+
if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes)
75557545
return workInProgressRootRenderLanes & -workInProgressRootRenderLanes;
75567546
if (null !== ReactCurrentBatchConfig$1.transition)
75577547
return (
@@ -7585,12 +7575,11 @@ function scheduleUpdateOnFiber(root, fiber, lane, eventTime) {
75857575
transitionLanesMap[index$7] = transitions;
75867576
}
75877577
}
7588-
if (root === workInProgressRoot) {
7589-
if (deferRenderPhaseUpdateToNextBatch || 0 === (executionContext & 2))
7590-
workInProgressRootInterleavedUpdatedLanes |= lane;
7578+
root === workInProgressRoot &&
7579+
(0 === (executionContext & 2) &&
7580+
(workInProgressRootInterleavedUpdatedLanes |= lane),
75917581
4 === workInProgressRootExitStatus &&
7592-
markRootSuspended(root, workInProgressRootRenderLanes);
7593-
}
7582+
markRootSuspended(root, workInProgressRootRenderLanes));
75947583
ensureRootIsScheduled(root, eventTime);
75957584
2 === lane &&
75967585
0 === executionContext &&
@@ -9699,7 +9688,7 @@ var slice = Array.prototype.slice,
96999688
return null;
97009689
},
97019690
bundleType: 0,
9702-
version: "18.3.0-www-modern-7fe55e49",
9691+
version: "18.3.0-www-modern-af295806",
97039692
rendererPackageName: "react-art"
97049693
};
97059694
var internals$jscomp$inline_1304 = {
@@ -9730,7 +9719,7 @@ var internals$jscomp$inline_1304 = {
97309719
scheduleRoot: null,
97319720
setRefreshHandler: null,
97329721
getCurrentFiber: null,
9733-
reconcilerVersion: "18.3.0-www-modern-7fe55e49"
9722+
reconcilerVersion: "18.3.0-www-modern-af295806"
97349723
};
97359724
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
97369725
var hook$jscomp$inline_1305 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled/facebook-www/ReactDOM-dev.classic.js

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ var disableInputAttributeSyncing =
4545
replayFailedUnitOfWorkWithInvokeGuardedCallback =
4646
dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback,
4747
enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport,
48-
deferRenderPhaseUpdateToNextBatch =
49-
dynamicFeatureFlags.deferRenderPhaseUpdateToNextBatch,
5048
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
5149
skipUnmountedBoundaries = dynamicFeatureFlags.skipUnmountedBoundaries,
5250
enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning,
@@ -14879,7 +14877,7 @@ function enqueueUpdate(fiber, update, lane) {
1487914877
}
1488014878
}
1488114879

14882-
if (isUnsafeClassRenderPhaseUpdate(fiber)) {
14880+
if (isUnsafeClassRenderPhaseUpdate()) {
1488314881
// This is an unsafe render phase update. Add directly to the update
1488414882
// queue so we can process it immediately during the current render.
1488514883
var pending = sharedQueue.pending;
@@ -34842,7 +34840,6 @@ function requestUpdateLane(fiber) {
3484234840
if ((mode & ConcurrentMode) === NoMode) {
3484334841
return SyncLane;
3484434842
} else if (
34845-
!deferRenderPhaseUpdateToNextBatch &&
3484634843
(executionContext & RenderContext) !== NoContext &&
3484734844
workInProgressRootRenderLanes !== NoLanes
3484834845
) {
@@ -35006,14 +35003,8 @@ function scheduleUpdateOnFiber(root, fiber, lane, eventTime) {
3500635003

3500735004
if (root === workInProgressRoot) {
3500835005
// Received an update to a tree that's in the middle of rendering. Mark
35009-
// that there was an interleaved update work on this root. Unless the
35010-
// `deferRenderPhaseUpdateToNextBatch` flag is off and this is a render
35011-
// phase update. In that case, we don't treat render phase updates as if
35012-
// they were interleaved, for backwards compat reasons.
35013-
if (
35014-
deferRenderPhaseUpdateToNextBatch ||
35015-
(executionContext & RenderContext) === NoContext
35016-
) {
35006+
// that there was an interleaved update work on this root.
35007+
if ((executionContext & RenderContext) === NoContext) {
3501735008
workInProgressRootInterleavedUpdatedLanes = mergeLanes(
3501835009
workInProgressRootInterleavedUpdatedLanes,
3501935010
lane
@@ -35067,13 +35058,7 @@ function scheduleInitialHydrationOnRoot(root, lane, eventTime) {
3506735058
function isUnsafeClassRenderPhaseUpdate(fiber) {
3506835059
// Check if this is a render phase update. Only called by class components,
3506935060
// which special (deprecated) behavior for UNSAFE_componentWillReceive props.
35070-
return (
35071-
// TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We
35072-
// decided not to enable it.
35073-
(!deferRenderPhaseUpdateToNextBatch ||
35074-
(fiber.mode & ConcurrentMode) === NoMode) &&
35075-
(executionContext & RenderContext) !== NoContext
35076-
);
35061+
return (executionContext & RenderContext) !== NoContext;
3507735062
} // Use this function to schedule a task for a root. There's only one task per
3507835063
// root; if a task was already scheduled, we'll check to make sure the priority
3507935064
// of the existing task is the same as the priority of the next level that the
@@ -39595,7 +39580,7 @@ function createFiberRoot(
3959539580
return root;
3959639581
}
3959739582

39598-
var ReactVersion = "18.3.0-www-classic-6d884ef8";
39583+
var ReactVersion = "18.3.0-www-classic-f0f7e718";
3959939584

3960039585
function createPortal$1(
3960139586
children,

0 commit comments

Comments
 (0)