Zodiase / meteor-mdl

Material Design Lite package for Meteor
https://atmospherejs.com/zodiase/mdl
Apache License 2.0
53 stars 5 forks source link

Why are the packages so large? #69

Open wildhart opened 6 years ago

wildhart commented 6 years ago

More of a question than a bug: why are the zodiase_mdl and zodiase_mdl-assets packages so big? They are by far the biggest packages except for meteor tool itself:

After a starting my app on a fresh c9.io instance:

1.3G    ./home/ubuntu/.meteor/packages
457M    ./home/ubuntu/.meteor/packages/meteor-tool
190M    ./home/ubuntu/.meteor/packages/zodiase_mdl-assets
140M    ./home/ubuntu/.meteor/packages/zodiase_mdl

This makes it harder to use on a free c9.io instance which only has 2GB.

What are all these files?? Are there any parts I can safely delete if I'm not building for cordova?

The MDL download itself is only 27kB zipped, and a fresh npm install material-design-lite --save results in:

66M     ./home/ubuntu/node_modules/material-design-lite
25M     ./home/ubuntu/.npm/material-design-lite

Why is the meteor version so much bigger?

Please don't take this at criticism though, it's just curiosity ;-) I'm really grateful for your efforts, the package makes it so easy to use MDL in Meteor!

Zodiase commented 6 years ago

I took a look and the finds also confuse me. There are a few factors in play.

And BTW we are talking about development here. Ideally you could develop on your own machine and only deploy to the server with limited storage space.

First and foremost is the assets themselves. In order to support loading all the css and SCSS files from material-design-lite by code, the assets package has to include all the files. So that's about 40 MBs of stuff, for a single platform. So for all 3 major platforms (os (server), web.browser and web.cordova) sum up to 120 MBs already. What's shocking to me is the package also includes a copy of its npm dependency. So that adds another 66 MBs and is entirely unnecessary. I think I should be able to remove that part.

Then, for whatever reason, the zodiase_mdl package which uses the assets package also includes a copy of the files from the assets package. So that's a 40 + 66 MBs even though the assets package is right there next to it.

However when you actually build the production bundle and deploy that, you don't get these redundant wasting of space any more (because only the files for that specific platform is bundled) and the package should only take up about 120 MBs.

wildhart commented 6 years ago

Thanks for the information @Zodiase. Anything you can do to remove the duplication would be great.

Yes, I am talking about development. One location I work has a very restrictive firewall so even installing meteor and npm is impossible, so I was trying to do development in the cloud because I can access c9.io in a web browser with no problem. This is what led me to discover that the mdl packages were so large.

I have no problem with the deployed mdl server or client size.

Keep up the great work!