Ionic App size is way too big

TypeScript added string enums recently, so maybe uglify has not caught up to that.

Are there any project which was thinking of uglifying the css, as ionic css is very large.

I’m not sure about that, as typescript building phase should come first, and uglify should come next.
Uglify should work on js code base only, so it needs to be aware of the standard js.

I had problems not only on enumerations. Some stuff was resolved properly, similar stuff hasn’t been in the different part, just spaces has been removed.

Zipping is not proportionate, removing firebase i have already slashed from 1,58MB to 1,1MB.

Ionic is working on their “avocado” project which has to to with the native features. Not so much infos about it right now but if I understand correctly, it should/could replace cordova or something. If you are not on a rush, maybe you could wait for that (or help there)?

Cool! Have you submitted a PR with your improvments to the ionic-app-scripts project?

Don’t need that, make ng eject - - prod with angular cli

Anyway all my feature request has been dropped nothing to discuss

I have already wasted a year on a very simple app, i’m not confident enough looking at ionic, firebase and many stuff what i’m relying on, i want anything to use anymore. I don’t see too much benefit on this, as i just use the native js webkit call and will get the same effect. (looking at cordova it’s really just an interface, even the Platform does not drop me relyable info about my browser. I have played around with a qr scanner plugin, and after a while i needed to dig into android java code to fix something, but at the end i realised i can do it way more better. What i will use is some sort of official library, and i don’t need just a one line code buggy wrapper around it. Furthermore i cannot control my js size, which seriously affect my profitability. Looking pure angular seems to me that i can slash another 600-700kb removing ionic. I also find it easier especially in Angular to make native code, where it’s necessary. I’m master in java and i have to say it’s way more predictable than angular at the moment. Even Vanilla js is way more predictable than Angular at the moment. I’m not sure that it will ever change in the future, as angular compiler will be always one step behind on cutting edge browser technologis, tipically on WebRTC typescript just make an example where definition was outdated. For that official library the plugin does not really exist also, so avocado simply not enough.

ok, well then, I think I unfortunately can’t help here, some stuffs are probably faraway of my understanding and know-how :frowning: so, I just whish you good luck for your projects

The sad thruth is i’m very expert on web app profiling and there’s no economical sense right now to use too many js framework. It’s harder to develop, but at the end of your project you will seriously face with heavy performance issues on large scale on very dynamic page, which you might not be able to control, or just simply very hard to figure out. (virtual scroll was one of my hardest stuff, wasted 2-3 weeks on the performance. I had to dig into that code to figure out what i screwed up. I changed canvas to svg, but just simply debugging i hadn’t any clue, so i just removed line by line my stuff like in the old days. (i found ionic very hard on this particular issue, and ionic also needs lazy loading, which is brocken on ion-img, nobody seems to fix it, it’s reported by someone a year ago. If you have millions of dollars and don’t really matter whether you have a big app with bloatwares. Ionic the way to go, but if you just one free to use app, i don’t think anybody has enough budget, to pay to google cloud 3 mb per client per page visit.

what makes the App size way too big is the resources folder. check your resources especially the splash images. they contribute almost 85% of the App size. am thinking of the way of using only one splash image for all the device screens. will try this and see.

why i said it’s the resources folder. coz am developing one app, and its build with --prod flag , the app size is 13Mb. but if i extract the .apk, the resource folder is way too big hence the App size.

Did you compress your images first?

My tips when it goes to images:

Always compress images with https://compressor.io/ before adding anything in my app/website

This tool is so awesome and simple, I love it

In the mean time, i’m not using ionic anymore, i was almost able to jump to my implementation as a whole. I need to fix some virtual scroll stuff of mine (which has got two way scrolling and variable item height feature as default - server data decides, whether the feature will be activated automatically, no configuration), and drop the non-used ionic.

I have measured frequently the size of my app. I was coming from 2,5MB js size (minified --prod, i have checked what is causing it also with source-map-explorer). Unfortunately if you have big templates it’s increasing the size drastically (and the performance of your app is going down at first load - it seems to me similar how the jsp is working - load when it’s needed, at that time my dynamic form was frozen, second load time it was smooth - i have removed half of my template with more dynamic stuff, and voala, everything is smooth), so i’m not using the form and http from angular, i have some dynamic sophisticated one. I have used sprites, so it’s reduced the icon size and speed up the performance a lot.

Ionic has 400KB css minified even if you are not using them. My app now is about 800KB js, and some kb css.

Removing ionic, and reconfigure the angular (many times i had to use Renderer2 to hijack the angular 2, so a virtual dom system might be better for my expectations), i expect that my app is going to below 300KB + 100KB images. (we are not talking about user added photos, which is also controlled on upload, so i’m not saving the original image)

If i’m jumping to inferno instead of angular, at least i prepared for that scenario, i probably end up 100KB which is containing more advanced features than the ionic now. (not just virtual scroll and toggle with two handles)
I have announced that i will share the code in the past, but my app seems to me 95% reusable, so at the end i’m hesitating, probably not sharing the end result, until my app does not get traction.

I hadn’t that much problem with the images, as i had an approach in my mind, don’t go app store before test everything, so i’m asking the user first to add me to the home screen. (so i have time to bug fix, before i’m going to app store tedious procedure)

To be honest, as it’s a hybrid app, the main bottle neck not the size of apk, the main bottle neck is the size of your webpage. I think what i have done it’s a one year evolution, i have learnt a lot from ionic and angular, how to create my own system, but to use that technologies is a nightmare. Angular hasn’t got mature ideas, just some collection of ideas, and it’s just transforming always, and causing bugs.