Discussion about app optimizations

Hey, I’ve just launched a small virtual guide app on the App Store (https://itunes.apple.com/us/app/alma-vii/id1140194246?mt=8) and Play Store.
All in all it was a straight forward and I enjoy Fuse more with each day.

The few issues I have revolve mostly around loading screens and loading lots of images/mp3 files.

  1. How should we properly build loading screens? I am using a Navigator and a Router, so when I change a page the app gets stuck a bit while the content on that page loads. Is there a method to preload content on a page template and be notified when it’s done? It would be nice to know what the lifecycle of templates, components and scripts actually looks like.

  2. I needed to load a bunch of images and sounds (about 350MB). This caused an old Android device to crash whenever the loading reached about 200-250M). These images and sounds were just saved to the data storage of the devices and were not used right away (they were part of image galleries split among 8-9 template pages). Yet, it seemed that working with a large number of files clogs up the app, even if they are not used right away. Tried setting deferred on some of them, but it didn’t really help. It would be nice to know how the framework handles loading and offloading resources.

  3. This is an idea for a feature, actually: because the app was pretty big (about 200M in the end), I had to build a resource loader, to keep the binary under 100M, so it fits on the app stores without splitting and such. The problem here was that fetch was not able to properly retrieve the content of binary files (images and mp3 files), so in the end I had to build my own Uno extension. Adding support for binary files to fetch would be nice. Or I will just share my extension :slight_smile:

Thank you for a great tool! I’ve gone into mobile dev not too long ago and I don’t regret one bit choosing Fuse.

If you could possibly open source your app, it would help the community learn and help optimize your app :slight_smile:

I could help you with an answer to number 3. Binary support for fetch is coming. And we are also looking into memory leaks in HTTP. This is something you would benefit from. Until this is out we can help people work around stuff like this by making some extensions like you have done. We also have resource loading on my teams list, as something we are going to improve for other scenarios as well.

  1. The busy mechanism is used for loading images and any Deferred tags. You can use WhileBusy to identify when it is still processing. A loading screen could be kept visible until the nodes are no longer busy – instead of turning it off the moment you navigate to home you’d instead keep it open until not busy. The mechanism is stil quite new, and we’re working on improving it.

  2. This sounds like a defect. Images that aren’t being used shouldn’t be consuming resources. However, the default memory policy will keep them around for a while (assuming they’ve been added to an Image or ImageSource tag). We’d need to know more about how you’re using them to figure out what the problem is.