What is acceptable app size for meteor?

Hi recently I am working on larger meteor project for US health domain and we have utilized extensive chart library like d3,c3, Raphael, Highcharts etc other much more utility library for prediction. In my development mode, I have just found that app.js generated by Meteor is almost 25 MB. Due to this when app loaded first time it taking too much time. Currently, we are using Meteor 1.4

So my question is what should be an acceptable size for meteor app and how can I improve the performance of such large app?

Wow that sounds a lot, even for a line of business type app with lots of external dependencies.

I’d say you should probably go through those dependencies, cross reference their capabilities with what you actually need, try to slim the app down by eliminating those that you can do without. I’m not suggesting to eliminate a feature (but might also be worth it in some cases) but to implement the feature with one of the other libraries or refactor the feature a little bit in such a way that your dependencies are optimized.

Make sure you are importing the parts of the libraries that you actually need. For example, if a library offers 10 different chart types and all you are using is the bar chart, then import only the bar chart if that’s doable with that library, most modern ones should allow for that.

Upgrade to Meteor 1.5 and begin using dynamic imports. This will allow you to load those larger libraries just in time at parts of your app where they are actually required.

Of course you should also use the new bundle visualizer to see what actually takes most of the space in that bundle.

This post from @sacha should help you get started.

1 Like

Let me try to upgrade meteor to 1.5 Also need consideration for the current code base. Maybe some of the current codebase might not be work as expected.