-
Notifications
You must be signed in to change notification settings - Fork 26.3k
fix(compiler): process imports
first and declarations
second while calculating scopes
#35850
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): process imports
first and declarations
second while calculating scopes
#35850
Conversation
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.
Hmmm. I really don't like relying on the orderedness of Set
, but this will work for now.
…e calculating scopes Prior to this commit, while calculating the scope for a module, Ivy compiler processed `declarations` field first and `imports` after that. That results in a couple issues: * for Pipes with the same `name` and present in `declarations` and in an imported module, Pipe from imported module was selected. In View Engine the logic is opposite: Pipes from `declarations` field receive higher priority. * for Directives with the same selector and present in `declarations` and in an imported module, we first invoked the logic of a Directive from `declarations` field and after that - imported Directive logic. In View Engine, it was the opposite and the logic of a Directive from the `declarations` field was invoked last. In order to align Ivy and View Engine behavior, this commit updates the logic in which we populate module scope: we first process all imports and after that handle `declarations` field. As a result, in Ivy both use-cases listed above work similar to View Engine. Resolves angular#35502.
ccd466f
to
fc6fe12
Compare
FYI, both Blueprint and Global TAP runs (with Ivy) with the changes from this PR are successful. |
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.
LGTM
…e calculating scopes (#35850) Prior to this commit, while calculating the scope for a module, Ivy compiler processed `declarations` field first and `imports` after that. That results in a couple issues: * for Pipes with the same `name` and present in `declarations` and in an imported module, Pipe from imported module was selected. In View Engine the logic is opposite: Pipes from `declarations` field receive higher priority. * for Directives with the same selector and present in `declarations` and in an imported module, we first invoked the logic of a Directive from `declarations` field and after that - imported Directive logic. In View Engine, it was the opposite and the logic of a Directive from the `declarations` field was invoked last. In order to align Ivy and View Engine behavior, this commit updates the logic in which we populate module scope: we first process all imports and after that handle `declarations` field. As a result, in Ivy both use-cases listed above work similar to View Engine. Resolves #35502. PR Close #35850
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. |
Prior to this commit, while calculating the scope for a module, Ivy compiler processed
declarations
field first andimports
after that. That results in a couple issues:name
and present indeclarations
and in an imported module, Pipe from imported module was selected. In View Engine the logic is opposite: Pipes fromdeclarations
field receive higher priority.declarations
and in an imported module, we first invoked the logic of a Directive fromdeclarations
field and after that - imported Directive logic. In View Engine, it was the opposite and the logic of a Directive from thedeclarations
field was invoked last.In order to align Ivy and View Engine behavior, this commit updates the logic in which we populate module scope: we first process all imports and after that handle
declarations
field. As a result, in Ivy both use-cases listed above work similar to View Engine.Resolves #35502.
PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?