Remove CacheNode.status field (#59472)
I'm about to make some changes to the CacheNode data structure, and before I add more complexity, I noticed an opportunity to remove some — the `status` field isn't logically necessary: - The `DATA_FETCH` and `LAZY_INITIALIZED` states are already treated as equivalent; in either case, they will cause the render to suspend during render, trigger a lazy data fetch (if one hasn't been triggered already), and then update the router with the result of the response. - `subTreeData` is null if and only if the node is in the `DATA_FETCH` or `LAZY_INITIALIZED` states, and it always causes the render to suspend. So rather than check if the status is one of those, we can check if `subTreeData` is null. The most important changes are to CacheNode type in app-router-context.shared-runtime and the lazy fetching logic in LayoutRouter. Everything else in the diff is related to deleting the `status` field wherever a CacheNode is referenced, like in the reducer unit tests. Closes NEXT-1842
Showing
This diff is collapsed.
Please
register
or
sign in
to comment