Skip to content

Commit 923bb20

Browse files
committed
Remove unstable_flushControlled (#26397)
This API has been fully replaced by `flushSync`. DiffTrain build for [99aa082](99aa082)
1 parent 969ad1d commit 923bb20

16 files changed

+218
-412
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cfc1274e3be5a93a4c93f8fb87f2109993afe1dd
1+
99aa082be0a2a62fef8ed747348ddf85c5641902

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-addde25e";
30+
var ReactVersion = "18.3.0-www-modern-269fc792";
3131

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

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

Lines changed: 2 additions & 2 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-773bb029";
72+
var ReactVersion = "18.3.0-www-classic-fb88bc59";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -24208,7 +24208,7 @@ function flushSync(fn) {
2420824208
function isInvalidExecutionContextForEventFunction() {
2420924209
// Used to throw if certain APIs are called from the wrong context.
2421024210
return (executionContext & RenderContext) !== NoContext;
24211-
}
24211+
} // This is called by the HiddenContext module when we enter or leave a
2421224212
// hidden subtree. The stack logic is managed there because that's the only
2421324213
// place that ever modifies it. Which module it lives in doesn't matter for
2421424214
// performance because this function will get inlined regardless

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

Lines changed: 2 additions & 2 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-ee471100";
72+
var ReactVersion = "18.3.0-www-modern-80930f5c";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -23868,7 +23868,7 @@ function flushSync(fn) {
2386823868
function isInvalidExecutionContextForEventFunction() {
2386923869
// Used to throw if certain APIs are called from the wrong context.
2387023870
return (executionContext & RenderContext) !== NoContext;
23871-
}
23871+
} // This is called by the HiddenContext module when we enter or leave a
2387223872
// hidden subtree. The stack logic is managed there because that's the only
2387323873
// place that ever modifies it. Which module it lives in doesn't matter for
2387423874
// performance because this function will get inlined regardless

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9555,7 +9555,7 @@ var slice = Array.prototype.slice,
95559555
return null;
95569556
},
95579557
bundleType: 0,
9558-
version: "18.3.0-www-modern-990522b1",
9558+
version: "18.3.0-www-modern-d2d40a82",
95599559
rendererPackageName: "react-art"
95609560
};
95619561
var internals$jscomp$inline_1283 = {
@@ -9586,7 +9586,7 @@ var internals$jscomp$inline_1283 = {
95869586
scheduleRoot: null,
95879587
setRefreshHandler: null,
95889588
getCurrentFiber: null,
9589-
reconcilerVersion: "18.3.0-www-modern-990522b1"
9589+
reconcilerVersion: "18.3.0-www-modern-d2d40a82"
95909590
};
95919591
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
95929592
var hook$jscomp$inline_1284 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34796,28 +34796,6 @@ function isAlreadyRendering() {
3479634796
function isInvalidExecutionContextForEventFunction() {
3479734797
// Used to throw if certain APIs are called from the wrong context.
3479834798
return (executionContext & RenderContext) !== NoContext;
34799-
}
34800-
function flushControlled(fn) {
34801-
var prevExecutionContext = executionContext;
34802-
executionContext |= BatchedContext;
34803-
var prevTransition = ReactCurrentBatchConfig$1.transition;
34804-
var previousPriority = getCurrentUpdatePriority();
34805-
34806-
try {
34807-
ReactCurrentBatchConfig$1.transition = null;
34808-
setCurrentUpdatePriority(DiscreteEventPriority);
34809-
fn();
34810-
} finally {
34811-
setCurrentUpdatePriority(previousPriority);
34812-
ReactCurrentBatchConfig$1.transition = prevTransition;
34813-
executionContext = prevExecutionContext;
34814-
34815-
if (executionContext === NoContext) {
34816-
// Flush the immediate callbacks that were scheduled during this batch
34817-
resetRenderTimer();
34818-
flushSyncCallbacks();
34819-
}
34820-
}
3482134799
} // This is called by the HiddenContext module when we enter or leave a
3482234800
// hidden subtree. The stack logic is managed there because that's the only
3482334801
// place that ever modifies it. Which module it lives in doesn't matter for
@@ -38347,7 +38325,7 @@ function createFiberRoot(
3834738325
return root;
3834838326
}
3834938327

38350-
var ReactVersion = "18.3.0-www-classic-036f93df";
38328+
var ReactVersion = "18.3.0-www-classic-da9cec21";
3835138329

3835238330
function createPortal$1(
3835338331
children,
@@ -44209,7 +44187,6 @@ exports.render = render;
4420944187
exports.unmountComponentAtNode = unmountComponentAtNode;
4421044188
exports.unstable_batchedUpdates = batchedUpdates$1;
4421144189
exports.unstable_createEventHandle = createEventHandle;
44212-
exports.unstable_flushControlled = flushControlled;
4421344190
exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
4421444191
exports.unstable_runWithPriority = runWithPriority;
4421544192
exports.version = ReactVersion;

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

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29582,28 +29582,6 @@ function isAlreadyRendering() {
2958229582
function isInvalidExecutionContextForEventFunction() {
2958329583
// Used to throw if certain APIs are called from the wrong context.
2958429584
return (executionContext & RenderContext) !== NoContext;
29585-
}
29586-
function flushControlled(fn) {
29587-
var prevExecutionContext = executionContext;
29588-
executionContext |= BatchedContext;
29589-
var prevTransition = ReactCurrentBatchConfig$1.transition;
29590-
var previousPriority = getCurrentUpdatePriority();
29591-
29592-
try {
29593-
ReactCurrentBatchConfig$1.transition = null;
29594-
setCurrentUpdatePriority(DiscreteEventPriority);
29595-
fn();
29596-
} finally {
29597-
setCurrentUpdatePriority(previousPriority);
29598-
ReactCurrentBatchConfig$1.transition = prevTransition;
29599-
executionContext = prevExecutionContext;
29600-
29601-
if (executionContext === NoContext) {
29602-
// Flush the immediate callbacks that were scheduled during this batch
29603-
resetRenderTimer();
29604-
flushSyncCallbacks();
29605-
}
29606-
}
2960729585
} // This is called by the HiddenContext module when we enter or leave a
2960829586
// hidden subtree. The stack logic is managed there because that's the only
2960929587
// place that ever modifies it. Which module it lives in doesn't matter for
@@ -33133,7 +33111,7 @@ function createFiberRoot(
3313333111
return root;
3313433112
}
3313533113

33136-
var ReactVersion = "18.3.0-www-modern-990522b1";
33114+
var ReactVersion = "18.3.0-www-modern-d2d40a82";
3313733115

3313833116
function createPortal$1(
3313933117
children,
@@ -43282,7 +43260,6 @@ exports.preinit = preinit;
4328243260
exports.preload = preload;
4328343261
exports.unstable_batchedUpdates = batchedUpdates$1;
4328443262
exports.unstable_createEventHandle = createEventHandle;
43285-
exports.unstable_flushControlled = flushControlled;
4328643263
exports.unstable_runWithPriority = runWithPriority;
4328743264
exports.version = ReactVersion;
4328843265

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

Lines changed: 34 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -10866,9 +10866,6 @@ function addTransitionProgressCallbackToPendingTransition(
1086610866
boundaries
1086710867
));
1086810868
}
10869-
function resetRenderTimer() {
10870-
workInProgressRootRenderTargetTime = now() + 500;
10871-
}
1087210869
var hasUncaughtError = !1,
1087310870
firstUncaughtError = null,
1087410871
legacyErrorBoundariesThatAlreadyFailed = null,
@@ -10941,7 +10938,8 @@ function scheduleUpdateOnFiber(root, fiber, lane, eventTime) {
1094110938
2 === lane &&
1094210939
0 === executionContext &&
1094310940
0 === (fiber.mode & 1) &&
10944-
(resetRenderTimer(), includesLegacySyncCallbacks && flushSyncCallbacks());
10941+
((workInProgressRootRenderTargetTime = now() + 500),
10942+
includesLegacySyncCallbacks && flushSyncCallbacks());
1094510943
}
1094610944
}
1094710945
function ensureRootIsScheduled(root, currentTime) {
@@ -11294,7 +11292,7 @@ function batchedUpdates$1(fn, a) {
1129411292
} finally {
1129511293
(executionContext = prevExecutionContext),
1129611294
0 === executionContext &&
11297-
(resetRenderTimer(),
11295+
((workInProgressRootRenderTargetTime = now() + 500),
1129811296
includesLegacySyncCallbacks && flushSyncCallbacks());
1129911297
}
1130011298
}
@@ -11477,7 +11475,7 @@ function renderRootConcurrent(root, lanes) {
1147711475
prevCacheDispatcher = pushCacheDispatcher();
1147811476
if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes)
1147911477
(workInProgressTransitions = getTransitionsForLanes(root, lanes)),
11480-
resetRenderTimer(),
11478+
(workInProgressRootRenderTargetTime = now() + 500),
1148111479
prepareFreshStack(root, lanes);
1148211480
a: do
1148311481
try {
@@ -13278,7 +13276,8 @@ function attemptSynchronousHydration(fiber) {
1327813276
(markRootEntangled(root$208, lanes | 2),
1327913277
ensureRootIsScheduled(root$208, now()),
1328013278
0 === (executionContext & 6) &&
13281-
(resetRenderTimer(), flushSyncCallbacks()));
13279+
((workInProgressRootRenderTargetTime = now() + 500),
13280+
flushSyncCallbacks()));
1328213281
}
1328313282
break;
1328413283
case 13:
@@ -13849,14 +13848,14 @@ var isInputEventSupported = !1;
1384913848
if (canUseDOM) {
1385013849
var JSCompiler_inline_result$jscomp$309;
1385113850
if (canUseDOM) {
13852-
var isSupported$jscomp$inline_1570 = "oninput" in document;
13853-
if (!isSupported$jscomp$inline_1570) {
13854-
var element$jscomp$inline_1571 = document.createElement("div");
13855-
element$jscomp$inline_1571.setAttribute("oninput", "return;");
13856-
isSupported$jscomp$inline_1570 =
13857-
"function" === typeof element$jscomp$inline_1571.oninput;
13851+
var isSupported$jscomp$inline_1566 = "oninput" in document;
13852+
if (!isSupported$jscomp$inline_1566) {
13853+
var element$jscomp$inline_1567 = document.createElement("div");
13854+
element$jscomp$inline_1567.setAttribute("oninput", "return;");
13855+
isSupported$jscomp$inline_1566 =
13856+
"function" === typeof element$jscomp$inline_1567.oninput;
1385813857
}
13859-
JSCompiler_inline_result$jscomp$309 = isSupported$jscomp$inline_1570;
13858+
JSCompiler_inline_result$jscomp$309 = isSupported$jscomp$inline_1566;
1386013859
} else JSCompiler_inline_result$jscomp$309 = !1;
1386113860
isInputEventSupported =
1386213861
JSCompiler_inline_result$jscomp$309 &&
@@ -13997,20 +13996,20 @@ function registerSimpleEvent(domEventName, reactName) {
1399713996
registerTwoPhaseEvent(reactName, [domEventName]);
1399813997
}
1399913998
for (
14000-
var i$jscomp$inline_1583 = 0;
14001-
i$jscomp$inline_1583 < simpleEventPluginEvents.length;
14002-
i$jscomp$inline_1583++
13999+
var i$jscomp$inline_1579 = 0;
14000+
i$jscomp$inline_1579 < simpleEventPluginEvents.length;
14001+
i$jscomp$inline_1579++
1400314002
) {
14004-
var eventName$jscomp$inline_1584 =
14005-
simpleEventPluginEvents[i$jscomp$inline_1583],
14006-
domEventName$jscomp$inline_1585 =
14007-
eventName$jscomp$inline_1584.toLowerCase(),
14008-
capitalizedEvent$jscomp$inline_1586 =
14009-
eventName$jscomp$inline_1584[0].toUpperCase() +
14010-
eventName$jscomp$inline_1584.slice(1);
14003+
var eventName$jscomp$inline_1580 =
14004+
simpleEventPluginEvents[i$jscomp$inline_1579],
14005+
domEventName$jscomp$inline_1581 =
14006+
eventName$jscomp$inline_1580.toLowerCase(),
14007+
capitalizedEvent$jscomp$inline_1582 =
14008+
eventName$jscomp$inline_1580[0].toUpperCase() +
14009+
eventName$jscomp$inline_1580.slice(1);
1401114010
registerSimpleEvent(
14012-
domEventName$jscomp$inline_1585,
14013-
"on" + capitalizedEvent$jscomp$inline_1586
14011+
domEventName$jscomp$inline_1581,
14012+
"on" + capitalizedEvent$jscomp$inline_1582
1401414013
);
1401514014
}
1401614015
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -15700,17 +15699,17 @@ Internals.Events = [
1570015699
restoreStateIfNeeded,
1570115700
batchedUpdates$1
1570215701
];
15703-
var devToolsConfig$jscomp$inline_1739 = {
15702+
var devToolsConfig$jscomp$inline_1735 = {
1570415703
findFiberByHostInstance: getClosestInstanceFromNode,
1570515704
bundleType: 0,
15706-
version: "18.3.0-www-classic-0ef1f7ef",
15705+
version: "18.3.0-www-classic-55fee6a8",
1570715706
rendererPackageName: "react-dom"
1570815707
};
1570915708
var internals$jscomp$inline_2127 = {
15710-
bundleType: devToolsConfig$jscomp$inline_1739.bundleType,
15711-
version: devToolsConfig$jscomp$inline_1739.version,
15712-
rendererPackageName: devToolsConfig$jscomp$inline_1739.rendererPackageName,
15713-
rendererConfig: devToolsConfig$jscomp$inline_1739.rendererConfig,
15709+
bundleType: devToolsConfig$jscomp$inline_1735.bundleType,
15710+
version: devToolsConfig$jscomp$inline_1735.version,
15711+
rendererPackageName: devToolsConfig$jscomp$inline_1735.rendererPackageName,
15712+
rendererConfig: devToolsConfig$jscomp$inline_1735.rendererConfig,
1571415713
overrideHookState: null,
1571515714
overrideHookStateDeletePath: null,
1571615715
overrideHookStateRenamePath: null,
@@ -15726,14 +15725,14 @@ var internals$jscomp$inline_2127 = {
1572615725
return null === fiber ? null : fiber.stateNode;
1572715726
},
1572815727
findFiberByHostInstance:
15729-
devToolsConfig$jscomp$inline_1739.findFiberByHostInstance ||
15728+
devToolsConfig$jscomp$inline_1735.findFiberByHostInstance ||
1573015729
emptyFindFiberByHostInstance,
1573115730
findHostInstancesForRefresh: null,
1573215731
scheduleRefresh: null,
1573315732
scheduleRoot: null,
1573415733
setRefreshHandler: null,
1573515734
getCurrentFiber: null,
15736-
reconcilerVersion: "18.3.0-www-classic-0ef1f7ef"
15735+
reconcilerVersion: "18.3.0-www-classic-55fee6a8"
1573715736
};
1573815737
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1573915738
var hook$jscomp$inline_2128 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -15954,22 +15953,6 @@ exports.unstable_createEventHandle = function (type, options) {
1595415953
"boolean" === typeof options && (isCapturePhaseListener = options));
1595515954
return eventHandle;
1595615955
};
15957-
exports.unstable_flushControlled = function (fn) {
15958-
var prevExecutionContext = executionContext;
15959-
executionContext |= 1;
15960-
var prevTransition = ReactCurrentBatchConfig$1.transition,
15961-
previousPriority = currentUpdatePriority;
15962-
try {
15963-
(ReactCurrentBatchConfig$1.transition = null),
15964-
(currentUpdatePriority = 2),
15965-
fn();
15966-
} finally {
15967-
(currentUpdatePriority = previousPriority),
15968-
(ReactCurrentBatchConfig$1.transition = prevTransition),
15969-
(executionContext = prevExecutionContext),
15970-
0 === executionContext && (resetRenderTimer(), flushSyncCallbacks());
15971-
}
15972-
};
1597315956
exports.unstable_renderSubtreeIntoContainer = function (
1597415957
parentComponent,
1597515958
element,
@@ -15989,4 +15972,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
1598915972
);
1599015973
};
1599115974
exports.unstable_runWithPriority = runWithPriority;
15992-
exports.version = "18.3.0-www-classic-0ef1f7ef";
15975+
exports.version = "18.3.0-www-classic-55fee6a8";

0 commit comments

Comments
 (0)