perf(vite): narrow test for changed files in esbuild plugin#22327
Closed
danielroe wants to merge 2 commits into
Closed
perf(vite): narrow test for changed files in esbuild plugin#22327danielroe wants to merge 2 commits into
danielroe wants to merge 2 commits into
Conversation
Contributor
Author
|
I don't think the failing test is related. |
sapphi-red
reviewed
Apr 27, 2026
| // any json file in the tsconfig cache could have been used to compile ts | ||
| if (changedFile.endsWith('.json')) { | ||
| const cache = getTSConfigResolutionCache(server.config) | ||
| if (changedFile.endsWith('/tsconfig.json')) { |
Member
There was a problem hiding this comment.
This line actually should have || cache.hasParseResult(changedFile) like the condition in v7:
vite/packages/vite/src/node/plugins/esbuild.ts
Lines 520 to 523 in cc383e0
The fix is blocked by oxc-project/oxc-resolver#1011, but after we have that, the condition should be added.
So if the performance difference isn't significant, I'll prefer to keep the code as-is.
Contributor
Author
There was a problem hiding this comment.
ahh, that makes sense!
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.
was browsing the codebase and noticed this pattern:
as
getTSConfigResolutionCachedoesn't seem to have side effects, and since #21622 the cache is only used in the second if block, I think we can slightly refactor. I've made an early return but could leave the if and simply reduce if checks by one.it's a tiny, tiny improvement but thought it was worth it 🤷