materialize icon indicating copy to clipboard operation
materialize copied to clipboard

Repository Size is too large for use with Bower

Open samlovescoding opened this issue 9 years ago • 21 comments

Description

When I download materialize using bower, it takes alot of time to download on a broadband connection [usually 1mbps]. I know its a network speed thing but downloading 20mb file everytime is insane. Please update repository so that bower usable.

Repro Steps

Just run bower install materialize in ur cmd

samlovescoding avatar Apr 29 '17 02:04 samlovescoding

@Dogfalo @acburst can't we delete the bin directory as these files should be created with each compilation?

Imho it makes more sense to move the zip task to a release task.

@tomscholz @fega your opinions on this?

DanielRuf avatar Apr 29 '17 10:04 DanielRuf

Actually I think a better way would using a Bower Ignore List Have a reference to - http://stackoverflow.com/questions/18245394/ignore-in-bowers-bower-json Because in the bower installation, we would only require the dist folder so it makes everything else "not important". I did not wanted to use the word "useless" as it is important for some people.

samlovescoding avatar Apr 29 '17 10:04 samlovescoding

I don't agree. It also makes sense to include / import Sass files and other source files, overwrite variables and use these with a bundler like webpack. It is normal that you always have also the source files. Take a look at the bower packages for Bootstrap, jQuery, Roboto and so on.

DanielRuf avatar Apr 29 '17 10:04 DanielRuf

@DanielRuf the problem with the repo is all of those web page stuff. including images...

the website should in another repo!

@SamWillson I agree with @DanielRuf the source files should in the download

fega avatar Apr 29 '17 12:04 fega

@fega right, a separate repository for the docs makes sense, but just if this is possible.

But why not deliver the docs with the package so developers have the docs of the installed version?

Anyway, dependencies are just installed once and just a few files imported.

DanielRuf avatar Apr 29 '17 12:04 DanielRuf

I'm not really sure why the bower size is 20mb, since the materialize folder after bower install materialize completes is 4.27mb

Dogfalo avatar Apr 30 '17 19:04 Dogfalo

I'm not really sure why the bower size is 20mb, since the materialize folder after bower install materialize completes is 4.27mb

$ bower install Dogfalo/materialize --force --verbose
bower resolve       https://github.com/Dogfalo/materialize.git#*
bower download      https://github.com/Dogfalo/materialize/archive/v0.98.2.tar.gz
bower progress      materialize#* received 4.3MB of 20.4MB downloaded, 21%
...
bower progress      materialize#* received 20.2MB of 20.4MB downloaded, 99%
bower extract       materialize#* archive.tar.gz

DanielRuf avatar Apr 30 '17 19:04 DanielRuf

It is mainly the images folder.

user env ~/Desktop/materialize-0.98.2.tar/materialize-0.98.2/materialize-0.98.2
$ du -sh * | sort -h
...
97K     tests
112K    extras
128K    test
140K    css
271K    sass
410K    js
644K    jade
772K    fonts
1,1M    res
1,5M    dist
2,2M    bin
3,3M    templates
13M     images

After the unpacking process, the ignored files are removed.

  "ignore": [
    "jade/",
    ".gitignore",
    "CNAME",
    "css/",
    "bower.json",
    "README.md",
    "images/",
    "js/jquery.timeago.js",
    "js/init.js",
    "js/prism.js",
    "res/",
    "sass/style.scss",
    "sass/ghpages-materialize.scss",
    "**/*.html",
    "**/*.zip",
    "**/*.txt",
    "sitemap.xml",
    "package.json",
    "Gruntfile.js"
  ],

So ignoring does not change the size of the archive in any way. Please keep in mind that the download is stored in the cache of Bower and so the next time you install this version again, it uses your cache.

DanielRuf avatar Apr 30 '17 19:04 DanielRuf

I don't see images when I bower install

On Sun, Apr 30, 2017 at 12:57 PM, Daniel Ruf [email protected] wrote:

It is mainly the images folder.

$ du -sh * | sort -h ... 97K tests 112K extras 128K test 140K css 271K sass 410K js 644K jade 772K fonts 1,1M res 1,5M dist 2,2M bin 3,3M templates 13M images

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Dogfalo/materialize/issues/4623#issuecomment-298253220, or mute the thread https://github.com/notifications/unsubscribe-auth/ACpax-Jx9bwDsGSq_6d8jfyfiPrwzPjDks5r1OergaJpZM4NMIB8 .

-- Doggy sends his greetings from Mars.

Dogfalo avatar Apr 30 '17 20:04 Dogfalo

The du command was on the manually downloaded tarball. Not the final bower_components/matrialize directory. Bower deletes the files and directories fro the ignore key.

Running PNGGauntlet just saves ~2 MB (png files).

DanielRuf avatar Apr 30 '17 20:04 DanielRuf

Download https://github.com/Dogfalo/materialize/archive/v0.98.2.tar.gz and extract it ;-)

A diff with the final files and directories in the bower_coponents/materialize directory makes clear that the ignored files are not there after the cleanup process of Bower.

DanielRuf avatar Apr 30 '17 20:04 DanielRuf

Anyway, imho 20 MB is nothing compared to other archives and Bower / npm directories with hundreds of MB dependencies. You always use just a fraction of this. I know, this takes a while and the first install of big projects with an empty cache can take some minutes, this is not unusual.

DanielRuf avatar May 01 '17 16:05 DanielRuf

@DanielRuf But we always could do better 🥇

fega avatar May 02 '17 13:05 fega

Should not be a good idea create o new organization on Github and split the site itself and the framework?

Things would be more clear with that, and no unnecessary files on each repo ...

pmargreff avatar May 11 '17 13:05 pmargreff

When we put the whole documentation in a new folder we could just put that folder to the bower ignore file...

tomscholz avatar May 11 '17 13:05 tomscholz

When we put the whole documentation in a new folder we could just put that folder to the bower ignore file...

Well but this would not decrease the size of the tarball which is downloaded and which is so big ;-) Only solution would be to use another branch for the site or https://github.com/Dogfalo/materialize/issues/4623#issuecomment-300791268 to decrease the size of the tarball (master branch, the one which you download at the top right with the clone / download button).

At least the release / archive is too big https://github.com/Dogfalo/materialize/issues/4623#issuecomment-298254441

https://github.com/Dogfalo/materialize/releases

DanielRuf avatar May 11 '17 13:05 DanielRuf

How does bootstrap do it? How do they keep their bower package so small then? They have the docs in same repo...

tomscholz avatar May 11 '17 14:05 tomscholz

It is the exact same size like the v3-dev / master branch. Bower downloads, extracts it and then it is cleaned up (the ignored stuff deleted).

They do not host such big images in their repository like we do ;-)

$ bower install bootstrap --force --verbose
...
bower progress      bootstrap#* received 1.9MB of 4.0MB downloaded, 48%
bower progress      bootstrap#^3.3.7 received 1.9MB of 4.0MB downloaded, 48%
...
bower progress      bootstrap#^3.3.7 received 3.9MB of 4.0MB downloaded, 97%
bower extract       bootstrap#^3.3.7 archive.tar.gz

DanielRuf avatar May 11 '17 14:05 DanielRuf

I think since Bower is now deprecated, we can close this issue. What do you think?

tomscholz avatar May 23 '17 12:05 tomscholz

Also it would not make any difference for the most alternatives as they still download the full archive first, extract it, clean it up and then you have the final (smaller) size. The first download (the archive) is still big and bigger in some other projects and it is locally cached after this.

DanielRuf avatar May 23 '17 15:05 DanielRuf