Allow CacheNode.loading to be a promise (#72872)
In the Segment Cache implementation of prefetching, during a navigation, it's possible that the prefetch for a segment may already be in-progress, but we haven't received its data yet. In that case, since the prefetch is very likely to load faster than the dynamic request, we might as well use the result, if we can. This updates type CacheNode.loading to accept a promise for the loading module data, and updates the LayoutRouter to conditionally unwrap it if needed. We already use this same strategy in other places, like for streaming in the main segment data.
Showing
Please
register
or
sign in
to comment