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(ngcc): handle imports in dts files when processing UMD #34356

Conversation

@petebacondarwin
Copy link
Member

petebacondarwin commented Dec 11, 2019

When statically evalulating UMD code it is possible to find
that we are looking for the declaration of an identifier that
actually came from a typings file (rather than a UMD file).

Previously, the UMD reflection host would always try to use
a UMD specific algorithm for finding identifier declarations,
but when the id is actually in a typings file this resulted in the
returned declaration being the containing file of the declaration
rather than the declaration itself.

Now the UMD reflection host will check to see if the file containing
the identifier is a typings file and use the appropriate stategy.

@petebacondarwin petebacondarwin requested a review from angular/fw-ngcc as a code owner Dec 11, 2019
@ngbot ngbot bot modified the milestone: needsTriage Dec 11, 2019
@googlebot googlebot added the cla: yes label Dec 11, 2019
@petebacondarwin petebacondarwin force-pushed the petebacondarwin:ngcc-umd-get-declaration-of-id branch from c115983 to 7cc2fd1 Dec 11, 2019
Copy link
Member

gkalpak left a comment

👌

];
loadTestFiles(FILES);
const {program, host: compilerHost} = makeTestBundleProgram(FILES[0].name);
const host = new UmdReflectionHost(new MockLogger(), false, program, compilerHost);

This comment has been minimized.

Copy link
@gkalpak

gkalpak Dec 11, 2019

Member

BTW, this will likely not generate a conflict with #34254, but if both are merged as is will start failing tests.

This comment has been minimized.

Copy link
@petebacondarwin

petebacondarwin Dec 11, 2019

Author Member

Actually it will create a conflict.
So we are all good there.
:-)

This comment has been minimized.

Copy link
@petebacondarwin

petebacondarwin Dec 11, 2019

Author Member

No you are correct - it is not conflicted and it will break.

This comment has been minimized.

Copy link
@petebacondarwin

petebacondarwin Dec 11, 2019

Author Member

I am going to rebase that one on top of this, since this is ready to be merged.

When statically evalulating UMD code it is possible to find
that we are looking for the declaration of an identifier that
actually came from a typings file (rather than a UMD file).

Previously, the UMD reflection host would always try to use
a UMD specific algorithm for finding identifier declarations,
but when the id is actually in a typings file this resulted in the
returned declaration being the containing file of the declaration
rather than the declaration itself.

Now the UMD reflection host will check to see if the file containing
the identifier is a typings file and use the appropriate stategy.
@petebacondarwin petebacondarwin force-pushed the petebacondarwin:ngcc-umd-get-declaration-of-id branch from 7cc2fd1 to ccbb4c5 Dec 11, 2019
@kara kara closed this in c77656e Dec 11, 2019
kara added a commit that referenced this pull request Dec 11, 2019
When statically evalulating UMD code it is possible to find
that we are looking for the declaration of an identifier that
actually came from a typings file (rather than a UMD file).

Previously, the UMD reflection host would always try to use
a UMD specific algorithm for finding identifier declarations,
but when the id is actually in a typings file this resulted in the
returned declaration being the containing file of the declaration
rather than the declaration itself.

Now the UMD reflection host will check to see if the file containing
the identifier is a typings file and use the appropriate stategy.

PR Close #34356
@petebacondarwin petebacondarwin deleted the petebacondarwin:ngcc-umd-get-declaration-of-id branch Dec 12, 2019
@angular-automatic-lock-bot

This comment has been minimized.

Copy link

angular-automatic-lock-bot bot commented Jan 12, 2020

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 Jan 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.