Skip to content

Commit

Permalink
Selective Hydration: Don't suspend if showing fallback (#27230)
Browse files Browse the repository at this point in the history
A transition that flows into a dehydrated boundary should not suspend if
the boundary is showing a fallback.

This is related to another issue where Fizz streams in the initial HTML
after a client navigation has already happened. That issue is not fixed
by this commit, but it does make it less likely. Need to think more
about the larger issue.

DiffTrain build for commit ab31a9e.
  • Loading branch information
acdlite committed Aug 25, 2023
1 parent 2931c47 commit ebd79e9
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<f4e294d7d90195ed2bc85d15207c702c>>
* @generated SignedSource<<c9230720afe9095de02a7a43b74e1202>>
*/

'use strict';
Expand Down Expand Up @@ -13244,7 +13244,11 @@ function updateDehydratedSuspenseComponent(
// a pass where we hydrate this subtree in place using the previous Context and then
// reapply the update afterwards.

renderDidSuspendDelayIfPossible();
if (isSuspenseInstancePending());
else {
renderDidSuspendDelayIfPossible();
}

return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
Expand Down Expand Up @@ -23977,7 +23981,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-canary-9d4582dff-20230824";
var ReactVersion = "18.3.0-canary-ab31a9ed2-20230824";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<433e051293b336d0e7452d6c87975a14>>
* @generated SignedSource<<9f65b8806fa6ba712eb14d0474695200>>
*/

"use strict";
Expand Down Expand Up @@ -4043,7 +4043,7 @@ function updateDehydratedSuspenseComponent(
SelectiveHydrationException)
);
}
renderDidSuspendDelayIfPossible();
shim$1() || renderDidSuspendDelayIfPossible();
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
Expand Down Expand Up @@ -8612,7 +8612,7 @@ var devToolsConfig$jscomp$inline_1029 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-9d4582dff-20230824",
version: "18.3.0-canary-ab31a9ed2-20230824",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1228 = {
Expand Down Expand Up @@ -8643,7 +8643,7 @@ var internals$jscomp$inline_1228 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-9d4582dff-20230824"
reconcilerVersion: "18.3.0-canary-ab31a9ed2-20230824"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1229 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<e6092a9eaf897724b4998006d8d964b1>>
* @generated SignedSource<<c2a983e7ee3306d98213d8b497404d5b>>
*/

"use strict";
Expand Down Expand Up @@ -4139,7 +4139,7 @@ function updateDehydratedSuspenseComponent(
SelectiveHydrationException)
);
}
renderDidSuspendDelayIfPossible();
shim$1() || renderDidSuspendDelayIfPossible();
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
Expand Down Expand Up @@ -9038,7 +9038,7 @@ var devToolsConfig$jscomp$inline_1071 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-9d4582dff-20230824",
version: "18.3.0-canary-ab31a9ed2-20230824",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1269 = {
Expand Down Expand Up @@ -9069,7 +9069,7 @@ var internals$jscomp$inline_1269 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-9d4582dff-20230824"
reconcilerVersion: "18.3.0-canary-ab31a9ed2-20230824"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1270 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-canary-9d4582dff-20230824";
var ReactVersion = "18.3.0-canary-ab31a9ed2-20230824";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,4 +616,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-9d4582dff-20230824";
exports.version = "18.3.0-canary-ab31a9ed2-20230824";
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-9d4582dff-20230824";
exports.version = "18.3.0-canary-ab31a9ed2-20230824";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9d4582dffdea5b4dcb6a6093ea848d15423c7701
ab31a9ed28d340172440e4b12e27d2af689249b3
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<75239e23e920b7033825cf9cc46cee37>>
* @generated SignedSource<<3990a27a9bba3b16e17ee7a62c802047>>
*/

'use strict';
Expand Down Expand Up @@ -17075,7 +17075,11 @@ function updateDehydratedSuspenseComponent(
// a pass where we hydrate this subtree in place using the previous Context and then
// reapply the update afterwards.

renderDidSuspendDelayIfPossible();
if (isSuspenseInstancePending());
else {
renderDidSuspendDelayIfPossible();
}

return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
Expand Down Expand Up @@ -27016,7 +27020,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-canary-64e46017";
var ReactVersion = "18.3.0-canary-bfef8712";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<a07e5e05f488236a06128ef01e09c2f5>>
* @generated SignedSource<<57b11b8687e4491a79b88fae7c8140e2>>
*/

"use strict";
Expand Down Expand Up @@ -5441,7 +5441,7 @@ function updateDehydratedSuspenseComponent(
SelectiveHydrationException)
);
}
renderDidSuspendDelayIfPossible();
shim$1() || renderDidSuspendDelayIfPossible();
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
Expand Down Expand Up @@ -9418,7 +9418,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1040 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-canary-9812ca1f",
version: "18.3.0-canary-f78875b3",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -9461,7 +9461,7 @@ var internals$jscomp$inline_1282 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-9812ca1f"
reconcilerVersion: "18.3.0-canary-f78875b3"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1283 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d24f6fd9c468c7ff219382320fbd627a>>
* @generated SignedSource<<dca223953e9d6eb5745857546761d038>>
*/


