Skip to content

Commit

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

* silence flow
  • Loading branch information
salazarm authored and zhengjitf committed Apr 15, 2022
1 parent c1f70e7 commit 28f90a3
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 28f90a3

Please sign in to comment.