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: workaround for es2015 inheritance not always working #13834

Merged

Conversation

devversion
Copy link
Member

@devversion devversion commented Oct 26, 2018

Since the inherited ctorParameters can be either a static array or a function that returns an array, the workaround that landed with e9103a6 does not fully solve the issue which developers experience when using Angular Material with ES2015. This improves the workaround and ensures that it handles both scenarios properly.

Also the workaround has been moved into a separate function in order to remove code duplication. This should also make it easier to delete the workaround if we need to.

See #12760 for more details about the whole issues.

Note: I've tested thoroughly and went through the reflection capabilities of @angular/core. This should finally resolve the issue completely and it's just a matter of time until the issue is fixed upstream (there are various issues filed; see referenced issues in #12760)

Thanks to @epelc for finding this.

Since the inherited `ctorParameters` can be either a static array or a function that returns an array, the workaround that landed with e9103a6 does not fully solve the issue, which developers experience when using Angular Material with ES2015. This improves the workaround and ensures that it handles both scenarios properly.

Also the workaround has been moved into a separate function in order to remove code duplication. This should also make it easier to delete the workaround if we need to.
@devversion devversion added the target: patch This PR is targeted for the next patch release label Oct 26, 2018
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 26, 2018
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Oct 26, 2018
@devversion devversion added the P2 The issue is important to a large percentage of users, with a workaround label Oct 28, 2018
@jelbourn jelbourn merged commit a22a9fa into angular:master Oct 29, 2018
jelbourn added a commit to jelbourn/components that referenced this pull request Oct 30, 2018
…gular#13834)"

This reverts commit a22a9fa.

This change caused a new issue where Closure Compiler was not able to do
dead-code elimination due to the function call with unknown side
effects.
@josephperrott josephperrott removed the request for review from mmalerba October 30, 2018 15:41
jelbourn added a commit that referenced this pull request Oct 30, 2018
…3834)" (#13868)

This reverts commit a22a9fa.

This change caused a new issue where Closure Compiler was not able to do
dead-code elimination due to the function call with unknown side
effects.
atscott pushed a commit to atscott/components that referenced this pull request Nov 5, 2018
)

Since the inherited `ctorParameters` can be either a static array or a function that returns an array, the workaround that landed with e9103a6 does not fully solve the issue, which developers experience when using Angular Material with ES2015. This improves the workaround and ensures that it handles both scenarios properly.

Also the workaround has been moved into a separate function in order to remove code duplication. This should also make it easier to delete the workaround if we need to.
atscott pushed a commit to atscott/components that referenced this pull request Nov 5, 2018
…gular#13834)" (angular#13868)

This reverts commit a22a9fa.

This change caused a new issue where Closure Compiler was not able to do
dead-code elimination due to the function call with unknown side
effects.
jelbourn pushed a commit that referenced this pull request Nov 6, 2018
Since the inherited `ctorParameters` can be either a static array or a function that returns an array, the workaround that landed with e9103a6 does not fully solve the issue, which developers experience when using Angular Material with ES2015. This improves the workaround and ensures that it handles both scenarios properly.

Also the workaround has been moved into a separate function in order to remove code duplication. This should also make it easier to delete the workaround if we need to.
jelbourn added a commit that referenced this pull request Nov 6, 2018
…3834)" (#13868)

This reverts commit a22a9fa.

This change caused a new issue where Closure Compiler was not able to do
dead-code elimination due to the function call with unknown side
effects.
@epelc
Copy link
Contributor

epelc commented Dec 21, 2018

Thanks for this @devversion !!! Just got everything upgraded to the latest 7.x releases(material, angular core, and flex-layout). Sadly running es5 due to flex-layout pending upgrade but still happy to be upgraded.

Nice to see everything loading on latest versions :) I know this was a lot of work on your end.
image

@devversion
Copy link
Member Author

Hi @epelc, thanks for the feedback.

Unfortunately we had to revert the latest workaround again because it broke Google closure compiler, so Material should no longer work with ES2015 latest version.

We basically delegated the issue to angular/angular#27267

@epelc
Copy link
Contributor

epelc commented Dec 21, 2018

@devversion unfortunate but good to know! At least I'm back on es5 for now with the help of --downlevelIterator until a new fix or maybe this can all just go away with ivy soon :)

@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 Sep 10, 2019
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 cla: yes PR author has agreed to Google's Contributor License Agreement P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants