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] Initializer/Instance Initializer Deprecations. #3666

Merged
merged 4 commits into from
Aug 20, 2015

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Aug 17, 2015

No description provided.

@rwjblue
Copy link
Member Author

rwjblue commented Aug 17, 2015

Should pass properly once #3665 lands and this is rebased (we need the fix from b6498c4 for these tests).

@bmac
Copy link
Member

bmac commented Aug 17, 2015

I've merged #3665. Do you mind rebasing this when you get a chance @rwjblue.

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.
@rwjblue rwjblue force-pushed the fix-initializer-deprecations branch from a0fdeea to 4e7fb74 Compare August 18, 2015 01:42
@rwjblue
Copy link
Member Author

rwjblue commented Aug 18, 2015

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')) {
Copy link
Member

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 !.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, shoot.

bmac and others added 2 commits August 20, 2015 09:30
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.
@rwjblue
Copy link
Member Author

rwjblue commented Aug 20, 2015

@bmac - Thanks for fixing this up for me!

bmac added a commit that referenced this pull request Aug 20, 2015
[BUGFIX beta] Initializer/Instance Initializer Deprecations.
@bmac bmac merged commit 1ed437a into emberjs:master Aug 20, 2015
@rwjblue rwjblue deleted the fix-initializer-deprecations branch May 1, 2019 20:29
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

2 participants