build: prepare for TypeScript 3.9 - #36855
alan-agius4 wants to merge 7 commits into
Conversation
alan-agius4
commented
Apr 29, 2020
- Fix several compilation errors
- Update @microsoft/api-extractor to be compatible with TypeScript 3.9
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
There was a problem hiding this comment.
This is done, so that we don't have a breaking change. Because in TS 3.9 T extends any behaviour changed
function foo<T extends any>(arg: T) {
arg.spfjgerijghoied; // no error!
}
function foo<T extends any>(arg: T) {
arg.spfjgerijghoied;
// ~~~~~~~~~~~~~~~
// Property 'spfjgerijghoied' does not exist on type 'T'.
}
T extends any is more or less the same as T extends unknown
|
There seems to be 2 main pending failure points. NGCC
LS
|
|
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Version 7.7.12 generates aliases for objects named the same as global symbols which breaks ts-api-guardian since it doesn't support aliases. See: microsoft/rushstack#1830
- Fix several compilation errors - Update @microsoft/api-extractor to be compatible with TypeScript 3.9
The `NodeJSFileSystem.isCaseSensitive()` method was computing completely the opposite value for its result. Also the `NgtscCompilerHost.getCanonicalFileName()` method was not actually calling `useCaseSensitiveFileNames()` so it was always assuming that the filenames were case sensitive and not actually canonicalizing them. Instead just returning the original. Once these two bugs were fixed, a number of issues with the rest of the handling of case-insensitive files in compiler-cli and tests were uncovered. This commit also fixes these issues. Here are some further notes: The TS compiler canonicalizes filenames internally for lookups etc. So if we are also doing file lookups we need to use the same canonicalized forms. This is achieved by injecting the `ts.CompilerHost` where needed and calling `getCanonicalFileName()`. For example, when computing the `rootDirs` in the `LogicalFileSystem`. Some tests were checking that particular source files were being exposed by comparing the `ts.SourceFile.fileName` property with some non-canonical filename. In some cases this would fail. Instead these comparisons are achieved by directly comparing the SourceFile objects, if known, or getting the SourceFile object from a non-canonical filename from the program, by calling `program.getSourceFile(nonCanonicalFileName)`. The `MockFileSystemWindows` class was not considering lower case drive names when computing if a path is rooted (i.e. absolute). The `NodeJSFileSystem.isCaseSensitive()` method was relying upon its `exists()` method. But this itself relies upon the `isCaseSensitive()` to determine if a file exists. So there was an infinite recursion. This is solved by actually using the underlying real `fs.existsSync` to compute whether the file system is case sensitive.
|
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
|
Closing in favour of #36989 |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |