Skip to content

Commit 2a92b78

Browse files
committed
Move ReactDOMLegacy implementation into RootFB (#28656)
Only the FB entry point has legacy mode now so we can move the remaining code in there. Also enable disableLegacyMode in modern www builds since it doesn't expose those entry points. Now dependent on #28709. --------- Co-authored-by: Josh Story <[email protected]> DiffTrain build for [8f55a6a](8f55a6a)
1 parent 72e3e57 commit 2a92b78

14 files changed

+118717
-122051
lines changed

compiled/facebook-www/REVISION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5de8703646cdd3838cb1686f761b10c0692743aa
1+
8f55a6aa5739ed8ca80c3066fb54f4ea4cfe600a

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

+5-20
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "19.0.0-www-modern-e4b79a21";
27+
var ReactVersion = "19.0.0-www-modern-cf1ffacc";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,
@@ -404,7 +404,7 @@ if (__DEV__) {
404404
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
405405
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp;
406406
// On WWW, true is used for a new modern build.
407-
var disableLegacyMode = false;
407+
var disableLegacyMode = true;
408408

409409
/*
410410
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
@@ -3272,19 +3272,12 @@ if (__DEV__) {
32723272
// `act` calls can be nested.
32733273
//
32743274
// If we're already inside an `act` scope, reuse the existing queue.
3275-
var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
3275+
var prevIsBatchingLegacy = false;
32763276
var prevActQueue = ReactCurrentActQueue.current;
32773277
var prevActScopeDepth = actScopeDepth;
32783278
actScopeDepth++;
32793279
var queue = (ReactCurrentActQueue.current =
32803280
prevActQueue !== null ? prevActQueue : []); // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only
3281-
// set to `true` while the given callback is executed, not for updates
3282-
// triggered during an async event, because this is how the legacy
3283-
// implementation of `act` behaved.
3284-
3285-
{
3286-
ReactCurrentActQueue.isBatchingLegacy = true;
3287-
}
32883281

32893282
var result; // This tracks whether the `act` call is awaited. In certain cases, not
32903283
// awaiting it is a mistake, so we will detect that and warn.
@@ -3295,9 +3288,7 @@ if (__DEV__) {
32953288
// Reset this to `false` right before entering the React work loop. The
32963289
// only place we ever read this fields is just below, right after running
32973290
// the callback. So we don't need to reset after the callback runs.
3298-
if (!disableLegacyMode) {
3299-
ReactCurrentActQueue.didScheduleLegacyUpdate = false;
3300-
}
3291+
if (!disableLegacyMode);
33013292

33023293
result = callback();
33033294
var didScheduleLegacyUpdate = !disableLegacyMode
@@ -3313,9 +3304,7 @@ if (__DEV__) {
33133304
// that's how it worked before version 18. Yes, it's confusing! We should
33143305
// delete legacy mode!!
33153306

3316-
if (!disableLegacyMode) {
3317-
ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
3318-
}
3307+
if (!disableLegacyMode);
33193308
} catch (error) {
33203309
// `isBatchingLegacy` gets reset using the regular stack, not the async
33213310
// one used to track `act` scopes. Why, you may be wondering? Because
@@ -3325,10 +3314,6 @@ if (__DEV__) {
33253314
}
33263315

33273316
if (ReactCurrentActQueue.thrownErrors.length > 0) {
3328-
{
3329-
ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
3330-
}
3331-
33323317
popActScope(prevActQueue, prevActScopeDepth);
33333318
var thrownError = aggregateErrors(ReactCurrentActQueue.thrownErrors);
33343319
ReactCurrentActQueue.thrownErrors.length = 0;

0 commit comments

Comments
 (0)