Expand Down Expand Up @@ -5663,7 +5663,7 @@ function updateDehydratedSuspenseComponent(
SelectiveHydrationException)
);
}
renderDidSuspendDelayIfPossible();
shim$1() || renderDidSuspendDelayIfPossible();
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
Expand Down Expand Up @@ -10126,7 +10126,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1118 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-canary-67d29d89",
version: "18.3.0-canary-6d6bb26c",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -10182,7 +10182,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-67d29d89"
reconcilerVersion: "18.3.0-canary-6d6bb26c"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<c5864c0cab35ace8ea22b15a3fd75fde>>
* @generated SignedSource<<7dde82ff69547d91479b5d4c0c3b700e>>
*/

'use strict';
Expand Down Expand Up @@ -17392,7 +17392,11 @@ function updateDehydratedSuspenseComponent(
// a pass where we hydrate this subtree in place using the previous Context and then
// reapply the update afterwards.

renderDidSuspendDelayIfPossible();
if (isSuspenseInstancePending());
else {
renderDidSuspendDelayIfPossible();
}

return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
Expand Down Expand Up @@ -27530,7 +27534,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-canary-2a0c5fa6";
var ReactVersion = "18.3.0-canary-ec1c61b8";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<3912084f06749c92cbe914e3b90809c6>>
* @generated SignedSource<<3eb32d45a5d095992284a75940b45092>>
*/

"use strict";
Expand Down Expand Up @@ -5521,7 +5521,7 @@ function updateDehydratedSuspenseComponent(
SelectiveHydrationException)
);
}
renderDidSuspendDelayIfPossible();
shim$1() || renderDidSuspendDelayIfPossible();
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
Expand Down Expand Up @@ -9674,7 +9674,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1095 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-canary-5a0cdf8c",
version: "18.3.0-canary-f9a56064",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -9717,7 +9717,7 @@ var internals$jscomp$inline_1351 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-5a0cdf8c"
reconcilerVersion: "18.3.0-canary-f9a56064"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1352 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<652f44316e146b8f03b47dda41701ba7>>
* @generated SignedSource<<1cd52fb2be7e69a2822be5746e7c81b6>>
*/


Expand Down Expand Up @@ -5743,7 +5743,7 @@ function updateDehydratedSuspenseComponent(
SelectiveHydrationException)
);
}
renderDidSuspendDelayIfPossible();
shim$1() || renderDidSuspendDelayIfPossible();
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
Expand Down Expand Up @@ -10382,7 +10382,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1173 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-canary-c231d0c6",
version: "18.3.0-canary-760ebd60",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -10438,7 +10438,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-c231d0c6"
reconcilerVersion: "18.3.0-canary-760ebd60"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
computeComponentStackForErrorReporting: function (reactTag) {
Expand Down

0 comments on commit ebd79e9

Please sign in to comment.