-
-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can we make lookupFactory
public on ContainerProxyMixin
?
#125
Comments
I tend to agree, it seems like indirection to add a lot of |
The main reason that we didn't make The goal of that refactor is to remove the current requirement that we Some rough pseudo code: class FactoryWrapper {
constructor(Factory) {
this.Factory = Factory;
this._extendValues = [];
}
extend() {
this._extendValues.push(...arguments);
}
create() {
return Factory.create(...this._extendValues, ...arguments);
}
}
// ...snip...
factoryFor(name) {
let Factory = normalResolverStuffHere(name);
let wrapper = new FactoryWrapper(Factory);
wrapper.extend(injectionsFor(name));
return wrapper;
} Obviously, there are a number of things missing in my example above, but that should help understand why things are the way they are today... |
I can say that ember-admin was using |
specifically, we use it to find templates: https://github.com/DockYard/ember-admin/blob/04db8d7c86be89a94eae657c3d4c8f7ff3e8e988/addon/mixins/model-records/write.js#L14 Because templates are just factories we have to use this function |
until what @rwjblue lands, that is unfortunately just a reality for now. |
@bcardarella - Templates can be looked up via |
@rwjblue that worked, thank you! |
With ember-data-model-fragments we have to rely on the private variation of
_lookupFactory
on theowner
to lookup fragment classes, see: ember-data-model-fragments/.../ext.js.This was part of the container API originally. And I know that was private and also we don't want to encourage users to be instantiating their own instances, but this is something we could really use for addons.
Originally filed as emberjs/ember.js#13065
The text was updated successfully, but these errors were encountered: