GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — Use realpathSync.native on case-insensitive file systems by amcasey · Pull Request #44966 · microsoft/TypeScript Conversation
Member
...chiefly, on Windows. After re-reviewing all usages of realpath in the codebase, I believe there were three places where the input and output of realpath were being compared without specifically taking case into account. Fixing the two in module resolution as a little involved, since they didn't formerly have access to the case-sensitivity flag. Fixes #43105
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Andrew Casey (amcasey)
requested review from
Andrew Branch (andrewbranch) and
Orta Therox (orta)
|
There was an error while loading. Please reload this page.
|
If we don't like the API change, I have another version that threads a parameter through all the places that need it. I still need to do some manual testing around scenarios like this. Edit: confirmed that I regard this as fairly risky, so my vote would be to defer it until 4.5. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
TypeScript Bot (@typescript-bot) pack this |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Heya Andrew Casey (@amcasey), I've started to run the tarball bundle task on this PR at 4c4dbdd. You can monitor the build here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I marked this as a draft because I don't want it to get merged by accident, but it's ready for review. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Hey Andrew Casey (@amcasey), I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const nodeModulesAtTypes = combinePaths("node_modules", "@types"); | ||
|
|
||
| function arePathsEqual(path1: string, path2: string, host: ModuleResolutionHost): boolean { | ||
| const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames; |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Do we expect the host to change its answer over time? Seems like you can avoid calling this over and over for every set of paths, right?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I also think it's ridiculous that some hosts expose it as a function, but I'm not sure how comfortable I am with ignoring that.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I suppose assuming that it won't change over time is no more outrageous than assuming that every implementation of realpath preserves lettercase when possible.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
...so that path comparisons can use it during module resolution.
4c4dbdd to
9df6f71
Compare
There was an error while loading. Please reload this page.
|
Force push is a rebase. Only notable merge conflict was undeleting the function Andrew mentioned above. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…4966) * Make getSourceOfProjectReferenceRedirect take a Path * Add useCaseSensitiveFileNames to ModuleResolutionHost ...so that path comparisons can use it during module resolution. * Re-enable realpathSync.native for case-insensitive file systems
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
"Cannot read property 'lastIndexOf' of undefined" error in tsserver.js
There was an error while loading. Please reload this page.