Removing prototype extensions with ember-watson
If you follow Ember folks on twitter you might have noticed that a
bunch of them keep talking about something called prototype extensions
and disabling them. What’s that? without getting into much details is
what allow us to set observers or computed properties calling
.observes
or property
at the end of a function.
Recently a pull request [1] was open by Stefan Penner to encourage the use of decorator styles for declaring observers and computed properties, in means that instead of declaring our computed properties and observers like:
We’ll use the following syntax
If you are like “OMG! that Stefan guy is crazy! I have like 1000 computed properties and observers” then no worries, good tool ember-watson got you covered.
Thanks to @kamal we can update our code automatically running the following commands:
Also, if you have 1000 observers then think you have $10000 in debt (more about that later).
[1] - https://github.com/emberjs/guides/pull/110