Skip to content

fix: workaround for es2015 inheritance not always working - #13834

Merged
jelbourn merged 1 commit into
angular:masterfrom
devversion:fix/material-ctor-params-workaround-2
Oct 29, 2018
Merged

fix: workaround for es2015 inheritance not always working#13834
jelbourn merged 1 commit into
angular:masterfrom
devversion:fix/material-ctor-params-workaround-2

Conversation

@devversion

@devversiondevversion commented Oct 26, 2018

Copy link
Copy Markdown
Member

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.
@devversiondevversion added the target: patch This PR is targeted for the next patch release label Oct 26, 2018
@googlebotgooglebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 26, 2018

@jelbournjelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@jelbournjelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Oct 26, 2018
@devversiondevversion 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:masterOct 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 mmalerbaOctober 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

epelc commented Dec 21, 2018

Copy link
Copy Markdown
Contributor

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
Copy Markdown
MemberAuthor

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
Copy Markdown
Contributor

@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
Copy Markdown

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-botangular-automatic-lock-botBot locked and limited conversation to collaborators Sep 10, 2019
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: mergeThe PR is ready for merge by the caretakercla: yesPR author has agreed to Google's Contributor License AgreementP2The issue is important to a large percentage of users, with a workaroundtarget: patchThis PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@devversion@epelc@jelbourn@googlebot@mmalerba