Skip to content

Commit

Permalink
Remove findInstanceBlockingEvent unused parameters (#26534)
Browse files Browse the repository at this point in the history
## Summary
First three parameters of `findInstanceBlockingEvent` are unused since I
think if we remove the unused parameters it makes it easier to know that
which parameters is need by `findInstanceBlockingEvent`.

## How did you test this change?
Existing tests.

DiffTrain build for [d5fd60f](d5fd60f)
  • Loading branch information
kassens committed Apr 4, 2023
1 parent dc6a835 commit 82b97bf
Show file tree
Hide file tree
Showing 15 changed files with 194 additions and 404 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eeabb7312f509eb2094452a4389646000ea8ea14
d5fd60f7e663a5cee61636f8f2dd174efa0fb2f0
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-www-modern-a911b5ee";
var ReactVersion = "18.3.0-www-modern-51b176b7";

// ATTENTION
// When adding new symbols to this file,
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}

var ReactVersion = "18.3.0-www-classic-1e3ad805";
var ReactVersion = "18.3.0-www-classic-b1a3b1a3";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -9732,7 +9732,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-modern-3993aa7c",
version: "18.3.0-www-modern-d1ed0140",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1324 = {
Expand Down Expand Up @@ -9763,7 +9763,7 @@ var internals$jscomp$inline_1324 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-3993aa7c"
reconcilerVersion: "18.3.0-www-modern-d1ed0140"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1325 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
31 changes: 5 additions & 26 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -33299,7 +33299,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-classic-e023b01e";
var ReactVersion = "18.3.0-www-classic-41b4955f";

function createPortal$1(
children,
Expand Down Expand Up @@ -45326,13 +45326,7 @@ function attemptReplayContinuousQueuedEvent(queuedEvent) {
var targetContainers = queuedEvent.targetContainers;

while (targetContainers.length > 0) {
var targetContainer = targetContainers[0];
var nextBlockedOn = findInstanceBlockingEvent(
queuedEvent.domEventName,
queuedEvent.eventSystemFlags,
targetContainer,
queuedEvent.nativeEvent
);
var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.nativeEvent);

if (nextBlockedOn === null) {
var nativeEvent = queuedEvent.nativeEvent;
Expand Down Expand Up @@ -45554,12 +45548,7 @@ function dispatchEvent(
return;
}

var blockedOn = findInstanceBlockingEvent(
domEventName,
eventSystemFlags,
targetContainer,
nativeEvent
);
var blockedOn = findInstanceBlockingEvent(nativeEvent);

if (blockedOn === null) {
dispatchEventForPluginEventSystem(
Expand Down Expand Up @@ -45600,12 +45589,7 @@ function dispatchEvent(
attemptSynchronousHydration(fiber);
}

var nextBlockedOn = findInstanceBlockingEvent(
domEventName,
eventSystemFlags,
targetContainer,
nativeEvent
);
var nextBlockedOn = findInstanceBlockingEvent(nativeEvent);

if (nextBlockedOn === null) {
dispatchEventForPluginEventSystem(
Expand Down Expand Up @@ -45643,12 +45627,7 @@ function dispatchEvent(
var return_targetInst = null; // Returns a SuspenseInstance or Container if it's blocked.
// The return_targetInst field above is conceptually part of the return value.

function findInstanceBlockingEvent(
domEventName,
eventSystemFlags,
targetContainer,
nativeEvent
) {
function findInstanceBlockingEvent(nativeEvent) {
// TODO: Warn if _enabled is false.
return_targetInst = null;
var nativeEventTarget = getEventTarget(nativeEvent);
Expand Down
31 changes: 5 additions & 26 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -33138,7 +33138,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-modern-3993aa7c";
var ReactVersion = "18.3.0-www-modern-d1ed0140";

function createPortal$1(
children,
Expand Down Expand Up @@ -34153,13 +34153,7 @@ function attemptReplayContinuousQueuedEvent(queuedEvent) {
var targetContainers = queuedEvent.targetContainers;

while (targetContainers.length > 0) {
var targetContainer = targetContainers[0];
var nextBlockedOn = findInstanceBlockingEvent(
queuedEvent.domEventName,
queuedEvent.eventSystemFlags,
targetContainer,
queuedEvent.nativeEvent
);
var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.nativeEvent);

if (nextBlockedOn === null) {
var nativeEvent = queuedEvent.nativeEvent;
Expand Down Expand Up @@ -34381,12 +34375,7 @@ function dispatchEvent(
return;
}

var blockedOn = findInstanceBlockingEvent(
domEventName,
eventSystemFlags,
targetContainer,
nativeEvent
);
var blockedOn = findInstanceBlockingEvent(nativeEvent);

if (blockedOn === null) {
dispatchEventForPluginEventSystem(
Expand Down Expand Up @@ -34427,12 +34416,7 @@ function dispatchEvent(
attemptSynchronousHydration(fiber);
}

var nextBlockedOn = findInstanceBlockingEvent(
domEventName,
eventSystemFlags,
targetContainer,
nativeEvent
);
var nextBlockedOn = findInstanceBlockingEvent(nativeEvent);

if (nextBlockedOn === null) {
dispatchEventForPluginEventSystem(
Expand Down Expand Up @@ -34470,12 +34454,7 @@ function dispatchEvent(
var return_targetInst = null; // Returns a SuspenseInstance or Container if it's blocked.
// The return_targetInst field above is conceptually part of the return value.

function findInstanceBlockingEvent(
domEventName,
eventSystemFlags,
targetContainer,
nativeEvent
) {
function findInstanceBlockingEvent(nativeEvent) {
// TODO: Warn if _enabled is false.
return_targetInst = null;
var nativeEventTarget = getEventTarget(nativeEvent);
Expand Down
77 changes: 28 additions & 49 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -15746,12 +15746,7 @@ function attemptReplayContinuousQueuedEvent(queuedEvent) {
0 < targetContainers.length;

) {
var nextBlockedOn = findInstanceBlockingEvent(
queuedEvent.domEventName,
queuedEvent.eventSystemFlags,
targetContainers[0],
queuedEvent.nativeEvent
);
var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.nativeEvent);
if (null === nextBlockedOn) {
nextBlockedOn = queuedEvent.nativeEvent;
var nativeEventClone = new nextBlockedOn.constructor(
Expand Down Expand Up @@ -15895,12 +15890,7 @@ function dispatchEvent(
nativeEvent
) {
if (_enabled) {
var blockedOn = findInstanceBlockingEvent(
domEventName,
eventSystemFlags,
targetContainer,
nativeEvent
);
var blockedOn = findInstanceBlockingEvent(nativeEvent);
if (null === blockedOn)
dispatchEventForPluginEventSystem(
domEventName,
Expand Down Expand Up @@ -15928,12 +15918,7 @@ function dispatchEvent(
for (; null !== blockedOn; ) {
var fiber = getInstanceFromNode(blockedOn);
null !== fiber && attemptSynchronousHydration(fiber);
fiber = findInstanceBlockingEvent(
domEventName,
eventSystemFlags,
targetContainer,
nativeEvent
);
fiber = findInstanceBlockingEvent(nativeEvent);
null === fiber &&
dispatchEventForPluginEventSystem(
domEventName,
Expand All @@ -15957,35 +15942,29 @@ function dispatchEvent(
}
}
var return_targetInst = null;
function findInstanceBlockingEvent(
domEventName,
eventSystemFlags,
targetContainer,
nativeEvent
) {
function findInstanceBlockingEvent(nativeEvent) {
return_targetInst = null;
domEventName = getEventTarget(nativeEvent);
domEventName = getClosestInstanceFromNode(domEventName);
if (null !== domEventName)
if (
((eventSystemFlags = getNearestMountedFiber(domEventName)),
null === eventSystemFlags)
)
domEventName = null;
else if (
((targetContainer = eventSystemFlags.tag), 13 === targetContainer)
) {
domEventName = getSuspenseInstanceFromFiber(eventSystemFlags);
if (null !== domEventName) return domEventName;
domEventName = null;
} else if (3 === targetContainer) {
if (eventSystemFlags.stateNode.current.memoizedState.isDehydrated)
return 3 === eventSystemFlags.tag
? eventSystemFlags.stateNode.containerInfo
: null;
domEventName = null;
} else eventSystemFlags !== domEventName && (domEventName = null);
return_targetInst = domEventName;
nativeEvent = getEventTarget(nativeEvent);
nativeEvent = getClosestInstanceFromNode(nativeEvent);
if (null !== nativeEvent) {
var nearestMounted = getNearestMountedFiber(nativeEvent);
if (null === nearestMounted) nativeEvent = null;
else {
var tag = nearestMounted.tag;
if (13 === tag) {
nativeEvent = getSuspenseInstanceFromFiber(nearestMounted);
if (null !== nativeEvent) return nativeEvent;
nativeEvent = null;
} else if (3 === tag) {
if (nearestMounted.stateNode.current.memoizedState.isDehydrated)
return 3 === nearestMounted.tag
? nearestMounted.stateNode.containerInfo
: null;
nativeEvent = null;
} else nearestMounted !== nativeEvent && (nativeEvent = null);
}
}
return_targetInst = nativeEvent;
return null;
}
function getEventPriority(domEventName) {
Expand Down Expand Up @@ -16272,7 +16251,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1812 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-6662e068",
version: "18.3.0-www-classic-c468f128",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2195 = {
Expand Down Expand Up @@ -16302,7 +16281,7 @@ var internals$jscomp$inline_2195 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-6662e068"
reconcilerVersion: "18.3.0-www-classic-c468f128"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2196 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16542,4 +16521,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
);
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-www-classic-6662e068";
exports.version = "18.3.0-www-classic-c468f128";
Loading

0 comments on commit 82b97bf

Please sign in to comment.