{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/ember.js/issues/11874","labels_url":"https://api.github.com/repos/emberjs/ember.js/issues/11874/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/ember.js/issues/11874/comments","events_url":"https://api.github.com/repos/emberjs/ember.js/issues/11874/events","html_url":"https://github.com/emberjs/ember.js/pull/11874","id":96857660,"number":11874,"title":"[FEATURE ember-container-inject-owner]: Inject `owner` instead of `container` during `lookup`.","user":{"login":"dgeb","id":29122,"avatar_url":"https://avatars.githubusercontent.com/u/29122?v=3","gravatar_id":"","url":"https://api.github.com/users/dgeb","html_url":"https://github.com/dgeb","followers_url":"https://api.github.com/users/dgeb/followers","following_url":"https://api.github.com/users/dgeb/following{/other_user}","gists_url":"https://api.github.com/users/dgeb/gists{/gist_id}","starred_url":"https://api.github.com/users/dgeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgeb/subscriptions","organizations_url":"https://api.github.com/users/dgeb/orgs","repos_url":"https://api.github.com/users/dgeb/repos","events_url":"https://api.github.com/users/dgeb/events{/privacy}","received_events_url":"https://api.github.com/users/dgeb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":37,"created_at":"2015-07-23T16:55:19Z","updated_at":"2015-11-04T15:02:16Z","closed_at":"2015-11-04T14:09:25Z","pull_request":{"url":"https://api.github.com/repos/emberjs/ember.js/pulls/11874","html_url":"https://github.com/emberjs/ember.js/pull/11874","diff_url":"https://github.com/emberjs/ember.js/pull/11874.diff","patch_url":"https://github.com/emberjs/ember.js/pull/11874.patch"},"body":"This change represents the final brick needed to wall off the \r\n`Container` as fully private.\r\n\r\nThe Container no longer injects itself into every object that it looks\r\nup. Instead, the owner of the Container is injected as `owner` by the\r\nContainerProxy mixin.\r\n\r\nThe current net effect is that an app instance is injected into every \r\nlooked up object instead of that app instance's container. This \r\nprovides clean, public access to methods exposed by the app\r\ninstance's ContainerProxy and RegistryProxy methods. It also guarantees\r\nthat the only supported path to get to a Container or Registry is\r\nthrough a proxied method. This guarantee is important because it allows\r\nfor owner-specific logic to be placed in proxy methods.\r\n\r\nIn the future, other classes, such as Engine (coming soon), may mix in\r\nContainerProxy and thus have the potential to be \"owners\".\r\n\r\nNote 1: This work is behind the ember-registry-container-reform flag.\r\n\r\nNote 2: Totally open to alternatives to the name `owner`. I was drawn\r\nto this name because the owner of the container \"owns\" the instantiated\r\nobjects to the extent that its responsible for their cleanup.\r\n\r\nNote 3: This is still a WIP and will require changes throughout the \r\ntest suite for compatibility.\r\n\r\n---\r\n\r\n- [x] Move `owner` to `__owner__` (actually, use symbol instead).\r\n- [x] Create `getOwner` / `setOwner` functions.\r\n- [x] Add simple container tests for accessing `container` in an object looked up from the container.\r\n- [x] Confirm the `Object.defineProperty` supporting deprecated access to `this.container` is called a single time per factory (and not once for every created instance).\r\n- [x] Add a new feature flag (because `ember-container-registry-reform` is already enabled). Perhaps `ember-container-inject-owner`?"},"comment":{"url":"https://api.github.com/repos/emberjs/ember.js/issues/comments/153754630","html_url":"https://github.com/emberjs/ember.js/pull/11874#issuecomment-153754630","issue_url":"https://api.github.com/repos/emberjs/ember.js/issues/11874","id":153754630,"user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T15:02:16Z","updated_at":"2015-11-04T15:02:16Z","body":"@dgeb sounds good"}}