Stream promises, don’t await them
- Decision
- The page awaits only the location, then hands each dataset to the client as an un-awaited promise. Every widget unwraps its own with
use()inside its own Suspense boundary. - Why
- Awaiting everything would make the whole page as slow as its slowest request and let one failure blank the page.
- Trade-off
- More boundaries to design, and a server seed is only valid for the exact request it was made for (the place and the comparison length).
- Outcome
- A dataset that fails on the server resolves to
undefined, and only the widgets that use it fetch for themselves on the client.
