Skip to content

Commit

Permalink
[Fizz] Export debug function for FB (#24024)
Browse files Browse the repository at this point in the history
* export debug function for FB

* silence flow
  • Loading branch information
salazarm committed Mar 3, 2022
1 parent 05c283c commit 5662857
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/react-server-dom-relay/src/ReactDOMServerFB.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,17 @@ function hasFinished(stream: Stream): boolean {
return stream.destination.done;
}

export {renderToStream, renderNextChunk, hasFinished, abortStream};
function debug(stream: Stream): any {
// convert to any to silence flow errors from opaque type
const request = (stream.request: any);
return {
pendingRootTasks: request.pendingRootTasks,
clientRenderedBoundaries: request.clientRenderedBoundaries.length,
completedBoundaries: request.completedBoundaries.length,
partialBoundaries: request.partialBoundaries.length,
allPendingTasks: request.allPendingTasks,
pingedTasks: request.pingedTasks.length,
};
}

export {renderToStream, renderNextChunk, hasFinished, abortStream, debug};

0 comments on commit 5662857

Please sign in to comment.