-
Notifications
You must be signed in to change notification settings - Fork 26.6k
fix(core): delegate ctor regex updated to work on minified code #36962
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
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
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.
Drive-by review.
I worder if we have any tests for this code 🤔
done! |
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.
Thx, @esugoi 👍
LGTM, but an @angular/core
code owner should approve as well.
BTW, you will need to rebase the PR on master (to fix the CI failure) and resolve the CLA issue before this can be merged (see #36962 (comment)). |
@gkalpak Sorry, I am not very familiar with the pull request flow. I am trying to understand why the CLA check failed, tried setting the same e-mail to the git commit. |
Hm...have you followed the instructions in #36962 (comment) to verify that the e-mails match? Other than that, CLA is a black box to me 😁 Maybe @kara can shed some light on what's going on, if everything seems to be set up correctly. |
Yes, I understand. How do I check which e-mail das used in the commit? There was a noreply e-mail from Github that was configured for commiting. |
https://patch-diff.githubusercontent.com/raw/angular/angular/pull/36962.patch |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
Thanks, I think @gkalpak need to consent now. |
@googlebot I consent. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Thanks @gkalpak |
Try rebasing on master. It should fix the error. |
That means that your branch is up-to-date with your local master. But is your local master up-to-date with upstream master? Try |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
I tried to update the comment of one of the commits to resolve the CircleCI failure, but I did something wrong now. :( |
…d code If one component Parent inherit another component Base like the following: @component(...) class Base { constructor(@Inject(InjectionToken) injector: Injector) { } } @component(...) class Parent extends Base { // no constructor } When creating Component Parent, the dependency injection should work on delegating ctors like above. The code Parent code above will be compiled into something like: class Parent extends Base { constructor() { super(...arguments); } } The angular core isDelegateCtor function will identify the delegation ctor to the base class. But when the code above is minified (using terser), the minified code will compress the spaces, resulting in something like: class Parent extends Base{constructor(){super(...arguments)}} The regex will stop working, since it wasn't aware of this case. So this fix will allow this to work in minified code cases.
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
No worries. I rebased and squashed the commits into one (as they should be) for you. |
Thanks! |
…d code (#36962) If one component Parent inherit another component Base like the following: @component(...) class Base { constructor(@Inject(InjectionToken) injector: Injector) { } } @component(...) class Parent extends Base { // no constructor } When creating Component Parent, the dependency injection should work on delegating ctors like above. The code Parent code above will be compiled into something like: class Parent extends Base { constructor() { super(...arguments); } } The angular core isDelegateCtor function will identify the delegation ctor to the base class. But when the code above is minified (using terser), the minified code will compress the spaces, resulting in something like: class Parent extends Base{constructor(){super(...arguments)}} The regex will stop working, since it wasn't aware of this case. So this fix will allow this to work in minified code cases. PR Close #36962
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. |
…d code (angular#36962) If one component Parent inherit another component Base like the following: @component(...) class Base { constructor(@Inject(InjectionToken) injector: Injector) { } } @component(...) class Parent extends Base { // no constructor } When creating Component Parent, the dependency injection should work on delegating ctors like above. The code Parent code above will be compiled into something like: class Parent extends Base { constructor() { super(...arguments); } } The angular core isDelegateCtor function will identify the delegation ctor to the base class. But when the code above is minified (using terser), the minified code will compress the spaces, resulting in something like: class Parent extends Base{constructor(){super(...arguments)}} The regex will stop working, since it wasn't aware of this case. So this fix will allow this to work in minified code cases. PR Close angular#36962
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?
If one component Parent inherit another component Base like the following:
When creating Component Parent, the dependency injection should work on delegating ctors like above.
The Parent code above will be compiled into something like:
The angular core isDelegateCtor function will identify the delegation ctor to the base class.
But when the code above is minified (using Terser), the minified code will compress the spaces, resulting in something like:
class Parent extends Base{constructor(){super(...arguments)}}
The regex will stop working, since it wasn't aware of this case. So this fix will allow this to work in minified code cases.
What is the new behavior?
The new behavior will identify delegating ctors on minified code as well, as written above.
Does this PR introduce a breaking change?