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

Function completeAll

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

Source from the content-addressed store, hash-verified

4943// transitioning to the next request stage and this transition can happen in multiple places in this
4944// implementation.
4945function completeAll(request: Request) {
4946 // During a render the shell must be complete if the entire request is finished
4947 // however during a Prerender it is possible that the shell is incomplete because
4948 // it postponed. We cannot use rootPendingTasks in the prerender case because
4949 // those hit zero even when the shell postpones. Instead we look at the completedRootSegment
4950 const shellComplete =
4951 request.trackedPostpones === null
4952 ? // Render, we assume it is completed
4953 true
4954 : // Prerender Request, we use the state of the root segment
4955 request.completedRootSegment === null ||
4956 request.completedRootSegment.status !== POSTPONED;
4957 safelyEmitEarlyPreloads(request, shellComplete);
4958
4959 // When the shell is complete it will be possible to flush. We attempt to prepre
4960 // the Preamble here in case it is ready for flushing
4961 preparePreamble(request);
4962
4963 const onAllReady = request.onAllReady;
4964 onAllReady();
4965}
4966
4967function queueCompletedSegment(
4968 boundary: SuspenseBoundary,

Callers 4

erroredTaskFunction · 0.85
abortTaskFunction · 0.85
finishedTaskFunction · 0.85
retryReplayTaskFunction · 0.85

Calls 3

safelyEmitEarlyPreloadsFunction · 0.85
preparePreambleFunction · 0.85
onAllReadyFunction · 0.50

Tested by

no test coverage detected