Skip to content

Commit cf341bf

Browse files
committed
Noop unstable_batchedUpdates (#28120)
## Overview `unstable_batchedUpdates` is effectively a no-op outside of legacy mode, this PR makes it an actual no-op outside legacy mode. DiffTrain build for commit 63651c4.
1 parent 9e0cbef commit cf341bf

File tree

4 files changed

+52
-46
lines changed

4 files changed

+52
-46
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<e3c2cd0dc2c519bacd879ada7f0bbba4>>
10+
* @generated SignedSource<<b3f8b9d9ae41ad4e84b986ff88b107f6>>
1111
*/
1212

1313
"use strict";
@@ -22919,21 +22919,23 @@ if (__DEV__) {
2291922919
return executionContext;
2292022920
}
2292122921
function batchedUpdates(fn, a) {
22922-
var prevExecutionContext = executionContext;
22923-
executionContext |= BatchedContext;
22922+
{
22923+
var prevExecutionContext = executionContext;
22924+
executionContext |= BatchedContext;
2292422925

22925-
try {
22926-
return fn(a);
22927-
} finally {
22928-
executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer
22929-
// most batchedUpdates-like method.
22926+
try {
22927+
return fn(a);
22928+
} finally {
22929+
executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer
22930+
// most batchedUpdates-like method.
2293022931

22931-
if (
22932-
executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
22933-
!ReactCurrentActQueue.isBatchingLegacy
22934-
) {
22935-
resetRenderTimer();
22936-
flushSyncWorkOnLegacyRootsOnly();
22932+
if (
22933+
executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
22934+
!ReactCurrentActQueue.isBatchingLegacy
22935+
) {
22936+
resetRenderTimer();
22937+
flushSyncWorkOnLegacyRootsOnly();
22938+
}
2293722939
}
2293822940
}
2293922941
}
@@ -26250,7 +26252,7 @@ if (__DEV__) {
2625026252
return root;
2625126253
}
2625226254

26253-
var ReactVersion = "19.0.0-canary-04ac921d";
26255+
var ReactVersion = "19.0.0-canary-6c021864";
2625426256

2625526257
// Might add PROFILE later.
2625626258

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
05797ccebd285999343ab4fb94eb542f84be23b1
1+
63651c49e068a04cdc6ee1e2fa9c6125167987d2

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<524dd707c3c266c4090532051a299e80>>
10+
* @generated SignedSource<<b96b1db3ec870619c9c09b3905a87f32>>
1111
*/
1212

1313
"use strict";
@@ -26979,21 +26979,23 @@ to return true:wantsResponderID| |
2697926979
return executionContext;
2698026980
}
2698126981
function batchedUpdates(fn, a) {
26982-
var prevExecutionContext = executionContext;
26983-
executionContext |= BatchedContext;
26982+
{
26983+
var prevExecutionContext = executionContext;
26984+
executionContext |= BatchedContext;
2698426985

26985-
try {
26986-
return fn(a);
26987-
} finally {
26988-
executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer
26989-
// most batchedUpdates-like method.
26986+
try {
26987+
return fn(a);
26988+
} finally {
26989+
executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer
26990+
// most batchedUpdates-like method.
2699026991

26991-
if (
26992-
executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
26993-
!ReactCurrentActQueue.isBatchingLegacy
26994-
) {
26995-
resetRenderTimer();
26996-
flushSyncWorkOnLegacyRootsOnly();
26992+
if (
26993+
executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
26994+
!ReactCurrentActQueue.isBatchingLegacy
26995+
) {
26996+
resetRenderTimer();
26997+
flushSyncWorkOnLegacyRootsOnly();
26998+
}
2699726999
}
2699827000
}
2699927001
}
@@ -30581,7 +30583,7 @@ to return true:wantsResponderID| |
3058130583
return root;
3058230584
}
3058330585

30584-
var ReactVersion = "19.0.0-canary-50157059";
30586+
var ReactVersion = "19.0.0-canary-fb494e93";
3058530587

3058630588
function createPortal$1(
3058730589
children,

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<8d9f49fca475ccca8550375480fc8c85>>
10+
* @generated SignedSource<<217faa179ec43aec470e31136cd73a9b>>
1111
*/
1212

1313
"use strict";
@@ -27419,21 +27419,23 @@ to return true:wantsResponderID| |
2741927419
return executionContext;
2742027420
}
2742127421
function batchedUpdates(fn, a) {
27422-
var prevExecutionContext = executionContext;
27423-
executionContext |= BatchedContext;
27422+
{
27423+
var prevExecutionContext = executionContext;
27424+
executionContext |= BatchedContext;
2742427425

27425-
try {
27426-
return fn(a);
27427-
} finally {
27428-
executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer
27429-
// most batchedUpdates-like method.
27426+
try {
27427+
return fn(a);
27428+
} finally {
27429+
executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer
27430+
// most batchedUpdates-like method.
2743027431

27431-
if (
27432-
executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
27433-
!ReactCurrentActQueue.isBatchingLegacy
27434-
) {
27435-
resetRenderTimer();
27436-
flushSyncWorkOnLegacyRootsOnly();
27432+
if (
27433+
executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
27434+
!ReactCurrentActQueue.isBatchingLegacy
27435+
) {
27436+
resetRenderTimer();
27437+
flushSyncWorkOnLegacyRootsOnly();
27438+
}
2743727439
}
2743827440
}
2743927441
}
@@ -31021,7 +31023,7 @@ to return true:wantsResponderID| |
3102131023
return root;
3102231024
}
3102331025

31024-
var ReactVersion = "19.0.0-canary-6a8a620e";
31026+
var ReactVersion = "19.0.0-canary-59bec1ad";
3102531027

3102631028
function createPortal$1(
3102731029
children,

0 commit comments

Comments
 (0)