Open NullVoxPopuli opened 8 months ago
This would be used when reading ember-data models and auto creating mirage models. It would also be used in doing the same for serializers.
This auto generation was not included (opting for manual creation) because of the following reasons.
The mentioned babel plugin really only solves problem 1. For 2 and 3, I have also heard that ember-data plans (via the cache) to implement a mirage like behavior in ember-data itself. This would also make this addon only used my people who dont use ember-data in the future, so supporting this functionality doesnt make sense in the long run.
Should we instead provide a code mod that creates all the mirage models and serializers that the addon consumer has now, then going forward the consumer would just create the models by hand (could always re-run the code mod). Creating models by hand hopefully would encourage them to create models that actually look like the backend. This would prevent the need to mirage serializers and would allow the ember-data serializers to work as intended.
Here is import.meta.glob for classic: https://github.com/NullVoxPopuli/ember-classic-import-meta-glob
I still need to add support for embroider and auto-import's allowAppImports, but it's closer
babel plugin: https://www.npmjs.com/package/babel-plugin-transform-vite-meta-glob