next.js
405f11df - Decode navigations in the caller

Commit
3 days ago
Decode navigations in the caller createFetch decoded navigation responses itself, through Flight's createFromFetch, so React DevTools could time the request from the moment it was sent. Prefetches passed a flag to opt out, and HMR refreshes that can be superseded went through a separate wrapper stream instead. Now createFetch only fetches, and fetchServerResponse starts the decode itself, before the response arrives, through a stream that reads the response body once it does. That keeps the DevTools timing without handing Flight a Response. The HMR wrapper is now a condition inside the one decode, still gated to the dev server. A replayed redirect no longer restarts the decode; it reads only the final response's body.
Author
Committer
Parents
Loading