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 release] Avoid positionalParams changing attrs after create. #11934

Merged
merged 2 commits into from
Jul 31, 2015

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Jul 31, 2015

Fixes #11686.

Adds deprecation for:

import Ember from 'ember';

export default Ember.Component.extend({
  positionalParams: [ 'a', 'b' ]
});

Deprecation text is:

Calling `var Thing = Ember.Component.extend({ positionalParams: [\'a\', \'b\' ]});`
is deprecated in favor of `Thing.reopenClass({ positionalParams: [\'a\', \'b\'] });

New non-deprecated way:

import Ember from 'ember';

var Thing = Ember.Component.extend();
Thing.reopenClass({
  positionalParams: [ 'a', 'b' ]
});

positionalParams was only introduced in Ember 1.13.0 and is not heavily used, I did a GitHub code search for positionalParams and only 35 results were found.

rwjblue added 2 commits July 30, 2015 22:21
Previously, when `positionalParams` was a string value (which means to
set all params as an array at that particular prop in `attrs`) we were
iterating over the length of the destination property name instead of
the available `params`.
@rwjblue
Copy link
Member Author

rwjblue commented Jul 31, 2015

/cc @ef4 @stefanpenner

@ef4
Copy link
Contributor

ef4 commented Jul 31, 2015

Reviewed, LGTM. Thanks.

@stefanpenner
Copy link
Member

sg

@knownasilya
Copy link
Contributor

What's the point of this? Seems like it's just making it harder to use (it wasn't used because it wasn't documented before).

@mixonic
Copy link
Member

mixonic commented Aug 3, 2015

@knownasilya this is a very power-user feature, and I believe the tradeoff here is ergonomics for performance. Seems a fair swap to me.

@mixonic mixonic deleted the make-positional-params-static branch August 3, 2015 01:10
@mmun
Copy link
Member

mmun commented Aug 3, 2015

The point is that positional params are a static property of the component class. This change enforces that.

@knownasilya
Copy link
Contributor

Makes sense. The guides will have to be updated.

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.

6 participants