refactor: use a single field for the on-disk transform location#10733
Merged
Conversation
The path to a module's transformed code on disk was stored in two different fields on Vite's `TransformResult`: a typed `__vitestTmp`, written by the `experimental.fsModuleCache` store, and an untyped `_vitest_tmp` accessed via `Reflect`, written by the forks pool's tmp copies. The two never coexist on a module (the forks tmp path only runs when `fsModuleCache` produced no cache path) and every consumer treats them identically, so unify on the typed `__vitestTmp` and drop the `Reflect` access.
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
hi-ogawa
approved these changes
Jul 8, 2026
hi-ogawa
left a comment
Collaborator
There was a problem hiding this comment.
Lgtm! I almost forgot how these works, so needed deeper review but now all adds up.
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.
The path to a module's transformed code on disk is stored in two different fields on Vite's
TransformResult:__vitestTmp— a typed field, written by theexperimental.fsModuleCachestore (both on a fresh transform and when re-hydrating a cached module from disk)._vitest_tmp— an untyped property read/written viaReflect, written by the forks pool's tmp copies (themakeTmpCopiespath that avoidsprocess.send-ing large buffers).Both hold the same thing (a path to transformed code on disk) and every reader treats them identically. They also never coexist on the same module: the forks tmp path only runs when
fsModuleCacheproduced no cache path (cachePath == null), while__vitestTmpis otherwise only ever the cache path. So this collapses them onto the single typed__vitestTmpfield and drops theReflectaccess.No behaviour change.