New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(compiler): use either summary or metadata information when reading from .d.ts
#18912
Conversation
You can preview c5a4e51 at https://pr18912-c5a4e51.ngbuilds.io/. |
.d.ts
You can preview 81b2ef5 at https://pr18912-81b2ef5.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions.
this.resolvedSymbols.forEach((resolvedSymbol) => { | ||
if (resolvedSymbol.symbol.filePath === filePath) { | ||
symbols.add(resolvedSymbol.symbol); | ||
metadataSymbols.push(resolvedSymbol.symbol); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of the set was to ensure this array has no duplicates. Is that now ensured some other way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We needed the Set
as we merged 2 list of symbols. As we are now always using either or, and we know that these lists don't contain duplicates, we are good.
} | ||
this.loadedFilePaths.add(filePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this moving to after the if
could potentially allow indirect recursion that was prevented by seeding the cache. Is this is concern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Will change that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(although this shouldn't happen...)
You can preview 9d38d7d at https://pr18912-9d38d7d.ngbuilds.io/. |
Travis is red because of a flake in AIO. |
You can preview d0218a9 at https://pr18912-d0218a9.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last two commits
throw new Error('rootDirs is not set!'); | ||
} | ||
// When we canonicalize, we want to strip the longest rootDir. | ||
rootDirs.sort((a, b) => b.length - a.length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it belongs in rules_typescript, let me move it there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually this already happens in the compiler_host.ts from rules_typescript, shouldn't need it
function relativeToRootDir(filePath: string): string { | ||
if (tsOptions.rootDir) { | ||
const rel = path.relative(tsOptions.rootDir, filePath); | ||
if (rel.indexOf('.') != 0) return rel; | ||
} | ||
return filePath; | ||
} | ||
|
||
function relativeToRootDirs(filePath: string): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's have one function that takes a parameter
roots
that defaults to [tsOptions.rootDir]
to reduce the duplication?
…g .d.ts files This fix applies for getting all symbols in file.
This is a corner case, and converting them is what was expected in G3. This also fits the fact that we already convert package paths into relative paths.
You can preview 0eddfdb at https://pr18912-0eddfdb.ngbuilds.io/. |
You can preview 3dc2c07 at https://pr18912-3dc2c07.ngbuilds.io/. |
You can preview c3740c3 at https://pr18912-c3740c3.ngbuilds.io/. |
You can preview 63ebff6 at https://pr18912-63ebff6.ngbuilds.io/. |
This is a corner case, and converting them is what was expected in G3. This also fits the fact that we already convert package paths into relative paths. PR Close #18912
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. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information