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

Silence Deprecation Warning When Registering as Service #17

Merged
merged 1 commit into from
Jul 24, 2015

Conversation

jherdman
Copy link
Contributor

Ember 1.13+ isn't thrilled that the resize service is being registered
as a service factory, but isn't extending from Ember.Service, or being
indicated as such.

This change resolves this deprecation. I opted not to extend
Ember.Service as that'd break users of this addon that are stuck on
Ember pre 1.10.

@walter
Copy link

walter commented Jul 23, 2015

Given that this solution fails for ember beta and ember canary, I wonder it makes more sense to make it a Service. Users that are stuck at pre-1.10 can freeze which version of the ember-resize addon they are using. They are certainly going to have to do that for a lot of addons already.

@mike-north
Copy link
Owner

I think this PR is failing because of how the view registry changed in 2.0. I can apply a fix to master and re-trigger this PR

@jasonmit
Copy link

Conditionally extend from Ember.Service if it's available. That should remove the warnings while still supporting older versions of Ember.

const Base = Ember.Service || Ember.Object;
export default Base.extend(Ember.Evented, { ... });

Ember 1.13+ isn't thrilled that the resize service is being registered
as a service factory, but isn't extending from `Ember.Service`, or being
indicated as such.

This change resolves this deprecation by conditionally extending from
`Ember.Service` when it’s available.
@jherdman
Copy link
Contributor Author

@jasonmit's solution seemed reasonable to me, I've updated the pull request accordingly.

@mike-north mike-north merged commit be86a99 into mike-north:master Jul 24, 2015
@jherdman jherdman deleted the mark-service-as-such branch July 24, 2015 14:04
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.

None yet

4 participants