shuhei / babel-plugin-angular2-annotations

A babel transformer plugin for Angular 2 annotations
80 stars 9 forks source link

Thank you! Also, method parameter decorators are stage 0, maybe try the babel folks again? #19

Closed hannahhoward closed 8 years ago

hannahhoward commented 8 years ago

Hi!

First of all, I just want to say thank you so much for this project. A lot of us want the ES goodness of decorators in Angular 2 without having to jump on the Typescript bandwagon. I was so excited to find your project!

Too bad you had to remove parameter decorators. FYI, not sure you saw but parameter decorators are now a stage 0 proposal with TC39. Maybe it's worth a Ping to the babel folks to see if they'll be willing to support parsing them now?

Hannah

shuhei commented 8 years ago

Hi Hannah,

My pleasure to hear that!

It's a good idea to implement only parsing. The stage 0 proposal seems too vague even about syntax but we can assume that it's same as the class decorator's.

Shuhei

shuhei commented 8 years ago

Commented at babel's phabricator. Let's see how it goes.

amcdnl commented 8 years ago

Looks like a thumbs up! Love to see what you come up with!

shuhei commented 8 years ago

Here's a pull request for babylon to parse parameter decorators. When it's merged, I'll restore the deleted transformer.

https://github.com/babel/babylon/pull/12

amcdnl commented 8 years ago

Looks like we are good to go @shuhei !

jonricaurte commented 8 years ago

@shuhei Looks like your PR was merged into babylon, but they have not cut a new release. I'm guessing this is why you haven't reverted this change:

https://github.com/shuhei/babel-plugin-angular2-annotations/commit/847b140eef26d85a0bbf9b693c493691e63dc199

Hopefully they cut a release soon because right now we need this to use angular 1 services in angular 2:

https://angular.io/docs/ts/latest/guide/upgrade.html#!#making-angular-1-dependencies-injectable-to-angular-2

Awesome job on the plugin though! We were already using babel in angular 1 and this makes it easier to migrate to angular 2 since we just needed to modify our gulp build to add the angular 2 transformer plugins.

amcdnl commented 8 years ago

@shuhei I echo @jonricaurte comments. Do you have any ideas when the bablyon release will be cut?

shuhei commented 8 years ago

@jonricaurte @amcdnl I'm not sure when the release will be but at least I have to add new fields decorators to babel-types and the core team probably has to make sure that the extracted babylon repo works well with the other babel modules before the release. I've been busy these days but will try to make a PR to add the new fields to babel-types this weekend.

jonricaurte commented 8 years ago

Good news is that the angular team just pushed out beta 15 which supports 1.5 components. Seems like this is now the last thing needed in order for users to migrate from angular 1 to angular 2 using babel. @shuhei I know you said you were busy and sorry for asking again, but do you have some kind of time frame when you think you will get to this? Trying to see when we should go for it and start our migration to angular 2. Thanks!

shuhei commented 8 years ago

Made a pull request for babel-types. I'm still not sure when the separate-repo babylon is going to be released though.

https://github.com/babel/babel/pull/3470

jonricaurte commented 8 years ago

Thanks @shuhei ! Will keep an eye on that related issue.

aegyed91 commented 8 years ago

https://github.com/babel/babylon/releases/tag/v6.8.0

shuhei commented 8 years ago

@tsm91 Thanks for letting me know! I'll enable the parameter decorators on this plugin!

shuhei commented 8 years ago

Thanks for waiting everyone! Now it's supported. https://github.com/shuhei/babel-plugin-angular2-annotations/commit/7221f85c11399136fa240dabcf1a152de56942ec