next.js
60a847b0 - Rewrite instant validation to use depth-based URL boundary discovery (#90905)

Commit
1 day ago
Rewrite instant validation to use depth-based URL boundary discovery (#90905) Instead of pre-planning validation tasks by walking the tree and accumulating `navigationParents`, the new implementation drives validation by URL depth. Starting from the deepest URL segment and working backwards, it builds a combined payload at each depth where the boundary between shared (already-mounted) and new (being-navigated-to) content is determined by counting URL-consuming segments. If the new subtree at that depth contains any `unstable_instant` configs, the payload is validated. If not, it moves to the next shallower depth. This approach has several advantages over the task-based model: - Route group layouts no longer create spurious navigation boundaries — they don\`t consume URL depth, so they naturally share the boundary of their parent URL segment - The `requiresInstantUI` requirement propagates correctly through the tree: a local `false` config opts the subtree out, a non-false config opts it in, and no config defers to the OR-union of children slots - Both the static-stage and runtime-retry payloads are built in a single tree walk, avoiding the separate retry pass - The `<head>` stage correctly uses Runtime when any segment in the new tree uses runtime prefetch
Author
Parents
Loading