-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Remove MODEL_FACTORY_INJECTIONS #9500
Comments
i'll list more and a migration plan as I have time. |
I feel like this could be actionable immediately (I'm saying I could try to do it) if we put stuff on the (Ember, not Ember Data) meta for the class. Is that a valid assumption? |
I think its tricky since it cache various relationship things as CP's on the constructor. This caching is important re: perf, but also pollutes the constructor. This is fixed by todays EXTEND_PROTOTYPES = true, as we get a new subclass each test run. But unfortunately |
@fivetanley Can we make sure we discuss an alternative for storing metadata on classes at the next ED meeting? |
Perhaps the factory returned from the container, in addition to having a |
I've made a note of it and will bring it up next week. |
factoryObject = {
Class: OriginalClassObject,
create(attrs) { ... create instance with injections }
}; |
@stefanpenner Great point. Uppercase "C" looks a little weird to me—what about lowercase "c" |
@tomdale ya it should be safe with ES3Safe and modern browsers |
Currently in ED in a lot of places where we use modelFor(mostly in Serializer/Adapter), we actually want the class not the factory, as we don't instantiate stuff ourselves, just lookup metadata |
@igorT @bmac @fivetanley whats the status for ember-data on this one? |
I believe a bunch of work in ED has been done on this. I'd like to get some feedback from @emberjs/ember-data-contributors... |
The remaining work was removing the fact the subclasses are returned from lookup factory. Unfortunately others decided this was for some reason to much of a breaking change during 2.0 transition |
emberjs/data#4810 + #14360 together make cc @chadhietala |
We can deprecate having it set though. This sets us up for removal at some future point (sometime after 2.16). |
MODEL_FACTORY_INJECTIONS was removed in 2.14. |
What are the blockers for normalizing model instantiation to be like all other injections?
The text was updated successfully, but these errors were encountered: