Skip to content

Commit

Permalink
Don't read currentTransition back from internals (#30991)
Browse files Browse the repository at this point in the history
This code is weird. It reads back the transition that it just set from
the shared internals. It's almost like it expects it to be a getter or
something.

This avoids that and makes it consistent with what ReactFiberHooks
already does.

DiffTrain build for [15da917](15da917)
  • Loading branch information
sebmarkbage committed Sep 17, 2024
1 parent e70db3d commit 2acc36c
Show file tree
Hide file tree
Showing 34 changed files with 218 additions and 212 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4549be0f846e7df5a4eaabf06369d93bd120271e
15da9174518f18f82869767ebe2a21be2fc8bd90
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4549be0f846e7df5a4eaabf06369d93bd120271e
15da9174518f18f82869767ebe2a21be2fc8bd90
15 changes: 7 additions & 8 deletions compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1874,20 +1874,19 @@ __DEV__ &&
};
exports.startTransition = function (scope, options) {
var prevTransition = ReactSharedInternals.T,
transition = {};
ReactSharedInternals.T = transition;
var currentTransition = ReactSharedInternals.T;
ReactSharedInternals.T._updatedFibers = new Set();
currentTransition = {};
ReactSharedInternals.T = currentTransition;
currentTransition._updatedFibers = new Set();
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactSharedInternals.T.name = options.name),
(ReactSharedInternals.T.startTime = -1));
((currentTransition.name = options.name),
(currentTransition.startTime = -1));
try {
var returnValue = scope(),
onStartTransitionFinish = ReactSharedInternals.S;
null !== onStartTransitionFinish &&
onStartTransitionFinish(transition, returnValue);
onStartTransitionFinish(currentTransition, returnValue);
"object" === typeof returnValue &&
null !== returnValue &&
"function" === typeof returnValue.then &&
Expand Down Expand Up @@ -2001,7 +2000,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-classic-4549be0f-20240917";
exports.version = "19.0.0-www-classic-15da9174-20240917";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
15 changes: 7 additions & 8 deletions compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1854,20 +1854,19 @@ __DEV__ &&
};
exports.startTransition = function (scope, options) {
var prevTransition = ReactSharedInternals.T,
transition = {};
ReactSharedInternals.T = transition;
var currentTransition = ReactSharedInternals.T;
ReactSharedInternals.T._updatedFibers = new Set();
currentTransition = {};
ReactSharedInternals.T = currentTransition;
currentTransition._updatedFibers = new Set();
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactSharedInternals.T.name = options.name),
(ReactSharedInternals.T.startTime = -1));
((currentTransition.name = options.name),
(currentTransition.startTime = -1));
try {
var returnValue = scope(),
onStartTransitionFinish = ReactSharedInternals.S;
null !== onStartTransitionFinish &&
onStartTransitionFinish(transition, returnValue);
onStartTransitionFinish(currentTransition, returnValue);
"object" === typeof returnValue &&
null !== returnValue &&
"function" === typeof returnValue.then &&
Expand Down Expand Up @@ -1981,7 +1980,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-modern-4549be0f-20240917";
exports.version = "19.0.0-www-modern-15da9174-20240917";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
12 changes: 6 additions & 6 deletions compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,18 +566,18 @@ exports.memo = function (type, compare) {
};
exports.startTransition = function (scope, options) {
var prevTransition = ReactSharedInternals.T,
transition = {};
ReactSharedInternals.T = transition;
currentTransition = {};
ReactSharedInternals.T = currentTransition;
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactSharedInternals.T.name = options.name),
(ReactSharedInternals.T.startTime = -1));
((currentTransition.name = options.name),
(currentTransition.startTime = -1));
try {
var returnValue = scope(),
onStartTransitionFinish = ReactSharedInternals.S;
null !== onStartTransitionFinish &&
onStartTransitionFinish(transition, returnValue);
onStartTransitionFinish(currentTransition, returnValue);
"object" === typeof returnValue &&
null !== returnValue &&
"function" === typeof returnValue.then &&
Expand Down Expand Up @@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-4549be0f-20240917";
exports.version = "19.0.0-www-classic-15da9174-20240917";
12 changes: 6 additions & 6 deletions compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,18 +566,18 @@ exports.memo = function (type, compare) {
};
exports.startTransition = function (scope, options) {
var prevTransition = ReactSharedInternals.T,
transition = {};
ReactSharedInternals.T = transition;
currentTransition = {};
ReactSharedInternals.T = currentTransition;
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactSharedInternals.T.name = options.name),
(ReactSharedInternals.T.startTime = -1));
((currentTransition.name = options.name),
(currentTransition.startTime = -1));
try {
var returnValue = scope(),
onStartTransitionFinish = ReactSharedInternals.S;
null !== onStartTransitionFinish &&
onStartTransitionFinish(transition, returnValue);
onStartTransitionFinish(currentTransition, returnValue);
"object" === typeof returnValue &&
null !== returnValue &&
"function" === typeof returnValue.then &&
Expand Down Expand Up @@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-4549be0f-20240917";
exports.version = "19.0.0-www-modern-15da9174-20240917";
12 changes: 6 additions & 6 deletions compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,18 +570,18 @@ exports.memo = function (type, compare) {
};
exports.startTransition = function (scope, options) {
var prevTransition = ReactSharedInternals.T,
transition = {};
ReactSharedInternals.T = transition;
currentTransition = {};
ReactSharedInternals.T = currentTransition;
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactSharedInternals.T.name = options.name),
(ReactSharedInternals.T.startTime = -1));
((currentTransition.name = options.name),
(currentTransition.startTime = -1));
try {
var returnValue = scope(),
onStartTransitionFinish = ReactSharedInternals.S;
null !== onStartTransitionFinish &&
onStartTransitionFinish(transition, returnValue);
onStartTransitionFinish(currentTransition, returnValue);
"object" === typeof returnValue &&
null !== returnValue &&
"function" === typeof returnValue.then &&
Expand Down Expand Up @@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-4549be0f-20240917";
exports.version = "19.0.0-www-classic-15da9174-20240917";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
12 changes: 6 additions & 6 deletions compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,18 +570,18 @@ exports.memo = function (type, compare) {
};
exports.startTransition = function (scope, options) {
var prevTransition = ReactSharedInternals.T,
transition = {};
ReactSharedInternals.T = transition;
currentTransition = {};
ReactSharedInternals.T = currentTransition;
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactSharedInternals.T.name = options.name),
(ReactSharedInternals.T.startTime = -1));
((currentTransition.name = options.name),
(currentTransition.startTime = -1));
try {
var returnValue = scope(),
onStartTransitionFinish = ReactSharedInternals.S;
null !== onStartTransitionFinish &&
onStartTransitionFinish(transition, returnValue);
onStartTransitionFinish(currentTransition, returnValue);
"object" === typeof returnValue &&
null !== returnValue &&
"function" === typeof returnValue.then &&
Expand Down Expand Up @@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-4549be0f-20240917";
exports.version = "19.0.0-www-modern-15da9174-20240917";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17026,11 +17026,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-classic-4549be0f-20240917",
version: "19.0.0-www-classic-15da9174-20240917",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-4549be0f-20240917"
reconcilerVersion: "19.0.0-www-classic-15da9174-20240917"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -17064,7 +17064,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-classic-4549be0f-20240917";
exports.version = "19.0.0-www-classic-15da9174-20240917";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -16472,11 +16472,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-modern-4549be0f-20240917",
version: "19.0.0-www-modern-15da9174-20240917",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-www-modern-4549be0f-20240917"
reconcilerVersion: "19.0.0-www-modern-15da9174-20240917"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16510,7 +16510,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-modern-4549be0f-20240917";
exports.version = "19.0.0-www-modern-15da9174-20240917";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -10853,13 +10853,13 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1439 = {
bundleType: 0,
version: "19.0.0-www-classic-4549be0f-20240917",
version: "19.0.0-www-classic-15da9174-20240917",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: function () {
return null;
},
reconcilerVersion: "19.0.0-www-classic-4549be0f-20240917"
reconcilerVersion: "19.0.0-www-classic-15da9174-20240917"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1440 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10885,4 +10885,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-classic-4549be0f-20240917";
exports.version = "19.0.0-www-classic-15da9174-20240917";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -10367,13 +10367,13 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1431 = {
bundleType: 0,
version: "19.0.0-www-modern-4549be0f-20240917",
version: "19.0.0-www-modern-15da9174-20240917",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: function () {
return null;
},
reconcilerVersion: "19.0.0-www-modern-4549be0f-20240917"
reconcilerVersion: "19.0.0-www-modern-15da9174-20240917"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1432 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10399,4 +10399,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-modern-4549be0f-20240917";
exports.version = "19.0.0-www-modern-15da9174-20240917";
28 changes: 14 additions & 14 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -18576,41 +18576,41 @@ __DEV__ &&
: !1;
}
function getActiveElementDeep(containerInfo) {
var $jscomp$optchain$tmp1796948182$1, $jscomp$nullish$tmp0;
var $jscomp$optchain$tmpm591242023$1, $jscomp$nullish$tmp0;
containerInfo =
null !=
($jscomp$nullish$tmp0 =
null == containerInfo
? void 0
: null ==
($jscomp$optchain$tmp1796948182$1 = containerInfo.ownerDocument)
($jscomp$optchain$tmpm591242023$1 = containerInfo.ownerDocument)
? void 0
: $jscomp$optchain$tmp1796948182$1.defaultView)
: $jscomp$optchain$tmpm591242023$1.defaultView)
? $jscomp$nullish$tmp0
: window;
for (
$jscomp$optchain$tmp1796948182$1 = getActiveElement(
$jscomp$optchain$tmpm591242023$1 = getActiveElement(
containerInfo.document
);
$jscomp$optchain$tmp1796948182$1 instanceof
$jscomp$optchain$tmpm591242023$1 instanceof
containerInfo.HTMLIFrameElement;

) {
try {
var JSCompiler_inline_result =
"string" ===
typeof $jscomp$optchain$tmp1796948182$1.contentWindow.location.href;
typeof $jscomp$optchain$tmpm591242023$1.contentWindow.location.href;
} catch (err) {
JSCompiler_inline_result = !1;
}
if (JSCompiler_inline_result)
containerInfo = $jscomp$optchain$tmp1796948182$1.contentWindow;
containerInfo = $jscomp$optchain$tmpm591242023$1.contentWindow;
else break;
$jscomp$optchain$tmp1796948182$1 = getActiveElement(
$jscomp$optchain$tmpm591242023$1 = getActiveElement(
containerInfo.document
);
}
return $jscomp$optchain$tmp1796948182$1;
return $jscomp$optchain$tmpm591242023$1;
}
function hasSelectionCapabilities(elem) {
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
Expand Down Expand Up @@ -27774,11 +27774,11 @@ __DEV__ &&
: flushSyncErrorInBuildsThatSupportLegacyMode;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-www-classic-4549be0f-20240917" !== isomorphicReactPackageVersion)
if ("19.0.0-www-classic-15da9174-20240917" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-www-classic-4549be0f-20240917\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-www-classic-15da9174-20240917\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -27822,11 +27822,11 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-classic-4549be0f-20240917",
version: "19.0.0-www-classic-15da9174-20240917",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-4549be0f-20240917"
reconcilerVersion: "19.0.0-www-classic-15da9174-20240917"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -28479,7 +28479,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-4549be0f-20240917";
exports.version = "19.0.0-www-classic-15da9174-20240917";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit 2acc36c

Please sign in to comment.