Consume the RSC stream twice in the Flight fixture (#28353)
We have an unresolved conflict where the Flight client wants to execute inside Fizz to emit side-effects like preloads (which can be early) into that stream. However, the FormState API requires the state to be passed at the root, so if you're getting that through the RSC payload it's a Catch 22. #27314 used a hack to mutate the form state array to fill it in later, but that doesn't actually work because it's not always an array. It's sometimes null like if there wasn't a POST. This lead to a bunch of hydration errors - which doesn't have the best error message for this case neither. It probably should error with something that specifies that it's form state. This fixes it by teeing the stream into two streams and consuming it with two Flight clients. One to read the form state and one to emit side-effects and read the root.
S
Sebastian Markbåge committed
6a44f352ecdfa93949cade1d2e74755e7d7e9aaa
Parent: ef72271
Committed by GitHub <noreply@github.com>
on 2/16/2024, 11:25:09 PM