moko-resources
moko-resources copied to clipboard
Library decomposition + configuration cache support
Currently, library does not support configuration cache. It's really bad and unconvenient, we know. And if we want to add support for it, we need to fully rewrite resources-generator plugin to support it. Project is rather complicated now for effective refactoring. Seems that project needs decomposition. But we also need to save support of current library API. Therefore, I suggest bunch of steps for effective project refactoring:
- Decompose resources-generator plugin and resources lib by bunch of smaller plugins and libs for every type of resource. Examples of plugin's id's: dev.icerock.mobile.multiplatform-resources-strings for string resources dev.icerock.mobile.multiplatform-resources-colors for color resources, etc. What advantages will we get:
- Significatly increased maintainability: it will be much simplier for authors and community to explore project and make changes for specific resource which it's interested. Also, large refactoring works will be mush simplier to do
- Separated scopes of usage: every community member will get a possibility to use only types of resources which they are interested without doing unnecessary work What disadvantages:
- Increased diffculty of connecting generating multiple resources types to their projects Workaround: we could save moko-resources plugin and moko-resources libs as union of all smaller plugins (by applying all small plugins inside MultiplatformResourcesPlugin) and libs (via api dependencies) After that, it will be much simplier to add configuration cache support for every small plugin. If you're intersted by this idea, i could try to add support for "future" multiplatform-strings plugin
hi! refactoring and decomposition looks like good idea at first. but i think separation of plugin to multiple plugins not give some improvements. i think plugin can be saved as single plugin, but classes should be simplified. maybe plugin module separate to multiple to improve maintainability. i see that some part specially for apple should be single for all resource types - creation of bundle with resources for example. i think main pain point is resources generation plugin, not runtime libs (runtime is small and not complicated i think) and here any tries can help.
fix in #575
plugin was rewrited in 0.24.0, configuration cache supported started 0.24.0-alpha-3
fixed in 0.24.0-beta-1