Closed MartinMalinda closed 7 years ago
@runspired / @stefanpenner - Can one of y'all confirm that mapTyoes
was intentionally removed, and that this is a good replacement?
I just tried this solution with ember data 2.12.0 and it doesn't seem to work. It always return an empty array.
Also, I quick search in ember data repo, we can see that there is no definition of getModelTypes
, so I was wondering where that method is coming from.
Search: https://github.com/emberjs/data/search?q=getModelTypes&type=Code&utf8=%E2%9C%93
@josemarluedke I added a test repo here: https://github.com/MartinMalinda/ember-model-names. It works correctly there. A model is pushed to store in FastBoot mode and peeked in browser successfully.
Maybe you're running some older Ember.js version?
@rwjblue I don't believe that has been a thing for a very very long time
@MartinMalinda Thanks. I tested again in our application and discovered that this does not work with ember-resolver as of version 3.0.0. However, it does work with older versions.
The issue is already reported in ember-resolver: https://github.com/ember-cli/ember-resolver/issues/175.
Besides here, getModelTypes
is used in ember-admin
and also ember-inspector
.
The API docs mention The DataAdapter helps a data persistence library interface with tools that debug Ember such as the Ember Extension for Chrome and Firefox.
.
If DataAdapter should not be used for this usecase, we either have to use private API like Object.keys($E._identityMap._map)
or the modelNames will have to be explicitly configured.
This should work now with Ember-resolver 3.0.1.
I can confirm using the fork did fix the issue in a real-world app for me! 👍
Is there anything left to do here? Ping me if I can help in some way.
Apologies for the delay, I haven't been working near this addon lately.
@MartinMalinda This PR looks great, you should now have sufficient permissions to merge it and publish to npm.
Thank you. It's merged, released and published.
store.mapTypes
seems to be undefined on latest Ember Data. This PR introduces different logic to get available model names.