Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize for packagist production #3503

Closed
luukvhoudt opened this issue Apr 8, 2021 · 7 comments · Fixed by #3570
Closed

Optimize for packagist production #3503

luukvhoudt opened this issue Apr 8, 2021 · 7 comments · Fixed by #3570

Comments

@luukvhoudt
Copy link

When downloading the Twig package from packagist a lot of files are included which are never used in production or even by the developer itself. Have a look, this is what I get in my vendor/twig/twig folder after composer require "twig/twig:^3.0":

CHANGELOG
composer.json
doc
drupal_test.sh
.editorconfig
.gitattributes
.github
.gitignore
LICENSE
.php_cs.dist
README.rst
src

Files and directories I think can be ignored:

.github
doc
drupal_test.sh
.editorconfig
.gitattributes
.gitignore
.php_cs.dist

These files together are 640kb, while the whole package is about 1700kb. That's about 48% of the total file size.

Please fix this. Love the package, thank you <3

@stof
Copy link
Member

stof commented Apr 8, 2021

excluding the doc source code from the archive indeed probably makes sense (that's probably the bulk of these 640KB as others are small files)

@luukvhoudt
Copy link
Author

Yes it's now 620KB

@williamdes
Copy link

Here is a list of the useless files: https://github.com/code-lts/doctum/blob/b2fca74060ba1a84c1dac23eec21221fbc589524/releases/5.4.0-dev/manifest.json#L3712

Files:

        "vendor/twig/twig/.gitignore",
        "vendor/twig/twig/CHANGELOG",
        "vendor/twig/twig/composer.json",
        "vendor/twig/twig/README.rst",
        "vendor/twig/twig/.gitattributes",
        "vendor/twig/twig/drupal_test.sh",
        "vendor/twig/twig/.php_cs.dist",
        "vendor/twig/twig/.editorconfig",

Folders:

        "vendor/twig/twig/doc",
        "vendor/twig/twig/.github",

@fabpot
Copy link
Contributor

fabpot commented Oct 4, 2021

Most files mentioned above do not contribute significantly to the size of the archive. Can some create a PR to exclude the doc/ directory as this is indeed contributing significantly?

@kaznovac
Copy link
Contributor

kaznovac commented Oct 4, 2021

@fabpot please look again at #3570 - it excludes the doc along with the rest of unusable files in prod

@fabpot fabpot closed this as completed in 8bab813 Oct 4, 2021
@williamdes
Copy link

Most files mentioned above do not contribute significantly to the size of the archive. Can some create a PR to exclude the doc/ directory as this is indeed contributing significantly?

Multiply it by the number of installs of twig ;)

@chapterjason
Copy link

@williamdes But these aren't installed in one system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

6 participants