fix: normalize visited module IDs in dev graph traversal - #17935
Open
rwv wants to merge 1 commit into
Open
Conversation
🦋 Changeset detectedLatest commit: 2bf3daa The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Merging this PR will degrade performance by 14.8%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes |
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.
Changes
Fixes #17934.
crawlGraph()records unwrapped module IDs in its visited set but checks recursive imports using their original IDs. A wrapped reference to an already visited module can therefore bypass deduplication and, for a normalized cycle, recurse back into the same module indefinitely.Normalize the visited-set lookup with the existing
unwrapId()helper. Keep the yielded module and its ID unchanged. Includes anastropatch changeset.The standalone reproduction runs against published Astro 7.3.1. It deliberately models the mixed-ID module graph; it is not an application-level reproduction of a confirmed Vue regression. Ordinary Vite resolution may normalize these IDs before the crawler sees them. See the issue for the downstream patch's history and the limits of the reproduction.
Testing
astro@7.3.1and passes with the same one-line fix.pnpm build:ci— passed (27 tasks).pnpm exec turbo run build --filter=@astrojs/check...— passed (14 tasks, including the Astro package build, TypeScript build, and component diagnostics).pnpm format— passed.pnpm lint:ai— passed (one existing Biome warning in a language-server fixture).pnpm -C packages/astro exec astro-scripts test 'test/units/vite-plugin-astro-server/*.test.ts' --strip-types— 11 passed.pnpm -C packages/astro exec astro-scripts test 'test/{vite-virtual-modules,0-css,css-dynamic-import-dev,css-order,partials-css-boundary}.test.ts' --strip-types— 46 passed, 1 skipped.pnpm exec tsc --noEmit --module nodenext --moduleResolution nodenext --target es2022 --skipLibCheck --ignoreConfig packages/astro/test/units/vite-plugin-astro-server/vite.test.ts— passed.Docs
No public API or configuration changes. The patch changeset describes the internal development-server fix.