a4f46bc157
### What When navigating to a page that uses a loading boundary + parallel route, an empty white screen would be displayed rather than the loading state / final state ### Why With parallel routes, the RSC data is an array of data paths, each corresponding with one of the parallel segments rendered on the page. During the navigation event, when we iterate over this data, we call `applyFlightData` with this data path & an empty cache node. `applyFlightData` checks to see if the flight data contains cache nodes ("seed data"). If it doesn't, then that means it has no work to do, and it bails out. Pre-PPR and in the case of having a `loading.js` file, `walkTreeWithFlightRouterState` doesn't return any seed data, just router state. This means that `applyFlightData` will not have any work to do on the new cache node, and leaves it untouched. Once `applyFlightData` is finished, but while still in the flight data path loop, we reassign `currentCache` to the empty cache object we created prior to `applyFlightData`. But since that cache node has remained empty, the next iteration of the loop is going to be inspecting a now empty cache, rather than the actual "current" cache. Now there's no existing cache to copy into the new cache. The app now doesn't know about any cache nodes. ### How It doesn't seem like we should be re-assigning `currentCache` to the new cache. In the context of a navigation, it seems more accurate to always assume `currentCache` is the cache _now_, since it won't actually be applied to the state until the action has finished (`mutable.cache` is currently taking care of this). Closes NEXT-2223 Fixes #61080 |
||
---|---|---|
.. | ||
app | ||
next.config.js | ||
parallel-routes-and-interception.test.ts | ||
tsconfig.json |