Skip to content

Classic host app has to use MU resolver to allow local lookups in MU addons #298

Closed

Description

@buschtoens

If you want to use an MU addon with local lookup components in a classic host app, the host app has to use the MU resolver. Otherwise there's no expandLocalLookup.

expandLocalLookup(specifier, source, namespace) {
if (isAbsoluteSpecifier(specifier)) {
return specifier; // specifier is absolute
}
if (source || namespace) {
let rootName = namespace || this._configRootName;
let [type] = specifier.split(':');
/*
* Ember components require their lookupString to be massaged. Make this
* as "pay-go" as possible.
*/
if (namespace) {
// This is only required because:
// https://github.com/glimmerjs/glimmer-di/issues/45
source = `${type}:/${rootName}/`;
} else if (source) {
// make absolute
let parts = source.split(':src/ui/');
source = `${parts[0]}:/${rootName}/${parts[1]}`;
source = source.split('/template.hbs')[0];
}
let [_specifier, _source] = cleanupEmberSpecifier(specifier, source, rootName);
let absoluteSpecifier = this._glimmerResolver.identify(_specifier, _source);
if (absoluteSpecifier) {
return absoluteSpecifier;
}
absoluteSpecifier = this._glimmerResolver.identify(_specifier);
if (absoluteSpecifier) {
return specifier;
}
}
return specifier;
},

Activity

  1. rwjblue commented on Jan 2, 2019

    @rwjblue
    Member

    Yep, I don't think this is a bug though...

  2. stefanpenner commented on Nov 19, 2019

    @stefanpenner
    Contributor

    As module unification is no more, I believe this can be closed. If I am closing this in error please let me know why, and we can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions