alvarlagerlof / rsc-parser

A parser for the React Server components when sent over the network
https://rsc-parser.vercel.app
MIT License
499 stars 11 forks source link

Refactor `ViewerStreams` internals to allow a single list of tabs #1058

Closed alvarlagerlof closed 1 month ago

alvarlagerlof commented 1 month ago

The way that ViewerStreams was set up made it hard to mix components that depending on RSC_CHUNK together with those that may instead need RSC_REQUEST and RSC_RESPONSE. The FlightResponse component was sort of dictating a split between them.

It needed to change because I wanted to put "Headers" in the same row as everything else, like the parsed chunks and the network graph.

I ended up changing a few other things as well, like removing a bunch of useMemo (to make the code simpler, and because the compiler is going to help).

Before

image

After

image