Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

tbosch
Copy link
Contributor

@tbosch tbosch commented Aug 28, 2017

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] angular.io application / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[ ] No

Other information

@tbosch tbosch changed the title Fix g3 2 WIP: Fix g3 2 Aug 28, 2017
@mary-poppins
Copy link

You can preview c5a4e51 at https://pr18912-c5a4e51.ngbuilds.io/.

@tbosch tbosch changed the title WIP: Fix g3 2 fix(compiler): use either summary or metadata information when reading from .d.ts Aug 29, 2017
@tbosch tbosch requested a review from chuckjaz August 29, 2017 18:31
@tbosch tbosch added area: core Issues related to the framework runtime target: major This PR is targeted for the next major release and removed state: WIP labels Aug 29, 2017
@mary-poppins
Copy link

You can preview 81b2ef5 at https://pr18912-81b2ef5.ngbuilds.io/.

Copy link
Contributor

@chuckjaz chuckjaz left a 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);
Copy link
Contributor

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?

Copy link
Contributor Author

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);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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...)

@mary-poppins
Copy link

You can preview 9d38d7d at https://pr18912-9d38d7d.ngbuilds.io/.

@tbosch tbosch added the action: merge The PR is ready for merge by the caretaker label Aug 29, 2017
@tbosch
Copy link
Contributor Author

tbosch commented Aug 29, 2017

Travis is red because of a flake in AIO.

@tbosch tbosch removed the action: merge The PR is ready for merge by the caretaker label Aug 30, 2017
@mary-poppins
Copy link

You can preview d0218a9 at https://pr18912-d0218a9.ngbuilds.io/.

Copy link
Contributor

@alexeagle alexeagle left a 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);
Copy link
Contributor

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?

Copy link
Contributor

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 {
Copy link
Contributor

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.
@mary-poppins
Copy link

You can preview 0eddfdb at https://pr18912-0eddfdb.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 3dc2c07 at https://pr18912-3dc2c07.ngbuilds.io/.

@mary-poppins
Copy link

You can preview c3740c3 at https://pr18912-c3740c3.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 63ebff6 at https://pr18912-63ebff6.ngbuilds.io/.

@tbosch tbosch added the action: merge The PR is ready for merge by the caretaker label Aug 31, 2017
@tbosch tbosch mentioned this pull request Aug 31, 2017
jasonaden pushed a commit that referenced this pull request Aug 31, 2017
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
jasonaden pushed a commit that referenced this pull request Aug 31, 2017
jasonaden pushed a commit that referenced this pull request Aug 31, 2017
@jasonaden jasonaden closed this in f1e526f Aug 31, 2017
@tbosch tbosch deleted the fix_g3_2 branch August 31, 2017 21:53
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime cla: yes target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants