mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[Fizz] Postponing in the shell (#27569)
When we postpone a prerender in the shell, we should just leave an empty
prelude and resume from the root. While preserving any options passed
in.
Since we haven't flushed anything we can't assume we've already emitted
html/body tags or any resources tracked in the resumable state. This
introduces a resetResumableState function to reset anything we didn't
flush.
This is a bit hacky. Ideally, we probably shouldn't have tracked it as
already happened until it flushed or something like that.
Basically, it's like restarting the prerender with the same options and
then immediately aborting. When we add the preload headers, we'd track
those as preload() being emitted after the reset and so they get readded
to the resumable state in that case.
DiffTrain build for [05fbd1aab0](https://github.com/facebook/react/commit/05fbd1aab036ecbd14469d6376024439bc931f68)
This commit is contained in:
@@ -1 +1 @@
|
||||
779d59374e8e852ce00728d895156a7574e1b456
|
||||
05fbd1aab036ecbd14469d6376024439bc931f68
|
||||
|
||||
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-0b462672";
|
||||
var ReactVersion = "18.3.0-www-modern-f0ea8864";
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
|
||||
@@ -9850,7 +9850,7 @@ var slice = Array.prototype.slice,
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-5b0eeab3",
|
||||
version: "18.3.0-www-modern-4b9b2c3c",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1302 = {
|
||||
@@ -9881,7 +9881,7 @@ var internals$jscomp$inline_1302 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-modern-5b0eeab3"
|
||||
reconcilerVersion: "18.3.0-www-modern-4b9b2c3c"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1303 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
@@ -19,7 +19,7 @@ if (__DEV__) {
|
||||
var React = require("react");
|
||||
var ReactDOM = require("react-dom");
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-3ac6c75e";
|
||||
var ReactVersion = "18.3.0-www-classic-38d7e1a0";
|
||||
|
||||
// This refers to a WWW module.
|
||||
var warningWWW = require("warning");
|
||||
@@ -2318,7 +2318,7 @@ function createResumableState(identifierPrefix, externalRuntimeConfig) {
|
||||
moduleUnknownResources: {},
|
||||
moduleScriptResources: {}
|
||||
};
|
||||
} // Constants for the insertion mode we're currently writing in. We don't encode all HTML5 insertion
|
||||
}
|
||||
// modes. We only include the variants as they matter for the sake of our purposes.
|
||||
// We don't actually provide the namespace therefore we use constants instead of the string.
|
||||
|
||||
@@ -13094,7 +13094,10 @@ function flushCompletedQueues(request, destination) {
|
||||
var completedRootSegment = request.completedRootSegment;
|
||||
|
||||
if (completedRootSegment !== null) {
|
||||
if (request.pendingRootTasks === 0) {
|
||||
if (completedRootSegment.status === POSTPONED) {
|
||||
// We postponed the root, so we write nothing.
|
||||
return;
|
||||
} else if (request.pendingRootTasks === 0) {
|
||||
if (enableFloat) {
|
||||
writePreamble(
|
||||
destination,
|
||||
|
||||
@@ -19,7 +19,7 @@ if (__DEV__) {
|
||||
var React = require("react");
|
||||
var ReactDOM = require("react-dom");
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-0b462672";
|
||||
var ReactVersion = "18.3.0-www-modern-f0ea8864";
|
||||
|
||||
// This refers to a WWW module.
|
||||
var warningWWW = require("warning");
|
||||
@@ -2318,7 +2318,7 @@ function createResumableState(identifierPrefix, externalRuntimeConfig) {
|
||||
moduleUnknownResources: {},
|
||||
moduleScriptResources: {}
|
||||
};
|
||||
} // Constants for the insertion mode we're currently writing in. We don't encode all HTML5 insertion
|
||||
}
|
||||
// modes. We only include the variants as they matter for the sake of our purposes.
|
||||
// We don't actually provide the namespace therefore we use constants instead of the string.
|
||||
|
||||
@@ -12842,7 +12842,10 @@ function flushCompletedQueues(request, destination) {
|
||||
var completedRootSegment = request.completedRootSegment;
|
||||
|
||||
if (completedRootSegment !== null) {
|
||||
if (request.pendingRootTasks === 0) {
|
||||
if (completedRootSegment.status === POSTPONED) {
|
||||
// We postponed the root, so we write nothing.
|
||||
return;
|
||||
} else if (request.pendingRootTasks === 0) {
|
||||
if (enableFloat) {
|
||||
writePreamble(
|
||||
destination,
|
||||
|
||||
@@ -4655,7 +4655,7 @@ function flushCompletedQueues(request, destination) {
|
||||
var i,
|
||||
completedRootSegment = request.completedRootSegment;
|
||||
if (null !== completedRootSegment)
|
||||
if (0 === request.pendingRootTasks) {
|
||||
if (5 !== completedRootSegment.status && 0 === request.pendingRootTasks) {
|
||||
var renderState = request.renderState;
|
||||
if (
|
||||
(0 !== request.allPendingTasks ||
|
||||
@@ -5054,4 +5054,4 @@ exports.renderToString = function (children, options) {
|
||||
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
|
||||
);
|
||||
};
|
||||
exports.version = "18.3.0-www-classic-5696169c";
|
||||
exports.version = "18.3.0-www-classic-38c26c34";
|
||||
|
||||
@@ -4590,7 +4590,7 @@ function flushCompletedQueues(request, destination) {
|
||||
var i,
|
||||
completedRootSegment = request.completedRootSegment;
|
||||
if (null !== completedRootSegment)
|
||||
if (0 === request.pendingRootTasks) {
|
||||
if (5 !== completedRootSegment.status && 0 === request.pendingRootTasks) {
|
||||
var renderState = request.renderState;
|
||||
if (
|
||||
(0 !== request.allPendingTasks ||
|
||||
@@ -4989,4 +4989,4 @@ exports.renderToString = function (children, options) {
|
||||
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
|
||||
);
|
||||
};
|
||||
exports.version = "18.3.0-www-modern-5b0eeab3";
|
||||
exports.version = "18.3.0-www-modern-4b9b2c3c";
|
||||
|
||||
@@ -2315,7 +2315,7 @@ function createResumableState(identifierPrefix, externalRuntimeConfig) {
|
||||
moduleUnknownResources: {},
|
||||
moduleScriptResources: {}
|
||||
};
|
||||
} // Constants for the insertion mode we're currently writing in. We don't encode all HTML5 insertion
|
||||
}
|
||||
// modes. We only include the variants as they matter for the sake of our purposes.
|
||||
// We don't actually provide the namespace therefore we use constants instead of the string.
|
||||
|
||||
@@ -12723,7 +12723,10 @@ function flushCompletedQueues(request, destination) {
|
||||
var completedRootSegment = request.completedRootSegment;
|
||||
|
||||
if (completedRootSegment !== null) {
|
||||
if (request.pendingRootTasks === 0) {
|
||||
if (completedRootSegment.status === POSTPONED) {
|
||||
// We postponed the root, so we write nothing.
|
||||
return;
|
||||
} else if (request.pendingRootTasks === 0) {
|
||||
if (enableFloat) {
|
||||
writePreamble(
|
||||
destination,
|
||||
|
||||
@@ -4370,7 +4370,7 @@ function flushCompletedQueues(request, destination) {
|
||||
var i,
|
||||
completedRootSegment = request.completedRootSegment;
|
||||
if (null !== completedRootSegment)
|
||||
if (0 === request.pendingRootTasks) {
|
||||
if (5 !== completedRootSegment.status && 0 === request.pendingRootTasks) {
|
||||
var renderState = request.renderState;
|
||||
if (
|
||||
(0 !== request.allPendingTasks ||
|
||||
|
||||
Reference in New Issue
Block a user