Skip to content

Commit 6433b78

Browse files
committed
Clean up discrete event replaying (#26558)
This reverts commit cc958d2. DiffTrain build for [7ecfd6d](7ecfd6d)
1 parent f504564 commit 6433b78

15 files changed

+451
-577
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6bb84216807f5386d8a83baf9ee464358a68c7bd
1+
7ecfd6dc036fd923e7bdfd090e0956b1eca4323a

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-d63670f9";
30+
var ReactVersion = "18.3.0-www-modern-7cca7bc7";
3131

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

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

Lines changed: 1 addition & 1 deletion
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-afdf1f7f";
72+
var ReactVersion = "18.3.0-www-classic-9409ec15";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9737,7 +9737,7 @@ var slice = Array.prototype.slice,
97379737
return null;
97389738
},
97399739
bundleType: 0,
9740-
version: "18.3.0-www-modern-c4645088",
9740+
version: "18.3.0-www-modern-3e5f6beb",
97419741
rendererPackageName: "react-art"
97429742
};
97439743
var internals$jscomp$inline_1324 = {
@@ -9768,7 +9768,7 @@ var internals$jscomp$inline_1324 = {
97689768
scheduleRoot: null,
97699769
setRefreshHandler: null,
97709770
getCurrentFiber: null,
9771-
reconcilerVersion: "18.3.0-www-modern-c4645088"
9771+
reconcilerVersion: "18.3.0-www-modern-3e5f6beb"
97729772
};
97739773
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
97749774
var hook$jscomp$inline_1325 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33407,7 +33407,7 @@ function createFiberRoot(
3340733407
return root;
3340833408
}
3340933409

33410-
var ReactVersion = "18.3.0-www-classic-5c06c715";
33410+
var ReactVersion = "18.3.0-www-classic-731f727b";
3341133411

3341233412
function createPortal$1(
3341333413
children,
@@ -44113,9 +44113,7 @@ function isOwnedInstance(node) {
4411344113

4411444114
// has this definition built-in.
4411544115

44116-
var hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed.
44117-
44118-
var queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout.
44116+
var hasScheduledReplayAttempt = false; // The last of each continuous event type. We only need to replay the last one
4411944117
// if the last target was dehydrated.
4412044118

4412144119
var queuedFocus = null;
@@ -44496,22 +44494,6 @@ function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
4449644494
}
4449744495

4449844496
function retryIfBlockedOn(unblocked) {
44499-
// Mark anything that was blocked on this as no longer blocked
44500-
// and eligible for a replay.
44501-
if (queuedDiscreteEvents.length > 0) {
44502-
scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's
44503-
// worth it because we expect very few discrete events to queue up and once
44504-
// we are actually fully unblocked it will be fast to replay them.
44505-
44506-
for (var i = 1; i < queuedDiscreteEvents.length; i++) {
44507-
var queuedEvent = queuedDiscreteEvents[i];
44508-
44509-
if (queuedEvent.blockedOn === unblocked) {
44510-
queuedEvent.blockedOn = null;
44511-
}
44512-
}
44513-
}
44514-
4451544497
if (queuedFocus !== null) {
4451644498
scheduleCallbackIfUnblocked(queuedFocus, unblocked);
4451744499
}
@@ -44531,8 +44513,8 @@ function retryIfBlockedOn(unblocked) {
4453144513
queuedPointers.forEach(unblock);
4453244514
queuedPointerCaptures.forEach(unblock);
4453344515

44534-
for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
44535-
var queuedTarget = queuedExplicitHydrationTargets[_i];
44516+
for (var i = 0; i < queuedExplicitHydrationTargets.length; i++) {
44517+
var queuedTarget = queuedExplicitHydrationTargets[i];
4453644518

4453744519
if (queuedTarget.blockedOn === unblocked) {
4453844520
queuedTarget.blockedOn = null;

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

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33246,7 +33246,7 @@ function createFiberRoot(
3324633246
return root;
3324733247
}
3324833248

33249-
var ReactVersion = "18.3.0-www-modern-c4645088";
33249+
var ReactVersion = "18.3.0-www-modern-3e5f6beb";
3325033250

3325133251
function createPortal$1(
3325233252
children,
@@ -33950,9 +33950,7 @@ if (canUseDOM) {
3395033950

3395133951
// has this definition built-in.
3395233952

33953-
var hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed.
33954-
33955-
var queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout.
33953+
var hasScheduledReplayAttempt = false; // The last of each continuous event type. We only need to replay the last one
3395633954
// if the last target was dehydrated.
3395733955

3395833956
var queuedFocus = null;
@@ -34333,22 +34331,6 @@ function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
3433334331
}
3433434332

3433534333
function retryIfBlockedOn(unblocked) {
34336-
// Mark anything that was blocked on this as no longer blocked
34337-
// and eligible for a replay.
34338-
if (queuedDiscreteEvents.length > 0) {
34339-
scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's
34340-
// worth it because we expect very few discrete events to queue up and once
34341-
// we are actually fully unblocked it will be fast to replay them.
34342-
34343-
for (var i = 1; i < queuedDiscreteEvents.length; i++) {
34344-
var queuedEvent = queuedDiscreteEvents[i];
34345-
34346-
if (queuedEvent.blockedOn === unblocked) {
34347-
queuedEvent.blockedOn = null;
34348-
}
34349-
}
34350-
}
34351-
3435234334
if (queuedFocus !== null) {
3435334335
scheduleCallbackIfUnblocked(queuedFocus, unblocked);
3435434336
}
@@ -34368,8 +34350,8 @@ function retryIfBlockedOn(unblocked) {
3436834350
queuedPointers.forEach(unblock);
3436934351
queuedPointerCaptures.forEach(unblock);
3437034352

34371-
for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
34372-
var queuedTarget = queuedExplicitHydrationTargets[_i];
34353+
for (var i = 0; i < queuedExplicitHydrationTargets.length; i++) {
34354+
var queuedTarget = queuedExplicitHydrationTargets[i];
3437334355

3437434356
if (queuedTarget.blockedOn === unblocked) {
3437534357
queuedTarget.blockedOn = null;

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

Lines changed: 55 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -12575,19 +12575,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) {
1257512575
}
1257612576
var isInputEventSupported = !1;
1257712577
if (canUseDOM) {
12578-
var JSCompiler_inline_result$jscomp$335;
12578+
var JSCompiler_inline_result$jscomp$334;
1257912579
if (canUseDOM) {
12580-
var isSupported$jscomp$inline_1568 = "oninput" in document;
12581-
if (!isSupported$jscomp$inline_1568) {
12582-
var element$jscomp$inline_1569 = document.createElement("div");
12583-
element$jscomp$inline_1569.setAttribute("oninput", "return;");
12584-
isSupported$jscomp$inline_1568 =
12585-
"function" === typeof element$jscomp$inline_1569.oninput;
12580+
var isSupported$jscomp$inline_1567 = "oninput" in document;
12581+
if (!isSupported$jscomp$inline_1567) {
12582+
var element$jscomp$inline_1568 = document.createElement("div");
12583+
element$jscomp$inline_1568.setAttribute("oninput", "return;");
12584+
isSupported$jscomp$inline_1567 =
12585+
"function" === typeof element$jscomp$inline_1568.oninput;
1258612586
}
12587-
JSCompiler_inline_result$jscomp$335 = isSupported$jscomp$inline_1568;
12588-
} else JSCompiler_inline_result$jscomp$335 = !1;
12587+
JSCompiler_inline_result$jscomp$334 = isSupported$jscomp$inline_1567;
12588+
} else JSCompiler_inline_result$jscomp$334 = !1;
1258912589
isInputEventSupported =
12590-
JSCompiler_inline_result$jscomp$335 &&
12590+
JSCompiler_inline_result$jscomp$334 &&
1259112591
(!document.documentMode || 9 < document.documentMode);
1259212592
}
1259312593
function stopWatchingForValueChange() {
@@ -12896,20 +12896,20 @@ function registerSimpleEvent(domEventName, reactName) {
1289612896
registerTwoPhaseEvent(reactName, [domEventName]);
1289712897
}
1289812898
for (
12899-
var i$jscomp$inline_1609 = 0;
12900-
i$jscomp$inline_1609 < simpleEventPluginEvents.length;
12901-
i$jscomp$inline_1609++
12899+
var i$jscomp$inline_1608 = 0;
12900+
i$jscomp$inline_1608 < simpleEventPluginEvents.length;
12901+
i$jscomp$inline_1608++
1290212902
) {
12903-
var eventName$jscomp$inline_1610 =
12904-
simpleEventPluginEvents[i$jscomp$inline_1609],
12905-
domEventName$jscomp$inline_1611 =
12906-
eventName$jscomp$inline_1610.toLowerCase(),
12907-
capitalizedEvent$jscomp$inline_1612 =
12908-
eventName$jscomp$inline_1610[0].toUpperCase() +
12909-
eventName$jscomp$inline_1610.slice(1);
12903+
var eventName$jscomp$inline_1609 =
12904+
simpleEventPluginEvents[i$jscomp$inline_1608],
12905+
domEventName$jscomp$inline_1610 =
12906+
eventName$jscomp$inline_1609.toLowerCase(),
12907+
capitalizedEvent$jscomp$inline_1611 =
12908+
eventName$jscomp$inline_1609[0].toUpperCase() +
12909+
eventName$jscomp$inline_1609.slice(1);
1291012910
registerSimpleEvent(
12911-
domEventName$jscomp$inline_1611,
12912-
"on" + capitalizedEvent$jscomp$inline_1612
12911+
domEventName$jscomp$inline_1610,
12912+
"on" + capitalizedEvent$jscomp$inline_1611
1291312913
);
1291412914
}
1291512915
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -15395,7 +15395,6 @@ function markNodeAsHoistable(node) {
1539515395
node[internalHoistableMarker] = !0;
1539615396
}
1539715397
var hasScheduledReplayAttempt = !1,
15398-
queuedDiscreteEvents = [],
1539915398
queuedFocus = null,
1540015399
queuedDrag = null,
1540115400
queuedMouse = null,
@@ -15635,23 +15634,15 @@ function retryIfBlockedOn(unblocked) {
1563515634
function unblock(queuedEvent) {
1563615635
return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
1563715636
}
15638-
if (0 < queuedDiscreteEvents.length) {
15639-
scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked);
15640-
for (var i = 1; i < queuedDiscreteEvents.length; i++) {
15641-
var queuedEvent$jscomp$0 = queuedDiscreteEvents[i];
15642-
queuedEvent$jscomp$0.blockedOn === unblocked &&
15643-
(queuedEvent$jscomp$0.blockedOn = null);
15644-
}
15645-
}
1564615637
null !== queuedFocus && scheduleCallbackIfUnblocked(queuedFocus, unblocked);
1564715638
null !== queuedDrag && scheduleCallbackIfUnblocked(queuedDrag, unblocked);
1564815639
null !== queuedMouse && scheduleCallbackIfUnblocked(queuedMouse, unblocked);
1564915640
queuedPointers.forEach(unblock);
1565015641
queuedPointerCaptures.forEach(unblock);
15651-
for (i = 0; i < queuedExplicitHydrationTargets.length; i++)
15652-
(queuedEvent$jscomp$0 = queuedExplicitHydrationTargets[i]),
15653-
queuedEvent$jscomp$0.blockedOn === unblocked &&
15654-
(queuedEvent$jscomp$0.blockedOn = null);
15642+
for (var i = 0; i < queuedExplicitHydrationTargets.length; i++) {
15643+
var queuedTarget = queuedExplicitHydrationTargets[i];
15644+
queuedTarget.blockedOn === unblocked && (queuedTarget.blockedOn = null);
15645+
}
1565515646
for (
1565615647
;
1565715648
0 < queuedExplicitHydrationTargets.length &&
@@ -15973,11 +15964,11 @@ function legacyCreateRootFromDOMContainer(
1597315964
if ("function" === typeof callback) {
1597415965
var originalCallback = callback;
1597515966
callback = function () {
15976-
var instance = getPublicRootInstance(root$263);
15967+
var instance = getPublicRootInstance(root$262);
1597715968
originalCallback.call(instance);
1597815969
};
1597915970
}
15980-
var root$263 = createHydrationContainer(
15971+
var root$262 = createHydrationContainer(
1598115972
initialChildren,
1598215973
callback,
1598315974
container,
@@ -15989,23 +15980,23 @@ function legacyCreateRootFromDOMContainer(
1598915980
noopOnRecoverableError,
1599015981
null
1599115982
);
15992-
container._reactRootContainer = root$263;
15993-
container[internalContainerInstanceKey] = root$263.current;
15983+
container._reactRootContainer = root$262;
15984+
container[internalContainerInstanceKey] = root$262.current;
1599415985
listenToAllSupportedEvents(
1599515986
8 === container.nodeType ? container.parentNode : container
1599615987
);
1599715988
flushSync$1();
15998-
return root$263;
15989+
return root$262;
1599915990
}
1600015991
clearContainer(container);
1600115992
if ("function" === typeof callback) {
16002-
var originalCallback$264 = callback;
15993+
var originalCallback$263 = callback;
1600315994
callback = function () {
16004-
var instance = getPublicRootInstance(root$265);
16005-
originalCallback$264.call(instance);
15995+
var instance = getPublicRootInstance(root$264);
15996+
originalCallback$263.call(instance);
1600615997
};
1600715998
}
16008-
var root$265 = createFiberRoot(
15999+
var root$264 = createFiberRoot(
1600916000
container,
1601016001
0,
1601116002
!1,
@@ -16017,15 +16008,15 @@ function legacyCreateRootFromDOMContainer(
1601716008
noopOnRecoverableError,
1601816009
null
1601916010
);
16020-
container._reactRootContainer = root$265;
16021-
container[internalContainerInstanceKey] = root$265.current;
16011+
container._reactRootContainer = root$264;
16012+
container[internalContainerInstanceKey] = root$264.current;
1602216013
listenToAllSupportedEvents(
1602316014
8 === container.nodeType ? container.parentNode : container
1602416015
);
1602516016
flushSync$1(function () {
16026-
updateContainer(initialChildren, root$265, parentComponent, callback);
16017+
updateContainer(initialChildren, root$264, parentComponent, callback);
1602716018
});
16028-
return root$265;
16019+
return root$264;
1602916020
}
1603016021
function legacyRenderSubtreeIntoContainer(
1603116022
parentComponent,
@@ -16084,17 +16075,17 @@ Internals.Events = [
1608416075
restoreStateIfNeeded,
1608516076
batchedUpdates$1
1608616077
];
16087-
var devToolsConfig$jscomp$inline_1827 = {
16078+
var devToolsConfig$jscomp$inline_1826 = {
1608816079
findFiberByHostInstance: getClosestInstanceFromNode,
1608916080
bundleType: 0,
16090-
version: "18.3.0-www-classic-253ebf19",
16081+
version: "18.3.0-www-classic-5ce3ec5f",
1609116082
rendererPackageName: "react-dom"
1609216083
};
16093-
var internals$jscomp$inline_2196 = {
16094-
bundleType: devToolsConfig$jscomp$inline_1827.bundleType,
16095-
version: devToolsConfig$jscomp$inline_1827.version,
16096-
rendererPackageName: devToolsConfig$jscomp$inline_1827.rendererPackageName,
16097-
rendererConfig: devToolsConfig$jscomp$inline_1827.rendererConfig,
16084+
var internals$jscomp$inline_2195 = {
16085+
bundleType: devToolsConfig$jscomp$inline_1826.bundleType,
16086+
version: devToolsConfig$jscomp$inline_1826.version,
16087+
rendererPackageName: devToolsConfig$jscomp$inline_1826.rendererPackageName,
16088+
rendererConfig: devToolsConfig$jscomp$inline_1826.rendererConfig,
1609816089
overrideHookState: null,
1609916090
overrideHookStateDeletePath: null,
1610016091
overrideHookStateRenamePath: null,
@@ -16110,26 +16101,26 @@ var internals$jscomp$inline_2196 = {
1611016101
return null === fiber ? null : fiber.stateNode;
1611116102
},
1611216103
findFiberByHostInstance:
16113-
devToolsConfig$jscomp$inline_1827.findFiberByHostInstance ||
16104+
devToolsConfig$jscomp$inline_1826.findFiberByHostInstance ||
1611416105
emptyFindFiberByHostInstance,
1611516106
findHostInstancesForRefresh: null,
1611616107
scheduleRefresh: null,
1611716108
scheduleRoot: null,
1611816109
setRefreshHandler: null,
1611916110
getCurrentFiber: null,
16120-
reconcilerVersion: "18.3.0-www-classic-253ebf19"
16111+
reconcilerVersion: "18.3.0-www-classic-5ce3ec5f"
1612116112
};
1612216113
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
16123-
var hook$jscomp$inline_2197 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
16114+
var hook$jscomp$inline_2196 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
1612416115
if (
16125-
!hook$jscomp$inline_2197.isDisabled &&
16126-
hook$jscomp$inline_2197.supportsFiber
16116+
!hook$jscomp$inline_2196.isDisabled &&
16117+
hook$jscomp$inline_2196.supportsFiber
1612716118
)
1612816119
try {
16129-
(rendererID = hook$jscomp$inline_2197.inject(
16130-
internals$jscomp$inline_2196
16120+
(rendererID = hook$jscomp$inline_2196.inject(
16121+
internals$jscomp$inline_2195
1613116122
)),
16132-
(injectedHook = hook$jscomp$inline_2197);
16123+
(injectedHook = hook$jscomp$inline_2196);
1613316124
} catch (err) {}
1613416125
}
1613516126
assign(Internals, {
@@ -16357,4 +16348,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
1635716348
);
1635816349
};
1635916350
exports.unstable_runWithPriority = runWithPriority;
16360-
exports.version = "18.3.0-www-classic-253ebf19";
16351+
exports.version = "18.3.0-www-classic-5ce3ec5f";

0 commit comments

Comments
 (0)