Skip to content
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

[BUGFIX beta] Deprecate Array/Reduce computed #11403

Merged

Conversation

cibernox
Copy link
Contributor

This PR pairs with #10582

@private
*/
function arrayComputed(options) {
Ember.deprecate('Ember.arrayComputed is deprecated. Replace it with plain array methods');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this into the constructor here and here?

Might need a flag to make sure that the deprecation is for ReduceComputed or ArrayComputed...

@joeruello
Copy link
Contributor

Are Ember.computed reduce/array macros being removed completely, or will they replaced with plain array method shortcuts?

@cibernox cibernox force-pushed the deprecate_arraycomputed_reduce_computed branch from f773886 to 31ea060 Compare June 11, 2015 07:56
@cibernox
Copy link
Contributor Author

@joeruello Precisely #10582 implements those macros (filter, sort) without using arrayComputed/reduceComputed

@mixonic
Copy link
Member

mixonic commented Jun 11, 2015

An alternative way to accomplish this is to simply export to global (Ember.reduceComputed) functions/classes that fire the deprecation, but keep using the old versions internally via module import.

@cibernox thoughts? It seems simpler than mucking with options.

@rwjblue
Copy link
Member

rwjblue commented Jun 11, 2015

@mixonic - We need the deprecation in both Ember.ReduceComputedProperty and Ember.reduceComputed (and the same for ArrayComputedProperty/arrayComputed). Putting the deprecation in the constructor solves both.

@@ -12,6 +12,9 @@ var a_slice = [].slice;
function ArrayComputedProperty() {
var cp = this;

var options = arguments[arguments.length - 1];
options._isArrayComputed = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can set on this instead of grabbing options here.

Something like:

this._isArrayComputed = true;

ReduceComputedProperty.apply(this, arguments);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much simpler, I'll change that

@cibernox cibernox force-pushed the deprecate_arraycomputed_reduce_computed branch from 31ea060 to 1c68d84 Compare June 11, 2015 19:46
@cibernox
Copy link
Contributor Author

Updated

@mixonic
Copy link
Member

mixonic commented Jun 11, 2015

What happened to the build here? 0_o

@rwjblue
Copy link
Member

rwjblue commented Jun 11, 2015

WAT? TRAVIS Y U NO RUN?

@rwjblue
Copy link
Member

rwjblue commented Jun 11, 2015

@cibernox - Can you git commit --amend && git push -f?

@cibernox cibernox force-pushed the deprecate_arraycomputed_reduce_computed branch from 1c68d84 to 30817b7 Compare June 11, 2015 22:16
@cibernox
Copy link
Contributor Author

Let see if travis is in a more disposed mood now

@cibernox
Copy link
Contributor Author

Seems that this time sauce is on one in a bad mood

sigh

rwjblue added a commit that referenced this pull request Jun 12, 2015
…e_computed

[BUGFIX beta] Deprecate Array/Reduce computed
@rwjblue rwjblue merged commit 285030a into emberjs:master Jun 12, 2015
@cibernox cibernox deleted the deprecate_arraycomputed_reduce_computed branch June 12, 2015 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants