Open SaladFork opened 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.
Awesome, thanks for the heads up!
Todo:
Ember.computed
-> @computed
.get
lookups when possiblefoo.@each.bar
or foo.[]
?get
/set
functionsconvert-prototype-extensions
for .property()
->> @computed
Do we want these? In the same command or separately?
.readOnly()
-> @readOnly
DS.attr
-> @attr
'string'
), options hash ({ defaultsTo: ... }
)DS.hasMany
-> @hasMany
DS.belongsTo
-> @belongsTo
Ember.on
-> @on
convert-prototype-extensions
for .on()
->> @on
Ember.observer
-> @observes
convert-prototype-extensions
for .observes()
->> @observes
ember-computed-macros
such as @alias
Will put these in first comment to track progress once we decide what to include.
Do we want these?
yes. :+1:
The Ember 2.0 release blog post states:
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:esprima
parser that is used by default cannot handle ES7 decorators:Any direction for addressing this would be most appreciated :smile: