Skip to content

Commit c96761c

Browse files
authored
Delete batchedEventUpdates (#21774)
No longer used anywhere.
1 parent ae5afb3 commit c96761c

11 files changed

Lines changed: 16 additions & 98 deletions

File tree

‎packages/react-dom/src/client/ReactDOM.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {createRoot, hydrateRoot, isValidContainer} from './ReactDOMRoot';
2121
import{createEventHandle}from'./ReactDOMEventHandle';
2222

2323
import{
24-
batchedEventUpdates,
2524
batchedUpdates,
2625
discreteUpdates,
2726
flushDiscreteUpdates,
@@ -102,7 +101,6 @@ setBatchingImplementation(
102101
batchedUpdates,
103102
discreteUpdates,
104103
flushDiscreteUpdates,
105-
batchedEventUpdates,
106104
);
107105

108106
functioncreatePortal(

‎packages/react-dom/src/events/DOMPluginEventSystem.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import {
4343
getEventHandlerListeners,
4444
}from'../client/ReactDOMComponentTree';
4545
import{COMMENT_NODE}from'../shared/HTMLNodeType';
46-
import{batchedEventUpdates}from'./ReactDOMUpdateBatching';
46+
import{batchedUpdates}from'./ReactDOMUpdateBatching';
4747
importgetListenerfrom'./getListener';
4848
import{passiveBrowserEventsSupported}from'./checkPassiveEvents';
4949

@@ -630,7 +630,7 @@ export function dispatchEventForPluginEventSystem(
630630
}
631631
}
632632

633-
batchedEventUpdates(()=>
633+
batchedUpdates(()=>
634634
dispatchEventsForPlugins(
635635
domEventName,
636636
eventSystemFlags,

‎packages/react-dom/src/events/ReactDOMUpdateBatching.js‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,8 @@ let discreteUpdatesImpl = function(fn, a, b, c, d) {
2424
returnfn(a,b,c,d);
2525
};
2626
letflushDiscreteUpdatesImpl=function(){};
27-
// TODO: Remove references to batchedEventUpdates
28-
// let batchedEventUpdatesImpl = batchedUpdatesImpl;
2927

3028
letisInsideEventHandler=false;
31-
// let isBatchingEventUpdates = false;
3229

3330
functionfinishEventHandler(){
3431
// Here we wait until all updates have propagated, which is important
@@ -62,9 +59,6 @@ export function batchedUpdates(fn, a, b) {
6259
}
6360
}
6461

65-
// TODO: Remove references to batchedEventUpdates
66-
exportconstbatchedEventUpdates=batchedUpdates;
67-
6862
// TODO: Replace with flushSync
6963
exportfunctiondiscreteUpdates(fn,a,b,c,d){
7064
returndiscreteUpdatesImpl(fn,a,b,c,d);
@@ -74,11 +68,8 @@ export function setBatchingImplementation(
7468
_batchedUpdatesImpl,
7569
_discreteUpdatesImpl,
7670
_flushDiscreteUpdatesImpl,
77-
_batchedEventUpdatesImpl,
7871
){
7972
batchedUpdatesImpl=_batchedUpdatesImpl;
8073
discreteUpdatesImpl=_discreteUpdatesImpl;
8174
flushDiscreteUpdatesImpl=_flushDiscreteUpdatesImpl;
82-
// TODO: Remove references to batchedEventUpdates
83-
// batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
8475
}

‎packages/react-native-renderer/src/ReactFabric.js‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import './ReactFabricInjection';
1616
import{
1717
findHostInstance,
1818
findHostInstanceWithWarning,
19-
batchedEventUpdates,
2019
batchedUpdatesasbatchedUpdatesImpl,
2120
discreteUpdates,
2221
createContainer,
@@ -246,11 +245,7 @@ function createPortal(
246245
returncreatePortalImpl(children,containerTag,null,key);
247246
}
248247

249-
setBatchingImplementation(
250-
batchedUpdatesImpl,
251-
discreteUpdates,
252-
batchedEventUpdates,
253-
);
248+
setBatchingImplementation(batchedUpdatesImpl, discreteUpdates);
254249

255250
const roots = new Map();
256251

‎packages/react-native-renderer/src/ReactNativeRenderer.js‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
findHostInstance,
1818
findHostInstanceWithWarning,
1919
batchedUpdatesasbatchedUpdatesImpl,
20-
batchedEventUpdates,
2120
discreteUpdates,
2221
createContainer,
2322
updateContainer,
@@ -237,11 +236,7 @@ function createPortal(
237236
returncreatePortalImpl(children,containerTag,null,key);
238237
}
239238

240-
setBatchingImplementation(
241-
batchedUpdatesImpl,
242-
discreteUpdates,
243-
batchedEventUpdates,
244-
);
239+
setBatchingImplementation(batchedUpdatesImpl,discreteUpdates);
245240

246241
functioncomputeComponentStackForErrorReporting(reactTag: number): string{
247242
constfiber=getClosestInstanceFromNode(reactTag);

‎packages/react-native-renderer/src/legacy-events/ReactGenericBatching.js‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ let batchedUpdatesImpl = function(fn, bookkeeping) {
1818
letdiscreteUpdatesImpl=function(fn,a,b,c,d){
1919
returnfn(a,b,c,d);
2020
};
21-
letbatchedEventUpdatesImpl=batchedUpdatesImpl;
2221

2322
letisInsideEventHandler=false;
24-
letisBatchingEventUpdates=false;
2523

2624
exportfunctionbatchedUpdates(fn,bookkeeping){
2725
if(isInsideEventHandler){
@@ -37,20 +35,6 @@ export function batchedUpdates(fn, bookkeeping) {
3735
}
3836
}
3937

40-
exportfunctionbatchedEventUpdates(fn,a,b){
41-
if(isBatchingEventUpdates){
42-
// If we are currently inside another batch, we need to wait until it
43-
// fully completes before restoring state.
44-
returnfn(a,b);
45-
}
46-
isBatchingEventUpdates=true;
47-
try{
48-
returnbatchedEventUpdatesImpl(fn,a,b);
49-
}finally{
50-
isBatchingEventUpdates=false;
51-
}
52-
}
53-
5438
exportfunctiondiscreteUpdates(fn,a,b,c,d){
5539
constprevIsInsideEventHandler=isInsideEventHandler;
5640
isInsideEventHandler=true;
@@ -64,9 +48,7 @@ export function discreteUpdates(fn, a, b, c, d) {
6448
exportfunctionsetBatchingImplementation(
6549
_batchedUpdatesImpl,
6650
_discreteUpdatesImpl,
67-
_batchedEventUpdatesImpl,
6851
){
6952
batchedUpdatesImpl=_batchedUpdatesImpl;
7053
discreteUpdatesImpl=_discreteUpdatesImpl;
71-
batchedEventUpdatesImpl=_batchedEventUpdatesImpl;
7254
}

‎packages/react-reconciler/src/ReactFiberReconciler.js‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {enableNewReconciler} from 'shared/ReactFeatureFlags';
1717
import{
1818
createContainerascreateContainer_old,
1919
updateContainerasupdateContainer_old,
20-
batchedEventUpdatesasbatchedEventUpdates_old,
2120
batchedUpdatesasbatchedUpdates_old,
2221
unbatchedUpdatesasunbatchedUpdates_old,
2322
deferredUpdatesasdeferredUpdates_old,
@@ -56,7 +55,6 @@ import {
5655
import{
5756
createContainerascreateContainer_new,
5857
updateContainerasupdateContainer_new,
59-
batchedEventUpdatesasbatchedEventUpdates_new,
6058
batchedUpdatesasbatchedUpdates_new,
6159
unbatchedUpdatesasunbatchedUpdates_new,
6260
deferredUpdatesasdeferredUpdates_new,
@@ -98,9 +96,6 @@ export const createContainer = enableNewReconciler
9896
exportconstupdateContainer=enableNewReconciler
9997
? updateContainer_new
10098
: updateContainer_old;
101-
exportconstbatchedEventUpdates=enableNewReconciler
102-
? batchedEventUpdates_new
103-
: batchedEventUpdates_old;
10499
exportconstbatchedUpdates=enableNewReconciler
105100
? batchedUpdates_new
106101
: batchedUpdates_old;

‎packages/react-reconciler/src/ReactFiberReconciler.new.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import {
5151
requestUpdateLane,
5252
scheduleUpdateOnFiber,
5353
flushRoot,
54-
batchedEventUpdates,
5554
batchedUpdates,
5655
unbatchedUpdates,
5756
flushSync,
@@ -327,7 +326,6 @@ export function updateContainer(
327326
}
328327

329328
export{
330-
batchedEventUpdates,
331329
batchedUpdates,
332330
unbatchedUpdates,
333331
deferredUpdates,

‎packages/react-reconciler/src/ReactFiberReconciler.old.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import {
5151
requestUpdateLane,
5252
scheduleUpdateOnFiber,
5353
flushRoot,
54-
batchedEventUpdates,
5554
batchedUpdates,
5655
unbatchedUpdates,
5756
flushSync,
@@ -327,7 +326,6 @@ export function updateContainer(
327326
}
328327

329328
export{
330-
batchedEventUpdates,
331329
batchedUpdates,
332330
unbatchedUpdates,
333331
deferredUpdates,

‎packages/react-reconciler/src/ReactFiberWorkLoop.new.js‎

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,12 @@ const {
246246

247247
typeExecutionContext=number;
248248

249-
exportconstNoContext=/* */0b000000;
250-
constBatchedContext=/* */0b000001;
251-
constEventContext=/* */0b000010;
252-
constLegacyUnbatchedContext=/* */0b000100;
253-
constRenderContext=/* */0b001000;
254-
constCommitContext=/* */0b010000;
255-
exportconstRetryAfterError=/* */0b100000;
249+
exportconstNoContext=/* */0b00000;
250+
constBatchedContext=/* */0b00001;
251+
constLegacyUnbatchedContext=/* */0b00010;
252+
constRenderContext=/* */0b00100;
253+
constCommitContext=/* */0b01000;
254+
exportconstRetryAfterError=/* */0b10000;
256255

257256
typeRootExitStatus=0|1|2|3|4|5;
258257
constRootIncomplete=0;
@@ -1102,22 +1101,6 @@ export function batchedUpdates<A, R>(fn: A => R, a: A): R {
11021101
}
11031102
}
11041103

1105-
exportfunctionbatchedEventUpdates<A,R>(fn: A=>R,a: A): R{
1106-
constprevExecutionContext=executionContext;
1107-
executionContext|=EventContext;
1108-
try{
1109-
returnfn(a);
1110-
}finally{
1111-
executionContext=prevExecutionContext;
1112-
// If there were legacy sync updates, flush them at the end of the outer
1113-
// most batchedUpdates-like method.
1114-
if(executionContext===NoContext){
1115-
resetRenderTimer();
1116-
flushSyncCallbacksOnlyInLegacyMode();
1117-
}
1118-
}
1119-
}
1120-
11211104
exportfunctiondiscreteUpdates<A,B,C,D,R>(
11221105
fn: (A,B,C,D)=>R,
11231106
a: A,

0 commit comments

Comments
 (0)