-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix: material not working with ES2015 #13709
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
Fixes that Angular Material cannot be used with ES2015. See angular#12760 for detailed information. We already had a workaround applied, but this improves the workaround because it only partially worked for classes where no attributes were defined. Fixes angular#13695.
06c06dd
to
bf6c06f
Compare
@@ -40,9 +40,6 @@ import {matExpansionAnimations} from './expansion-animations'; | |||
import {MatExpansionPanelContent} from './expansion-panel-content'; | |||
import {MAT_ACCORDION, MatAccordionBase} from './accordion-base'; | |||
|
|||
// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760 | |||
export const _CdkAccordionItem = CdkAccordionItem; |
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.
does this one need the ctorParameters
forwarding?
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.
It no longer needs the workaround because there is an explicit constructor for the MatExpansionPanel
class now.
@devversion are you sure this works? I'm getting the same error with material and cdk 7.0.1 |
@epelc Pretty confident. I've confirmed it locally when submitting the PR. Also this fix isn't part of v7.0.1. Can you please check with |
@devversion Is there a way to install master easily with npm? |
@epelc Yeah you could do |
@devversion Thanks I'll try it out. I think your fix didn't make it into 7.0.1 looking at the git history now |
@epelc Awesome. Thanks! and yeah, exactly. The fix is not part of |
@devversion Yeah my bad I realized cmd+f some old similar fix in the change log once 7.0.1 came out. I'm not sure if this is just me but I got a different error about ctor parameters when testing with master. Looks like it's trying to call NOTE this line works a bunch but at some point it gets passed an anonymous function which obvisouly doesn't have a map method since it's not an array(I just set a breakpoint for I looked into it a bit and I think it might be something to do with maybe these anon functions not being called or something? I don't have it setup to test and I know little about this ctor/compilation bugs inner workings so might be easier you to checkout?
|
Thanks for checking that out. I'm not sure what's different in your scenario, but I can see why this "could" fail. I will push some safety changes to a PR tomorrow. Thanks again. |
Also while you're at it, where is the code you shared in the second screenshot located? Are those constants defined within a class? |
It was if you click the Here is a larger screenshot that may help Also my testing repo with exactly what I'm using(standard cli project + basic table + target=es2015) https://github.com/epelc/bad-material-table Let me know if you need any other info to help or if I can do anything. |
I see, these are the reflection capabilities from Angular core. This definitely helps. Thanks again. Also regarding just assigning the I will have a look tomorrow. Will keep you updated. At first glance, it just looks like the |
Is there a timeline for when this fix will get into a release? |
Trying to upgrade an application to 7.0.2, and got hundreds of unit tests now failing with |
Thanks for the report. Should be fixed soon. See #13834. Technically only things that previously didn't work either, should throw such an error. Are you using ES2015? Edit: Actually after thinking about it again. It can also happen now if you don't use one of the given components with ES2015 because Angular always tries to read the metadata. Previously it would have just errored if you bootstrap a given component within ES2015. |
@devversion we are blocked by two releases already. Just upgraded to 7.0.3 and this damn thing (sorry) keeps failing with |
If you downgrade the target version in the tsconfig.json to es5 it works, which is what I did... |
@DenysVuika Sorry, but unfortunately applying workarounds led to other problems which aren't really solvable in a way that still keeps the workaround in an acceptable way. Since the whole issue is actually an Angular bug that will be fixed with angular/angular@95743e3 (so upcoming Angular cc. @jelbourn for thoughts. |
Still not working after upgrade to 7.1! |
Yeah, there are still some issues with |
What is the status of Angular Material working with ES2015? Issue angular/angular#27267 shows it was fixed by angular/angular#29232. That last one was closed fixed almost 2 months ago. This has become a blocker as if you need to use a feature that requires es2015 (ie Map and iterate features of it) you cannot because enabling this breaks Angular Material. |
I am unable to use mat-sidenav
I switched my target I thought it was safe to bump target to es2018
|
actually I upgraded to latest angular and typescript and everything works with es2018 adios es5 and babel some good feedback team is doing an awesome job... angular with ngrx on rxjs rules typescript is the real deal
|
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. |
Fixes that Angular Material cannot be used with ES2015. See #12760 for detailed information. We already had a workaround applied, but this improves the workaround because it only partially worked for classes where no attributes were defined.
Fixes #13695.