next.js
90507a9e - Track search string as part of "refresh state" (#87203)

Commit
9 days ago
Track search string as part of "refresh state" (#87203) When a parallel route does not match the current URL, in its place we render the render the last active route that matched that slot. When we next refresh the page, we track some additional state to inform the router how to refresh the old, "inactive" routes that aren't reachable from the outermost, "active" route. Before this PR, the only state we tracked was the URL of the page that last matched the inactive segment. After this PR, I am also tracking the search query string of the old route. This can't be inferred from the URL alone because the URL may have been rewritten by the server. We don't need the search query to perform a network request — that is handled by the URL alone — but we do need it in order to construct a cache key for the page segments. Today we read the cache key from the FlightRouterState, which has all the params embedded inside of it, but eventually I want to remove all uses of FlightRouterState that aren't about sending/receiving data from the server or storing the tree as state in the browser's history entry. So this is an incremental step towards that goal.
Author
Parents
Loading