mirror of
https://github.com/colbymchenry/codegraph.git
synced 2026-10-25 03:49:59 +08:00
Nuxt's navigateTo was in the Vue resolver's list of Nuxt auto-imports,
which answers each with a sink: an edge from the calling node to itself
at confidence 1. The Vue resolver runs before Vue Router's, so the call's
destination was never read. Every navigateTo, in pages and route
middleware alike, became a self-pointing calls edge, and no navigates
edge was drawn; the sink also kept sync from revisiting the call when a
page appeared (a navigation waits as a failed reference).
Fix:
- navigateTo leaves the auto-import list, so Vue Router reads it.
- A new optional hook, FrameworkResolver.ownsReference: a reference a
framework answers alone stops at the frameworks' answer, and no import
or name strategy guesses past it. nuxtResolver owns a bare navigateTo
that no declaration or import in the file binds. One whose destination
is computed, names no page or is an external URL stays unresolved,
rather than linked to a project function that only shares the name
(elk declares a navigateTo of its own inside a plugin). A file that
declares or imports its own navigateTo calls that one, as before.
- Vue Router's call reader keeps only destinations that start with "/",
as its markup reader does: navigateTo(url, { external: true }) leaves
the app, and the shared reader had matched an absolute URL's path.
- framework-coverage.md: the Vue Router / Nuxt row and a new trap 21.
Validation:
- nuxt-navigate-to.test.ts (6 tests) and a Nuxt case in
sync-navigation-retry.test.ts (the page appears later; sync equals a
fresh index). All 7 fail on main. Without the ownership check the
unresolved case fails (a composable's call reaches a namesake); without
the "/" rule the external URL navigates to "/".
- A/B against main 9ee6718a (and before that 628f69e2, with the same
deltas), kernel on, natural-key dumps and a site-keyed edge diff. Every
changed edge is a navigateTo call site; no node changed. Across
atidone, elk, nuxt.com, mealie and nuxt/ui, 54 navigateTo calls
(elk's plugin with its own navigateTo aside, unchanged) lost their
self-loop; 41 now navigate (42 edges, each checked against its source
line, all correct) and 13 are unresolved: 6 computed, an API endpoint
opened with external: true, 4 pages of a Nuxt layer (its own route
table), and 2 pages the matcher can't read yet (a catch-all and an
optional parameter).
- Byte-identical: nuxt/movies; vue-vben-admin and vue-element-plus-admin,
plain Vue apps that declare their own navigateTo; the controls
svelte-realworld (Svelte) and gin (Go).
- Index time unchanged within noise, medians of interleaved runs, main
then fix: nuxt.com 5.21 s and 5.24 s (5 runs), mealie 11.52 s and
11.60 s, elk 3.38 s and 3.55 s (3 runs).
Fixes #2634
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>