Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

esugoi
Copy link
Contributor

@esugoi esugoi commented May 6, 2020

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?

If one component Parent inherit another component Base like the following:

@Component(...)
class Base {
  constructor(@Inject(INJECTOR) injector: Injector) { }
}

@Component(...)
class Parent extends Base {
    // no constructor
}

When creating Component Parent, the dependency injection should work on delegating ctors like above.

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

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?

  • Yes
  • No

@pullapprove pullapprove bot requested a review from kara May 6, 2020 20:32
@googlebot
Copy link

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 @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@esugoi
Copy link
Contributor Author

esugoi commented May 6, 2020

@googlebot I signed it!

Copy link
Member

@gkalpak gkalpak left a 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 🤔

@esugoi
Copy link
Contributor Author

esugoi commented May 8, 2020

Drive-by review.
I worder if we have any tests for this code 🤔

done!

Copy link
Member

@gkalpak gkalpak left a 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.

@gkalpak gkalpak added area: core Issues related to the framework runtime action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release type: bug/fix labels May 8, 2020
@ngbot ngbot bot modified the milestone: needsTriage May 8, 2020
@gkalpak
Copy link
Member

gkalpak commented May 8, 2020

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

@esugoi
Copy link
Contributor Author

esugoi commented May 8, 2020

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

@gkalpak
Copy link
Member

gkalpak commented May 10, 2020

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.

@esugoi
Copy link
Contributor Author

esugoi commented May 10, 2020

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.

@pkozlowski-opensource
Copy link
Member

How do I check which e-mail das used in the commit?

https://patch-diff.githubusercontent.com/raw/angular/angular/pull/36962.patch

@googlebot
Copy link

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 @googlebot I consent. in this pull request.

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 cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@esugoi
Copy link
Contributor Author

esugoi commented May 11, 2020

How do I check which e-mail das used in the commit?

https://patch-diff.githubusercontent.com/raw/angular/angular/pull/36962.patch

Thanks, I think @gkalpak need to consent now.

@gkalpak
Copy link
Member

gkalpak commented May 12, 2020

@googlebot I consent.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@esugoi
Copy link
Contributor Author

esugoi commented May 13, 2020

Thanks @gkalpak
I don't know why the CircleCI is failing on that specific file, since I have not changed it.

@gkalpak
Copy link
Member

gkalpak commented May 13, 2020

Try rebasing on master. It should fix the error.

@gkalpak
Copy link
Member

gkalpak commented May 13, 2020

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 git pull --rebase upstream master (on your branch).

@googlebot
Copy link

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 @googlebot I consent. in this pull request.

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 cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@esugoi
Copy link
Contributor Author

esugoi commented May 13, 2020

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 git pull --rebase upstream master (on your branch).

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

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@gkalpak
Copy link
Member

gkalpak commented May 13, 2020

No worries. I rebased and squashed the commits into one (as they should be) for you.
Let's see what CI thinks...

@gkalpak gkalpak added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 13, 2020
@esugoi
Copy link
Contributor Author

esugoi commented May 14, 2020

No worries. I rebased and squashed the commits into one (as they should be) for you.
Let's see what CI thinks...

Thanks!

@kara kara added the action: presubmit The PR is in need of a google3 presubmit label May 14, 2020
@kara
Copy link
Contributor

kara commented May 14, 2020

presubmit

@kara kara removed the action: presubmit The PR is in need of a google3 presubmit label May 14, 2020
@kara kara closed this in ea971f7 May 14, 2020
kara pushed a commit that referenced this pull request May 14, 2020
…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
@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 Jun 14, 2020
profanis pushed a commit to profanis/angular that referenced this pull request Sep 5, 2020
…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
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: patch This PR is targeted for the next patch release type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants