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

Function flushCompletedBoundary

packages/react-server/src/ReactFizzServer.js:5868–5903  ·  view source on GitHub ↗
(
  request: Request,
  destination: Destination,
  boundary: SuspenseBoundary,
)

Source from the content-addressed store, hash-verified

5866}
5867
5868function flushCompletedBoundary(
5869 request: Request,
5870 destination: Destination,
5871 boundary: SuspenseBoundary,
5872): boolean {
5873 flushedByteSize = boundary.byteSize; // Start counting bytes
5874 const completedSegments = boundary.completedSegments;
5875 let i = 0;
5876 for (; i < completedSegments.length; i++) {
5877 const segment = completedSegments[i];
5878 flushPartiallyCompletedSegment(request, destination, boundary, segment);
5879 }
5880 completedSegments.length = 0;
5881
5882 const row = boundary.row;
5883 if (row !== null && isEligibleForOutlining(request, boundary)) {
5884 // Once we have written the boundary, we can unblock the row and let future
5885 // rows be written. This may schedule new completed boundaries.
5886 if (--row.pendingTasks === 0) {
5887 finishSuspenseListRow(request, row);
5888 }
5889 }
5890
5891 writeHoistablesForBoundary(
5892 destination,
5893 boundary.contentState,
5894 request.renderState,
5895 );
5896 return writeCompletedBoundaryInstruction(
5897 destination,
5898 request.resumableState,
5899 request.renderState,
5900 boundary.rootSegmentID,
5901 boundary.contentState,
5902 );
5903}
5904
5905function flushPartialBoundary(
5906 request: Request,

Callers 1

flushCompletedQueuesFunction · 0.85

Tested by

no test coverage detected