next.js
f76af5ca - Make router-act ignore App Shell prefetch requests (#94580)

Commit
41 days ago
Make router-act ignore App Shell prefetch requests (#94580) When App Shells is enabled, prefetching is split into two phases: a prefetch for the shell, and a separate phase for the per-page content. This would cause a handful of the existing prefetch-related tests to fail once App Shells is turned on. However, the fact that the shell is prefetched separately from the page content is an incidental detail of how prefetching works. The App Shell is conceptually part of the route, not part of the "prefetch". Or in other words, App Shell prefetching has more in common with incremental module loading than it does with prefetching in the traditional sense used in the context of web apps. So, this updates router-act to ignore App Shell requests for the purposes of making assertions about prefetch responses. They're still captured, fulfilled, and awaited — they just don't participate in the matching logic. Tests that specifically assert on App Shell behavior can opt back in with `createRouterAct(page, { includeAppShellRequests: true })`. This is groundwork for the next PR, which enables App Shells by default. With these requests ignored, most prefetch tests pass unchanged regardless of whether App Shells is on. <!-- NEXT_JS_LLM_PR -->
Author
Parents
Loading