abuiles / ember-watson

An Ember.js codemod to make upgrades automatic.
https://blog.abuiles.com/ember-watson/
MIT License
306 stars 43 forks source link

Add transform for ES7 decorators #73

Open SaladFork opened 9 years ago

SaladFork commented 9 years ago

The Ember 2.0 release blog post states:

As the JavaScript decorator proposal stabilizes, and as transpilers improve their implementations, we plan to adapt computed properties and other APIs to that syntax

Additionally, thanks to rwjblue/ember-computed-decorators, we can start using ES7 decorators in Ember apps today.

I thought I'd try to get a head start and as an exercise for learning AST transforms try and implement an ember-watson command for this transformation today. I've made some progress in my fork, but am hitting a roadblock:

Error: Line 4: Unexpected token ILLEGAL

AssertionError: did not recognize object of type "ExportDefaultDeclaration"

Any direction for addressing this would be most appreciated :smile:

marcioj commented 9 years ago

These issues with decorators were fixed upstream. I think that converting the computed properties for the decorator syntax would be a create addition.

SaladFork commented 9 years ago

Awesome, thanks for the heads up!

Todo:

Do we want these? In the same command or separately?

Will put these in first comment to track progress once we decide what to include.

elbeezi commented 9 years ago

Do we want these?

yes. :+1: