-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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(upgrade): upgrade Directive facade should not return different instance from constructor #27660
Conversation
You can preview 1ef6aa4 at https://pr27660-1ef6aa4.ngbuilds.io/. |
1ef6aa4
to
c096bf7
Compare
You can preview c096bf7 at https://pr27660-c096bf7.ngbuilds.io/. |
c096bf7
to
b809816
Compare
You can preview b809816 at https://pr27660-b809816.ngbuilds.io/. |
b809816
to
4a1e843
Compare
You can preview 4a1e843 at https://pr27660-4a1e843.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.
🎉
The changes here clarify that we now have a better description of the root cause of the failure.
…stance from constructor In ngUpgrade (dynamic) we create a dynamic Angular `Directive` that wraps AngularJS components that are being upgraded. The constructor of this `Directive` class returns a different instance than `this`. It is this instance that actually contains the life-cycle hook handlers. This would break in ivy, since the methods on the prototype of the original class are wired up, rather than the instance methods. This results in hooks like `ngOnInit` not being called. This commit refactors the code to extend the inner class that was being returned so that the prototype chain is correct for both ViewEngine and ivy. This change resolves a number of failing ivy tests, but also exposes other failures that were masked by this issue. The tests have been updated accordingly. (FW-812)
4a1e843
to
9cb16e0
Compare
You can preview 9cb16e0 at https://pr27660-9cb16e0.ngbuilds.io/. |
You can preview 0ba061f at https://pr27660-0ba061f.ngbuilds.io/. |
…rent instance from constructor
0ba061f
to
1f7c9bf
Compare
You can preview 1f7c9bf at https://pr27660-1f7c9bf.ngbuilds.io/. |
…stance from constructor (#27660) In ngUpgrade (dynamic) we create a dynamic Angular `Directive` that wraps AngularJS components that are being upgraded. The constructor of this `Directive` class returns a different instance than `this`. It is this instance that actually contains the life-cycle hook handlers. This would break in ivy, since the methods on the prototype of the original class are wired up, rather than the instance methods. This results in hooks like `ngOnInit` not being called. This commit refactors the code to extend the inner class that was being returned so that the prototype chain is correct for both ViewEngine and ivy. This change resolves a number of failing ivy tests, but also exposes other failures that were masked by this issue. The tests have been updated accordingly. (FW-812) PR Close #27660
The changes here clarify that we now have a better description of the root cause of the failure. PR Close angular#27660
…stance from constructor (angular#27660) In ngUpgrade (dynamic) we create a dynamic Angular `Directive` that wraps AngularJS components that are being upgraded. The constructor of this `Directive` class returns a different instance than `this`. It is this instance that actually contains the life-cycle hook handlers. This would break in ivy, since the methods on the prototype of the original class are wired up, rather than the instance methods. This results in hooks like `ngOnInit` not being called. This commit refactors the code to extend the inner class that was being returned so that the prototype chain is correct for both ViewEngine and ivy. This change resolves a number of failing ivy tests, but also exposes other failures that were masked by this issue. The tests have been updated accordingly. (FW-812) PR Close angular#27660
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. |
In ngUpgrade (dynamic) we create a dynamic Angular
Directive
that wraps AngularJS componentsthat are being upgraded. The constructor of this
Directive
class returns a different instancethan
this
. It is this instance that actually contains the life-cycle hook handlers.This would break in ivy, since the methods on the prototype of the original class are wired up,
rather than the instance methods. This results in hooks like
ngOnInit
not being called.This PR refactors the code to extend the inner class that was being returned so that the
prototype chain is correct for both ViewEngine and ivy.
This change resolves a number of failing ivy tests, but also exposes other failures that were
masked by this issue. The tests have been updated accordingly.