{"action":"created","issue":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4031","labels_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4031/labels{/name}","comments_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4031/comments","events_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4031/events","html_url":"https://github.com/ember-cli/ember-cli/issues/4031","id":74074251,"number":4031,"title":"The addon included() hook \"app\" argument ","user":{"login":"mmelvin0","id":762247,"avatar_url":"https://avatars.githubusercontent.com/u/762247?v=3","gravatar_id":"","url":"https://api.github.com/users/mmelvin0","html_url":"https://github.com/mmelvin0","followers_url":"https://api.github.com/users/mmelvin0/followers","following_url":"https://api.github.com/users/mmelvin0/following{/other_user}","gists_url":"https://api.github.com/users/mmelvin0/gists{/gist_id}","starred_url":"https://api.github.com/users/mmelvin0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmelvin0/subscriptions","organizations_url":"https://api.github.com/users/mmelvin0/orgs","repos_url":"https://api.github.com/users/mmelvin0/repos","events_url":"https://api.github.com/users/mmelvin0/events{/privacy}","received_events_url":"https://api.github.com/users/mmelvin0/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ember-cli/ember-cli/labels/pending-submitter-response","name":"pending-submitter-response","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-07T17:58:23Z","updated_at":"2015-05-28T21:20:05Z","closed_at":null,"body":"The `app` argument to an addon's `included()` hook is documented to be an [EmberApp](https://github.com/ember-cli/ember-cli/blob/7bed74beebb82524f1b1292b29cb18a0b4f1eddb/lib/models/addon.js#L338) instance, but it can actually be one of three types of object, depending on usage:\r\n\r\n1. `EmberApp` - if addon is built as a direct dependency of an app. \r\n2. `EmberAddon` - if addon project itself is being built.\r\n3. `Addon` - if addon is a dependency of another addon.\r\n\r\nThis behavior makes sense to me as `this` is the addon itself, and `app` is really the parent of the addon, not the app persay.\r\n\r\nMy questions are:\r\n\r\n1. Is this this a correct interpretation? If no, what am I missing? If yes, the Ember-CLI documentation does not make this clear.\r\n2. The ember-cli web site seems to indicate there is a second argument (`parentAddon`) to the `included()` hook, from what I can tell, that never appears to be the case anymore?\r\n2. Is the following an appropriate way to access the \"top-level\" EmberApp or EmberAddon from within `included()` or is there a better approach? (Ignoring that I already suspect my reason for wanting to access that object may be dubious...)\r\n\r\n```javascript\r\n// this doesn't work, see my comment below\r\nwhile (app.parent) {\r\n  app = app.parent;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/comments/106603603","html_url":"https://github.com/ember-cli/ember-cli/issues/4031#issuecomment-106603603","issue_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4031","id":106603603,"user":{"login":"mmelvin0","id":762247,"avatar_url":"https://avatars.githubusercontent.com/u/762247?v=3","gravatar_id":"","url":"https://api.github.com/users/mmelvin0","html_url":"https://github.com/mmelvin0","followers_url":"https://api.github.com/users/mmelvin0/followers","following_url":"https://api.github.com/users/mmelvin0/following{/other_user}","gists_url":"https://api.github.com/users/mmelvin0/gists{/gist_id}","starred_url":"https://api.github.com/users/mmelvin0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmelvin0/subscriptions","organizations_url":"https://api.github.com/users/mmelvin0/orgs","repos_url":"https://api.github.com/users/mmelvin0/repos","events_url":"https://api.github.com/users/mmelvin0/events{/privacy}","received_events_url":"https://api.github.com/users/mmelvin0/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T21:20:05Z","updated_at":"2015-05-28T21:20:05Z","body":"The only reason I'm interested in accessing `app` on second-and-deeper-level addons is to be able to get at options from the app's top-level `Brocfile.js`.\r\n\r\nI take it from your reply that simply isn't something that should be done, which seems reasonable to me now, but should be more clearly documented."}}