Purpose of JSON assets in prod builds? #2004
Unanswered
AndresMaca
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi folks, I’ve been exploring the network layer and had a question about how we package demo data.
Right now the demo JSON assets (
news.json,topics.json) live undercore/network/src/main/assets, andDemoNiaNetworkDataSourceis only used in thedemoflavor (via the flavoredFlavoredNetworkModule). My understanding is that this means these assets are included in all variants, includingprod, even though they’re only needed by the demo flavor, apologies if I’m missing something here.Would it make sense to move those assets under
core/network/src/demo/assetsso they’re only packaged in demo builds? Or is there a specific reason we keep them insrc/main(e.g., tooling, tests, or the release process) that I’m not aware of? I’m mostly asking because I know app size can be a concern, especially in larger apps.Also, I was wondering if it could be useful to add a bit more testing around the content verification itself. For example, given a JSON array, we could assert that the elements are in the expected order and that they produce the right
NetworkChangeListentries. Happy to help with this if it seems worthwhile.Beta Was this translation helpful? Give feedback.
All reactions