MCPcopy
hub / github.com/facebook/react / completeShell

Function completeShell

packages/react-server/src/ReactFizzServer.js:4918–4940  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

4916// transitioning to the next request stage and this transition can happen in multiple places in this
4917// implementation.
4918function completeShell(request: Request) {
4919 if (request.trackedPostpones === null) {
4920 // We only emit early preloads on shell completion for renders. For prerenders
4921 // we wait for the entire Request to finish because we are not responding to a
4922 // live request and can wait for as much data as possible.
4923
4924 // we should only be calling completeShell when the shell is complete so we
4925 // just use a literal here
4926 const shellComplete = true;
4927 safelyEmitEarlyPreloads(request, shellComplete);
4928 }
4929 if (request.trackedPostpones === null) {
4930 // When the shell is complete it will be possible to flush. We attempt to prepre
4931 // the Preamble here in case it is ready for flushing.
4932 // We exclude prerenders because these cannot flush until after completeAll has been called
4933 preparePreamble(request);
4934 }
4935
4936 // We have completed the shell so the shell can't error anymore.
4937 request.onShellError = noop;
4938 const onShellReady = request.onShellReady;
4939 onShellReady();
4940}
4941
4942// I extracted this function out because we want to ensure we consistently emit preloads before
4943// transitioning to the next request stage and this transition can happen in multiple places in this

Callers 3

abortTaskFunction · 0.85
finishedTaskFunction · 0.85
retryReplayTaskFunction · 0.85

Calls 3

safelyEmitEarlyPreloadsFunction · 0.85
preparePreambleFunction · 0.85
onShellReadyFunction · 0.50

Tested by

no test coverage detected