Closed nathanhammond closed 8 years ago
@nathanhammond I presume this has been tested on past and present versions of ember-cli? I noticed that your new approach is looking for the existence of different properties than before.
app
was previously either the addon or the host application. The host application always had an import
method. app.app
always refers to the parent in a nested addon, so we should directly use the .parent
property which was introduced in 0.2.0
I don't believe we want this. We need to mangle input names, and be sure we don't collide.
@nathanhammond spoke about it, and we have come up with a solution. Going to pair on it.
ember-browserify currently does a one-level deep check in an attempt to find the host application, making it work in addons which directly descend from the host. This is incomplete. Addons can be nested infinitely deep and we need to recurse up to the host.
This code is extracted from Ember CLI.
Except for the one line added by ember-engines since the host is not always guaranteed to be the top level application. The host may also be the closest lazily-loaded engine.
This code is identical to the check which ember-engines uses to support importing.
Closes #92 and #93.