-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Compatibility with ES6 class syntax #10341
Comments
Kind of related rwjblue/ember-cli-esnext#7 |
Won't be possible until js adds annotations. Also won't work in ie8. That being said, I am sure we all want this. |
It looks like Angular and TypeScript teams working together with @wycats to get a proper annotations specification (see http://blogs.msdn.com/b/typescript/archive/2015/03/05/angular-2-0-built-on-typescript.aspx). I hope this can be transpiled with Babel easily to get real ES6 class support. |
The annotations proposal and a proposal for declarative properties are going to be brought to TC39 at the Paris meeting on March 24. I anticipate support in Babel pretty quickly assuming all goes well. 😄 |
@wycats we will also need jshint support, for annotations, can you apply pressure? |
@stefanpenner once we have an advanced proposal, I'll try and get it done. |
👍 if we can get those tooling pieces tee'd up, we can roll this out much quicker. @wycats we need to figure out |
@stefanpenner yeah. There's an ES7 |
thanks, keep me in the loop. I'll gladly prototype something if i have the proposal. |
I'm not sure if this discussion overlaps, but the React team looks into how mixins could be expressed for ES6 classes (facebook/react#1380). It looks like this could be done solved with an annotation on a class, too...? Just to point to another use case outside of Ember. |
@donaldpipowitch awesome, good resource, will read it shortly. I believe, as the thing to the right of |
/cc me |
@thehydroimpulse for future reference you can use the Notifications button on any issue to get notifications without sending everyone a message 🙌 |
@trek Unfortunately, if you're watching a project, you're technically already subscribed to all issues, but you don't get email notifications. Commenting is unfortunately the only way around it. |
@thehydroimpulse, go here https://github.com/settings/notifications and enable email notifications for watched repos. |
Yes this is/was the largest barrier. The next largest is actually the copious amount of re-factoring, and the incompatibility between ES5 and ES6 classes (specifically the lack of desugaring for super). |
It would be great to use ES6 |
Much work has been done on this, there is a pending PR by @stefenpenner that makes the required changes (still needs a few changes/fixed IIRC). |
For classes
Without 1 + 2, 3 serves very little value in core. Although it may be provided as an add-on. |
i have updated the above checkboxes (and edited some of the words)
@fivetanley im not sure what this means, but I suspect this doesn't matter as ember 2.0 drops IE8? |
Can't wait!!! Has there been any work on this since the last update? |
Is the decorators spec stable enough to do this now? rwjblue's project is a great step in the right direction, but having classes and decorators built-in to Ember would dramatically improve developer experiences (not to mention morale :-D). |
👍 |
@rosshadden Still at Stage 1, but many improvements have been made to the spec. wycats/javascript-decorators#36 |
@rosshadden yes we agree, and this is why @wycats and myself are on tc39. To push aspects of the spec that benefit our day to day forward. In-fact the decorator spec is largely championed by @wycats |
Going foward should this "feature" issue be tracked in the emberjs/rfcs repo? |
^ agreed |
Please link us to whatever the spiritual successor of this issue ends up being once it is created, so those of us that are interested may subscribe to it. Thanks. |
@rosshadden watching the https://github.com/emberjs/rfcs repo is the best bet for you to stay up to date on how this happens. I highly doubt whoever takes the next steps would remember to update this ticket directly, even if they knew it exists (the next person to move on it might be someone we don't know today)! |
Why have we closed this before an RFC was created? Normally such action means a rejection. |
This issue tracker is for bugs only. Features go in the RFCs repository. For more details read https://github.com/emberjs/ember.js/blob/master/CONTRIBUTING.md#requesting-a-feature. |
not here |
basically, the primary barrier is:
We are working on it from TC39 side of things. |
I understand why you might have felt that way, and we probably should have been clearer: moving to standard JavaScript classes is a top-priority for us. It requires careful design and interoperability work, and as Stef said, any plausible transition will require JavaScript decorators. I am working on decorators at TC39 and hope to advance them far enough in the next meeting (in Munich) that we can start seriously starting to plan a transition. |
I unlocked the conversation, but would suggest that any further discussion to lay the groundwork for this feature should happen in an issue on the RFC repository, and should probably either present or wait for a straw-man that uses JavaScript decorators. |
Just a reminder we could very well be be doing static analysis and compiling to what decorators would compile to in Babel or TypeScript. While there are ergonomic things at steak from the consumer point of view, there are some performance benefits of doing this as well. |
@chadhietala ya, if done right we can avoid the applyMixins costs we do today. |
Is there any update on this? Thanks! |
stage 2 means ember needs to be on it.. 😄 |
It looks like ES6 classes for Ember are already supported using |
@tatyahoo babel allows classes, but Ember has |
@knownasilya So does that mean that even though the below code works, it's not functioning the same as the normal way and unsafe? import Ember from 'ember';
const {
Component
} = Ember;
export default class extends Component {
} |
This would be a great feature and usable by people using 6to5 in ember-cli. What kind of work would need to go in to make this possible?
_super
andsuper
loose mode proto for IE8 (for now)we don't support IE8 in 2.0i suspect
constructor
will be the new form, with the new behaviour i would prefer, andinit
will fire after?...The text was updated successfully, but these errors were encountered: