-
Notifications
You must be signed in to change notification settings - Fork 70
Description
The update bundles that we host on the asset canister for the android app to download are bigger than they could be. We have already substantially optimised this but there is more we can do:
/assets
In the web version, we do not version these assets at all and they are cached (I think for one month). We can arguably get away with building the assets into the apk and just not having them in the zip bundles. The risk is that there are new assets that the app doesn't have or in much rarer cases, modified assets. We could handle that by either creating an app release and / or have a web fallback for any asset that the app does not have locally built in.
Tree shaking
When we build for web we take the output from the web build and inject params to make it behave like android to create the download zips. This is good in that it means we only have to run the actual build once. But it is also bad because it means the switch at the root of the component tree is dynamic rather than static as far as rollup is concerned. This means that it bundles desktop and mobile components into the android build. It would be worth analysing what effect this has and whether it is worth doing something about it to make the tree-shaking possible. Essential it would mean building twice for each web build in order to get a smaller android bundle (and indeed a smaller web bundle).