Skip to content

Commit

Permalink
Remove deprecated injection
Browse files Browse the repository at this point in the history
  • Loading branch information
wagenet committed Feb 21, 2023
1 parent 7e48201 commit 03cf415
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 47 deletions.
29 changes: 0 additions & 29 deletions packages/@ember/-internals/container/lib/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,35 +426,6 @@ export default class Registry {
return undefined;
}

/**
This is deprecated in favor of explicit injection of dependencies.
Reference: https://deprecations.emberjs.com/v3.x#toc_implicit-injections
```
@private
@method injection
@param {String} fullName
@param {String} property
@deprecated
*/
injection(fullName: FullName, property: string): void {
deprecate(
`As of Ember 4.0.0, owner.inject no longer injects values into resolved instances, and calling the method has been deprecated. Since this method no longer does anything, it is fully safe to remove this injection. As an alternative to this API, you can refactor to explicitly inject \`${property}\` on \`${fullName}\`, or look it up directly using the \`getOwner\` API.`,
false,
{
id: 'remove-owner-inject',
until: '5.0.0',
url: 'https://deprecations.emberjs.com/v4.x#toc_implicit-injections',
for: 'ember-source',
since: {
available: '4.0.0',
enabled: '4.0.0',
},
}
);
}

/**
@private
@method knownForType
Expand Down
18 changes: 0 additions & 18 deletions packages/@ember/object/tests/create_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,6 @@ moduleFor(
runDestroy(owner);
}

['@test implicit injections raises deprecation']() {
let owner = buildOwner();

class FooService extends Service {
bar = 'foo';
}
class FooObject extends EmberObject {}
owner.register('service:foo', FooService);
owner.register('foo:main', FooObject);

expectDeprecation(
() => owner.inject('foo:main', 'foo', 'service:foo'),
/As of Ember 4.0.0, owner.inject no longer injects values into resolved instances, and calling the method has been deprecated. Since this method no longer does anything, it is fully safe to remove this injection. As an alternative to this API, you can refactor to explicitly inject `foo` on `foo:main`, or look it up directly using the `getOwner` API./
);

runDestroy(owner);
}

['@test calls computed property setters'](assert) {
let MyClass = EmberObject.extend({
foo: computed({
Expand Down

0 comments on commit 03cf415

Please sign in to comment.