Repository navigation
refactor(router): isolate navigation resolution and root publication - #766
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Navigation target resolution and root publication now live in separate private modules.
navigation-request.tsowns the single request ID/controller pair;navigation-targets.tsretains redirect, unmatched, push/replace and popstate policy. Public navigation signatures and existing commit/rollback behavior remain unchanged.Five original-source failures are fixed: abort reentry could borrow a newer request ID, overwrite its controller or lose cancellation ownership; push navigation overwrote the listener's destination, and popstate started the newest loader twice. Starting/tearing down a request now installs or clears ownership before invoking predecessor abort listeners. Entry points stop superseded work immediately after request creation.
Seventeen of nineteen original coordinator function bodies are unchanged. Direct seam tests resolve loaded/denied roots without publication, then apply the complete target set; late metadata cannot change nodes, title, URL or history after a newer commit. Two architecture tests enforce resolution/commit direction, and the existing single-controller guard now identifies its new owner.
Validation on Node 24.21.0:
npm run checkpasses 452 unit, 98 repository, 2,699 jsdom, 158 browser and 12 installed type cases, plus lint/types/build/publint/package artifacts. The strengthened exact-once loader assertion is additionally verified against original and final source; final formatting, lint/types and focused router checks pass.The full run exposed a pre-existing warning-count fixture that included timing warnings. A deterministic 10 ms clock reproduces five warnings instead of the expected one. The fixture now restores/disables slow-render diagnostics around its item-shadow assertions, matching the existing URL-warning fixture; the forced-clock reproducer and full suite pass. Runtime timing diagnostics are unchanged.
Ownership, the router architecture guide, changelog and 0.5.0 delivery evidence are updated. Versions remain unchanged.
Closes #742.