Skip to content

Commit 5b994a7

Browse files
committed
Register Suspense retry handlers in commit phase (facebook#31667)
To avoid GC pressure and accidentally hanging onto old trees Suspense boundary retries are now implemented in the commit phase. I used the Callback flag which was previously only used to schedule callbacks for Class components. This isn't quite semantically equivalent but it's unused and seemingly compatible. DiffTrain build for [de68d2f](facebook@de68d2f)
1 parent 879551c commit 5b994a7

34 files changed

+1222
-1120
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16d2bbbd1f1617d636ea0fd271b902a12a763c27
1+
de68d2f4a2403ad1ef46a3036ddc1f9080640588
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16d2bbbd1f1617d636ea0fd271b902a12a763c27
1+
de68d2f4a2403ad1ef46a3036ddc1f9080640588

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,7 @@ __DEV__ &&
18411841
exports.useTransition = function () {
18421842
return resolveDispatcher().useTransition();
18431843
};
1844-
exports.version = "19.0.0-www-classic-16d2bbbd-20241203";
1844+
exports.version = "19.0.0-www-classic-de68d2f4-20241204";
18451845
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
18461846
"function" ===
18471847
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,7 @@ __DEV__ &&
18411841
exports.useTransition = function () {
18421842
return resolveDispatcher().useTransition();
18431843
};
1844-
exports.version = "19.0.0-www-modern-16d2bbbd-20241203";
1844+
exports.version = "19.0.0-www-modern-de68d2f4-20241204";
18451845
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
18461846
"function" ===
18471847
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,4 +634,4 @@ exports.useSyncExternalStore = function (
634634
exports.useTransition = function () {
635635
return ReactSharedInternals.H.useTransition();
636636
};
637-
exports.version = "19.0.0-www-classic-16d2bbbd-20241203";
637+
exports.version = "19.0.0-www-classic-de68d2f4-20241204";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,4 +634,4 @@ exports.useSyncExternalStore = function (
634634
exports.useTransition = function () {
635635
return ReactSharedInternals.H.useTransition();
636636
};
637-
exports.version = "19.0.0-www-modern-16d2bbbd-20241203";
637+
exports.version = "19.0.0-www-modern-de68d2f4-20241204";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ exports.useSyncExternalStore = function (
638638
exports.useTransition = function () {
639639
return ReactSharedInternals.H.useTransition();
640640
};
641-
exports.version = "19.0.0-www-classic-16d2bbbd-20241203";
641+
exports.version = "19.0.0-www-classic-de68d2f4-20241204";
642642
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
643643
"function" ===
644644
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ exports.useSyncExternalStore = function (
638638
exports.useTransition = function () {
639639
return ReactSharedInternals.H.useTransition();
640640
};
641-
exports.version = "19.0.0-www-modern-16d2bbbd-20241203";
641+
exports.version = "19.0.0-www-modern-de68d2f4-20241204";
642642
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
643643
"function" ===
644644
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7446,10 +7446,8 @@ __DEV__ &&
74467446
);
74477447
} else
74487448
isSuspenseInstancePending()
7449-
? ((workInProgress.flags |= 128),
7449+
? ((workInProgress.flags |= 192),
74507450
(workInProgress.child = current.child),
7451-
retryDehydratedSuspenseBoundary.bind(null, current),
7452-
registerSuspenseInstanceRetry(),
74537451
(workInProgress = null))
74547452
: ((workInProgress = mountSuspensePrimaryChildren(
74557453
workInProgress,
@@ -10535,6 +10533,12 @@ __DEV__ &&
1053510533
break;
1053610534
case 13:
1053710535
recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
10536+
flags & 64 &&
10537+
((finishedRoot = finishedWork.memoizedState),
10538+
null !== finishedRoot &&
10539+
null !== finishedRoot.dehydrated &&
10540+
(retryDehydratedSuspenseBoundary.bind(null, finishedWork),
10541+
registerSuspenseInstanceRetry()));
1053810542
break;
1053910543
case 22:
1054010544
prevProps =
@@ -17125,11 +17129,11 @@ __DEV__ &&
1712517129
(function () {
1712617130
var internals = {
1712717131
bundleType: 1,
17128-
version: "19.0.0-www-classic-16d2bbbd-20241203",
17132+
version: "19.0.0-www-classic-de68d2f4-20241204",
1712917133
rendererPackageName: "react-art",
1713017134
currentDispatcherRef: ReactSharedInternals,
1713117135
findFiberByHostInstance: getInstanceFromNode,
17132-
reconcilerVersion: "19.0.0-www-classic-16d2bbbd-20241203"
17136+
reconcilerVersion: "19.0.0-www-classic-de68d2f4-20241204"
1713317137
};
1713417138
internals.overrideHookState = overrideHookState;
1713517139
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -17163,7 +17167,7 @@ __DEV__ &&
1716317167
exports.Shape = Shape;
1716417168
exports.Surface = Surface;
1716517169
exports.Text = Text;
17166-
exports.version = "19.0.0-www-classic-16d2bbbd-20241203";
17170+
exports.version = "19.0.0-www-classic-de68d2f4-20241204";
1716717171
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1716817172
"function" ===
1716917173
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7263,10 +7263,8 @@ __DEV__ &&
72637263
);
72647264
} else
72657265
isSuspenseInstancePending()
7266-
? ((workInProgress.flags |= 128),
7266+
? ((workInProgress.flags |= 192),
72677267
(workInProgress.child = current.child),
7268-
retryDehydratedSuspenseBoundary.bind(null, current),
7269-
registerSuspenseInstanceRetry(),
72707268
(workInProgress = null))
72717269
: ((workInProgress = mountSuspensePrimaryChildren(
72727270
workInProgress,
@@ -10339,6 +10337,12 @@ __DEV__ &&
1033910337
break;
1034010338
case 13:
1034110339
recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
10340+
flags & 64 &&
10341+
((finishedRoot = finishedWork.memoizedState),
10342+
null !== finishedRoot &&
10343+
null !== finishedRoot.dehydrated &&
10344+
(retryDehydratedSuspenseBoundary.bind(null, finishedWork),
10345+
registerSuspenseInstanceRetry()));
1034210346
break;
1034310347
case 22:
1034410348
prevProps =
@@ -16888,11 +16892,11 @@ __DEV__ &&
1688816892
(function () {
1688916893
var internals = {
1689016894
bundleType: 1,
16891-
version: "19.0.0-www-modern-16d2bbbd-20241203",
16895+
version: "19.0.0-www-modern-de68d2f4-20241204",
1689216896
rendererPackageName: "react-art",
1689316897
currentDispatcherRef: ReactSharedInternals,
1689416898
findFiberByHostInstance: getInstanceFromNode,
16895-
reconcilerVersion: "19.0.0-www-modern-16d2bbbd-20241203"
16899+
reconcilerVersion: "19.0.0-www-modern-de68d2f4-20241204"
1689616900
};
1689716901
internals.overrideHookState = overrideHookState;
1689816902
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -16926,7 +16930,7 @@ __DEV__ &&
1692616930
exports.Shape = Shape;
1692716931
exports.Surface = Surface;
1692816932
exports.Text = Text;
16929-
exports.version = "19.0.0-www-modern-16d2bbbd-20241203";
16933+
exports.version = "19.0.0-www-modern-de68d2f4-20241204";
1693016934
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1693116935
"function" ===
1693216936
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)