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 https://github.com/facebook/react/commit/63651c49e068a04cdc6ee1e2fa9c6125167987d2.
This commit is contained in:
rickhanlonii
2024-03-28 18:20:18 +00:00
parent 9e0cbefd78
commit cf341bf9a5
4 changed files with 52 additions and 46 deletions
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<e3c2cd0dc2c519bacd879ada7f0bbba4>>
* @generated SignedSource<<b3f8b9d9ae41ad4e84b986ff88b107f6>>
*/
"use strict";
@@ -22919,21 +22919,23 @@ if (__DEV__) {
return executionContext;
}
function batchedUpdates(fn, a) {
var prevExecutionContext = executionContext;
executionContext |= BatchedContext;
{
var prevExecutionContext = executionContext;
executionContext |= BatchedContext;
try {
return fn(a);
} finally {
executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer
// most batchedUpdates-like method.
try {
return fn(a);
} finally {
executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer
// most batchedUpdates-like method.
if (
executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
!ReactCurrentActQueue.isBatchingLegacy
) {
resetRenderTimer();
flushSyncWorkOnLegacyRootsOnly();
if (
executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
!ReactCurrentActQueue.isBatchingLegacy
) {
resetRenderTimer();
flushSyncWorkOnLegacyRootsOnly();
}
}
}
}
@@ -26250,7 +26252,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "19.0.0-canary-04ac921d";
var ReactVersion = "19.0.0-canary-6c021864";
// Might add PROFILE later.
@@ -1 +1 @@
05797ccebd285999343ab4fb94eb542f84be23b1
63651c49e068a04cdc6ee1e2fa9c6125167987d2
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<524dd707c3c266c4090532051a299e80>>
* @generated SignedSource<<b96b1db3ec870619c9c09b3905a87f32>>
*/
"use strict";
@@ -26979,21 +26979,23 @@ to return true:wantsResponderID| |
return executionContext;
}
function batchedUpdates(fn, a) {
var prevExecutionContext = executionContext;
executionContext |= BatchedContext;
{
var prevExecutionContext = executionContext;
executionContext |= BatchedContext;
try {
return fn(a);
} finally {
executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer
// most batchedUpdates-like method.
try {
return fn(a);
} finally {
executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer
// most batchedUpdates-like method.
if (
executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
!ReactCurrentActQueue.isBatchingLegacy
) {
resetRenderTimer();
flushSyncWorkOnLegacyRootsOnly();
if (
executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
!ReactCurrentActQueue.isBatchingLegacy
) {
resetRenderTimer();
flushSyncWorkOnLegacyRootsOnly();
}
}
}
}
@@ -30581,7 +30583,7 @@ to return true:wantsResponderID| |
return root;
}
var ReactVersion = "19.0.0-canary-50157059";
var ReactVersion = "19.0.0-canary-fb494e93";
function createPortal$1(
children,
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<8d9f49fca475ccca8550375480fc8c85>>
* @generated SignedSource<<217faa179ec43aec470e31136cd73a9b>>
*/
"use strict";
@@ -27419,21 +27419,23 @@ to return true:wantsResponderID| |
return executionContext;
}
function batchedUpdates(fn, a) {
var prevExecutionContext = executionContext;
executionContext |= BatchedContext;
{
var prevExecutionContext = executionContext;
executionContext |= BatchedContext;
try {
return fn(a);
} finally {
executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer
// most batchedUpdates-like method.
try {
return fn(a);
} finally {
executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer
// most batchedUpdates-like method.
if (
executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
!ReactCurrentActQueue.isBatchingLegacy
) {
resetRenderTimer();
flushSyncWorkOnLegacyRootsOnly();
if (
executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
!ReactCurrentActQueue.isBatchingLegacy
) {
resetRenderTimer();
flushSyncWorkOnLegacyRootsOnly();
}
}
}
}
@@ -31021,7 +31023,7 @@ to return true:wantsResponderID| |
return root;
}
var ReactVersion = "19.0.0-canary-6a8a620e";
var ReactVersion = "19.0.0-canary-59bec1ad";
function createPortal$1(
children,