Vite: Remove module-graph scanner#16631
Merged
philipp-spiess merged 18 commits intomainfrom Feb 20, 2025
Merged
Conversation
… to full fs scanning" This reverts commit daacc5e.
184bf2c to
e47ec4b
Compare
c389e05 to
f37e4ad
Compare
This was referenced Feb 20, 2025
RobinMalfait
approved these changes
Feb 20, 2025
Member
RobinMalfait
left a comment
There was a problem hiding this comment.
It terrifies me how much code you were able to remove 🙈
Love all the additional integration tests!
Comment on lines
+229
to
+230
| this.buildDependencies.clear() | ||
| this.buildDependencies = new Map() |
Member
There was a problem hiding this comment.
What's the reason for both a .clear() and = new Map()? Are we using the map as a key in another map somewhere? 🤔
Contributor
Author
There was a problem hiding this comment.
Oh no this is just a leftover I think 👍
philipp-spiess
added a commit
that referenced
this pull request
Feb 20, 2025
The Nuxt preview server always starts on port 3000 even if that port is taken. With the added tests in #16631 there is now a higher chance these ports are already taken since e.g. react router prefers to start at port 3000 and so do other servers. This PR changes this so that we assign a random port inside the test instead. ## Test plan - Ensure Windows CI is green again
|
Hey @philipp-spiess - thanks for this PR! @zkMake mentioned that this may have resulted a regression in #16733 - are you able to help look into this? |
This was referenced Feb 27, 2025
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.
Alternative to #16425
Fixes #16585
Fixes #16389
Fixes #16252
Fixes #15794
Fixes #16646
Fixes #16358
This PR changes the Vite plugin to use the file-system to discover potential class names instead of relying on the module-graph. This comes after a lot of testing and various issue reports where builds that span different Vite instances were missing class names.
Because we now scan for candidates using the file-system, we can also remove a lot of the bookkeeping necessary to make production builds and development builds work as we no longer have to change the resulting stylesheet based on the
transformcallbacks of other files that might happen later.This change comes at a small performance penalty that is noticeable especially on very large projects with many files to scan. However, we offset that change by fixing an issue that I found in the current Vite integration that did a needless rebuild of the whole Tailwind root whenever any source file changed. Because of how impactful this change is, I expect many normal to medium sized projects to actually see a performance improvement after these changes. Furthermore we do plan to continue to use the module-graph to further improve the performance in dev mode.
Test plan