( boundary: SuspenseBoundary, segment: Segment, )
| 4965 | } |
| 4966 | |
| 4967 | function queueCompletedSegment( |
| 4968 | boundary: SuspenseBoundary, |
| 4969 | segment: Segment, |
| 4970 | ): void { |
| 4971 | if ( |
| 4972 | segment.chunks.length === 0 && |
| 4973 | segment.children.length === 1 && |
| 4974 | segment.children[0].boundary === null && |
| 4975 | segment.children[0].id === -1 |
| 4976 | ) { |
| 4977 | // This is an empty segment. There's nothing to write, so we can instead transfer the ID |
| 4978 | // to the child. That way any existing references point to the child. |
| 4979 | const childSegment = segment.children[0]; |
| 4980 | childSegment.id = segment.id; |
| 4981 | childSegment.parentFlushed = true; |
| 4982 | if ( |
| 4983 | childSegment.status === COMPLETED || |
| 4984 | childSegment.status === ABORTED || |
| 4985 | childSegment.status === ERRORED |
| 4986 | ) { |
| 4987 | queueCompletedSegment(boundary, childSegment); |
| 4988 | } |
| 4989 | } else { |
| 4990 | const completedSegments = boundary.completedSegments; |
| 4991 | completedSegments.push(segment); |
| 4992 | } |
| 4993 | } |
| 4994 | |
| 4995 | function finishedSegment( |
| 4996 | request: Request, |
no test coverage detected