Skip to content

Commit 25fe23d

Browse files
committed
Don't shadow EventListenerOptionsOrUseCapture and FocusOptions types (#32801)
These are built-in to Flow. DiffTrain build for [7a728df](7a728df)
1 parent 95b5d5f commit 25fe23d

35 files changed

+6237
-4954
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0b1a9e90c5d5b6a4633c225c9100af69f53752c8
1+
7a728dffd14550cd22e6d8b8514e82435bbeba76
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0b1a9e90c5d5b6a4633c225c9100af69f53752c8
1+
7a728dffd14550cd22e6d8b8514e82435bbeba76

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

Lines changed: 83 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,72 @@ __DEV__ &&
598598
function useMemoCache(size) {
599599
return resolveDispatcher().useMemoCache(size);
600600
}
601+
function releaseAsyncTransition() {
602+
ReactSharedInternals.asyncTransitions--;
603+
}
604+
function startTransition(scope, options) {
605+
var prevTransition = ReactSharedInternals.T,
606+
currentTransition = {};
607+
enableViewTransition &&
608+
(currentTransition.types =
609+
null !== prevTransition ? prevTransition.types : null);
610+
enableTransitionTracing &&
611+
((currentTransition.name =
612+
void 0 !== options && void 0 !== options.name ? options.name : null),
613+
(currentTransition.startTime = -1));
614+
currentTransition._updatedFibers = new Set();
615+
ReactSharedInternals.T = currentTransition;
616+
try {
617+
var returnValue = scope(),
618+
onStartTransitionFinish = ReactSharedInternals.S;
619+
null !== onStartTransitionFinish &&
620+
onStartTransitionFinish(currentTransition, returnValue);
621+
"object" === typeof returnValue &&
622+
null !== returnValue &&
623+
"function" === typeof returnValue.then &&
624+
(ReactSharedInternals.asyncTransitions++,
625+
returnValue.then(releaseAsyncTransition, releaseAsyncTransition),
626+
returnValue.then(noop, reportGlobalError));
627+
} catch (error) {
628+
reportGlobalError(error);
629+
} finally {
630+
null === prevTransition &&
631+
currentTransition._updatedFibers &&
632+
((scope = currentTransition._updatedFibers.size),
633+
currentTransition._updatedFibers.clear(),
634+
10 < scope &&
635+
console.warn(
636+
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
637+
)),
638+
null !== prevTransition &&
639+
null !== currentTransition.types &&
640+
(null !== prevTransition.types &&
641+
prevTransition.types !== currentTransition.types &&
642+
console.error(
643+
"We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
644+
),
645+
(prevTransition.types = currentTransition.types)),
646+
(ReactSharedInternals.T = prevTransition);
647+
}
648+
}
601649
function noop() {}
650+
function addTransitionType(type) {
651+
if (enableViewTransition) {
652+
var transition = ReactSharedInternals.T;
653+
if (null !== transition) {
654+
var transitionTypes = transition.types;
655+
null === transitionTypes
656+
? (transition.types = [type])
657+
: -1 === transitionTypes.indexOf(type) &&
658+
transitionTypes.push(type);
659+
} else
660+
0 === ReactSharedInternals.asyncTransitions &&
661+
console.error(
662+
"addTransitionType can only be called inside a `startTransition()` callback. It must be associated with a specific Transition."
663+
),
664+
startTransition(addTransitionType.bind(null, type));
665+
}
666+
}
602667
function enqueueTask(task) {
603668
if (null === enqueueTaskImpl)
604669
try {
@@ -768,16 +833,21 @@ __DEV__ &&
768833
fnName.isPureReactComponent = !0;
769834
var isArrayImpl = Array.isArray,
770835
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
771-
ReactSharedInternals = { H: null, A: null, T: null, S: null };
772-
enableViewTransition && (ReactSharedInternals.V = null);
773-
ReactSharedInternals.actQueue = null;
774-
ReactSharedInternals.isBatchingLegacy = !1;
775-
ReactSharedInternals.didScheduleLegacyUpdate = !1;
776-
ReactSharedInternals.didUsePromise = !1;
777-
ReactSharedInternals.thrownErrors = [];
778-
ReactSharedInternals.getCurrentStack = null;
779-
ReactSharedInternals.recentlyCreatedOwnerStacks = 0;
780-
var hasOwnProperty = Object.prototype.hasOwnProperty,
836+
ReactSharedInternals = {
837+
H: null,
838+
A: null,
839+
T: null,
840+
S: null,
841+
actQueue: null,
842+
asyncTransitions: 0,
843+
isBatchingLegacy: !1,
844+
didScheduleLegacyUpdate: !1,
845+
didUsePromise: !1,
846+
thrownErrors: [],
847+
getCurrentStack: null,
848+
recentlyCreatedOwnerStacks: 0
849+
},
850+
hasOwnProperty = Object.prototype.hasOwnProperty,
781851
createTask = console.createTask
782852
? console.createTask
783853
: function () {
@@ -1367,53 +1437,14 @@ __DEV__ &&
13671437
});
13681438
return compare;
13691439
};
1370-
exports.startTransition = function (scope, options) {
1371-
var prevTransition = ReactSharedInternals.T,
1372-
currentTransition = {};
1373-
enableTransitionTracing &&
1374-
((currentTransition.name =
1375-
void 0 !== options && void 0 !== options.name ? options.name : null),
1376-
(currentTransition.startTime = -1));
1377-
currentTransition._updatedFibers = new Set();
1378-
ReactSharedInternals.T = currentTransition;
1379-
try {
1380-
var returnValue = scope(),
1381-
onStartTransitionFinish = ReactSharedInternals.S;
1382-
null !== onStartTransitionFinish &&
1383-
onStartTransitionFinish(currentTransition, returnValue);
1384-
"object" === typeof returnValue &&
1385-
null !== returnValue &&
1386-
"function" === typeof returnValue.then &&
1387-
returnValue.then(noop, reportGlobalError);
1388-
} catch (error) {
1389-
reportGlobalError(error);
1390-
} finally {
1391-
null === prevTransition &&
1392-
currentTransition._updatedFibers &&
1393-
((scope = currentTransition._updatedFibers.size),
1394-
currentTransition._updatedFibers.clear(),
1395-
10 < scope &&
1396-
console.warn(
1397-
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
1398-
)),
1399-
(ReactSharedInternals.T = prevTransition);
1400-
}
1401-
};
1440+
exports.startTransition = startTransition;
14021441
exports.unstable_Activity = REACT_ACTIVITY_TYPE;
14031442
exports.unstable_LegacyHidden = dynamicFeatureFlags;
14041443
exports.unstable_Scope = renameElementSymbol;
14051444
exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;
14061445
exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE;
14071446
exports.unstable_ViewTransition = REACT_VIEW_TRANSITION_TYPE;
1408-
exports.unstable_addTransitionType = function (type) {
1409-
if (enableViewTransition) {
1410-
var pendingTransitionTypes = ReactSharedInternals.V;
1411-
null === pendingTransitionTypes &&
1412-
(pendingTransitionTypes = ReactSharedInternals.V = []);
1413-
-1 === pendingTransitionTypes.indexOf(type) &&
1414-
pendingTransitionTypes.push(type);
1415-
}
1416-
};
1447+
exports.unstable_addTransitionType = addTransitionType;
14171448
exports.unstable_getCacheForType = function (resourceType) {
14181449
var dispatcher = ReactSharedInternals.A;
14191450
return dispatcher
@@ -1507,7 +1538,7 @@ __DEV__ &&
15071538
exports.useTransition = function () {
15081539
return resolveDispatcher().useTransition();
15091540
};
1510-
exports.version = "19.2.0-www-classic-0b1a9e90-20250401";
1541+
exports.version = "19.2.0-www-classic-7a728dff-20250401";
15111542
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15121543
"function" ===
15131544
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 83 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,72 @@ __DEV__ &&
598598
function useMemoCache(size) {
599599
return resolveDispatcher().useMemoCache(size);
600600
}
601+
function releaseAsyncTransition() {
602+
ReactSharedInternals.asyncTransitions--;
603+
}
604+
function startTransition(scope, options) {
605+
var prevTransition = ReactSharedInternals.T,
606+
currentTransition = {};
607+
enableViewTransition &&
608+
(currentTransition.types =
609+
null !== prevTransition ? prevTransition.types : null);
610+
enableTransitionTracing &&
611+
((currentTransition.name =
612+
void 0 !== options && void 0 !== options.name ? options.name : null),
613+
(currentTransition.startTime = -1));
614+
currentTransition._updatedFibers = new Set();
615+
ReactSharedInternals.T = currentTransition;
616+
try {
617+
var returnValue = scope(),
618+
onStartTransitionFinish = ReactSharedInternals.S;
619+
null !== onStartTransitionFinish &&
620+
onStartTransitionFinish(currentTransition, returnValue);
621+
"object" === typeof returnValue &&
622+
null !== returnValue &&
623+
"function" === typeof returnValue.then &&
624+
(ReactSharedInternals.asyncTransitions++,
625+
returnValue.then(releaseAsyncTransition, releaseAsyncTransition),
626+
returnValue.then(noop, reportGlobalError));
627+
} catch (error) {
628+
reportGlobalError(error);
629+
} finally {
630+
null === prevTransition &&
631+
currentTransition._updatedFibers &&
632+
((scope = currentTransition._updatedFibers.size),
633+
currentTransition._updatedFibers.clear(),
634+
10 < scope &&
635+
console.warn(
636+
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
637+
)),
638+
null !== prevTransition &&
639+
null !== currentTransition.types &&
640+
(null !== prevTransition.types &&
641+
prevTransition.types !== currentTransition.types &&
642+
console.error(
643+
"We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
644+
),
645+
(prevTransition.types = currentTransition.types)),
646+
(ReactSharedInternals.T = prevTransition);
647+
}
648+
}
601649
function noop() {}
650+
function addTransitionType(type) {
651+
if (enableViewTransition) {
652+
var transition = ReactSharedInternals.T;
653+
if (null !== transition) {
654+
var transitionTypes = transition.types;
655+
null === transitionTypes
656+
? (transition.types = [type])
657+
: -1 === transitionTypes.indexOf(type) &&
658+
transitionTypes.push(type);
659+
} else
660+
0 === ReactSharedInternals.asyncTransitions &&
661+
console.error(
662+
"addTransitionType can only be called inside a `startTransition()` callback. It must be associated with a specific Transition."
663+
),
664+
startTransition(addTransitionType.bind(null, type));
665+
}
666+
}
602667
function enqueueTask(task) {
603668
if (null === enqueueTaskImpl)
604669
try {
@@ -768,16 +833,21 @@ __DEV__ &&
768833
fnName.isPureReactComponent = !0;
769834
var isArrayImpl = Array.isArray,
770835
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
771-
ReactSharedInternals = { H: null, A: null, T: null, S: null };
772-
enableViewTransition && (ReactSharedInternals.V = null);
773-
ReactSharedInternals.actQueue = null;
774-
ReactSharedInternals.isBatchingLegacy = !1;
775-
ReactSharedInternals.didScheduleLegacyUpdate = !1;
776-
ReactSharedInternals.didUsePromise = !1;
777-
ReactSharedInternals.thrownErrors = [];
778-
ReactSharedInternals.getCurrentStack = null;
779-
ReactSharedInternals.recentlyCreatedOwnerStacks = 0;
780-
var hasOwnProperty = Object.prototype.hasOwnProperty,
836+
ReactSharedInternals = {
837+
H: null,
838+
A: null,
839+
T: null,
840+
S: null,
841+
actQueue: null,
842+
asyncTransitions: 0,
843+
isBatchingLegacy: !1,
844+
didScheduleLegacyUpdate: !1,
845+
didUsePromise: !1,
846+
thrownErrors: [],
847+
getCurrentStack: null,
848+
recentlyCreatedOwnerStacks: 0
849+
},
850+
hasOwnProperty = Object.prototype.hasOwnProperty,
781851
createTask = console.createTask
782852
? console.createTask
783853
: function () {
@@ -1367,53 +1437,14 @@ __DEV__ &&
13671437
});
13681438
return compare;
13691439
};
1370-
exports.startTransition = function (scope, options) {
1371-
var prevTransition = ReactSharedInternals.T,
1372-
currentTransition = {};
1373-
enableTransitionTracing &&
1374-
((currentTransition.name =
1375-
void 0 !== options && void 0 !== options.name ? options.name : null),
1376-
(currentTransition.startTime = -1));
1377-
currentTransition._updatedFibers = new Set();
1378-
ReactSharedInternals.T = currentTransition;
1379-
try {
1380-
var returnValue = scope(),
1381-
onStartTransitionFinish = ReactSharedInternals.S;
1382-
null !== onStartTransitionFinish &&
1383-
onStartTransitionFinish(currentTransition, returnValue);
1384-
"object" === typeof returnValue &&
1385-
null !== returnValue &&
1386-
"function" === typeof returnValue.then &&
1387-
returnValue.then(noop, reportGlobalError);
1388-
} catch (error) {
1389-
reportGlobalError(error);
1390-
} finally {
1391-
null === prevTransition &&
1392-
currentTransition._updatedFibers &&
1393-
((scope = currentTransition._updatedFibers.size),
1394-
currentTransition._updatedFibers.clear(),
1395-
10 < scope &&
1396-
console.warn(
1397-
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
1398-
)),
1399-
(ReactSharedInternals.T = prevTransition);
1400-
}
1401-
};
1440+
exports.startTransition = startTransition;
14021441
exports.unstable_Activity = REACT_ACTIVITY_TYPE;
14031442
exports.unstable_LegacyHidden = dynamicFeatureFlags;
14041443
exports.unstable_Scope = renameElementSymbol;
14051444
exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;
14061445
exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE;
14071446
exports.unstable_ViewTransition = REACT_VIEW_TRANSITION_TYPE;
1408-
exports.unstable_addTransitionType = function (type) {
1409-
if (enableViewTransition) {
1410-
var pendingTransitionTypes = ReactSharedInternals.V;
1411-
null === pendingTransitionTypes &&
1412-
(pendingTransitionTypes = ReactSharedInternals.V = []);
1413-
-1 === pendingTransitionTypes.indexOf(type) &&
1414-
pendingTransitionTypes.push(type);
1415-
}
1416-
};
1447+
exports.unstable_addTransitionType = addTransitionType;
14171448
exports.unstable_getCacheForType = function (resourceType) {
14181449
var dispatcher = ReactSharedInternals.A;
14191450
return dispatcher
@@ -1507,7 +1538,7 @@ __DEV__ &&
15071538
exports.useTransition = function () {
15081539
return resolveDispatcher().useTransition();
15091540
};
1510-
exports.version = "19.2.0-www-modern-0b1a9e90-20250401";
1541+
exports.version = "19.2.0-www-modern-7a728dff-20250401";
15111542
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15121543
"function" ===
15131544
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)