-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] Initializer/Instance Initializer Deprecations. #3666
Conversation
As of 2.1.0 the ApplicationInstance instance that we receive in an instance initializer has a `lookup` method on it directly. This is new public API that replaces `appInstance.container.lookup` as of 2.1.0.
As of Ember 2.1.0 initializers should receive a single argument (the application), and that object has most of the public API of the previous first argument (`register`, `optionsForType`, etc). To support older initializers, any initializer written that expects 2 arguments receives a deprecation. This fixes the argument arity to prevent deprecations.
a0fdeea
to
4e7fb74
Compare
Rebased, should pass Travis for all three branches now. |
@@ -22,7 +31,7 @@ export default function initializeStore(registry, application) { | |||
registry.register('serializer:-json-api', JSONAPISerializer); | |||
|
|||
|
|||
if (!registry.has('service:store')) { | |||
if (has(registry, 'service:store')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this change if statement lost the !
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, shoot.
In the new initializer system intection has been renamed to inject and optionsForType has been renamed to registerOptionsForType.
[BUGFIX beta] Don't use old method names with the new injection system.
@bmac - Thanks for fixing this up for me! |
[BUGFIX beta] Initializer/Instance Initializer Deprecations.
No description provided.