Skip to content

Consider removing wkhtmltopdf-binary from dependencies #13553

@microstudi

Description

@microstudi

Describe the bug

The gem wkhtmltopdf-binary is set as a dependency in various places in Decidim.
However, this gem is only used to automatically extract a suitable binary for the detected platform. And it's size is... about 420M which heavily impacts on deploys. Specially on Heroku that has a limit o 500Mb for each bundle. But also releases based on Docker will greatly benefit from removing this.

This should be accompanied by some instructions on how to install the pdf binary on different platforms.
To maintain compatibility I'd would add in the generate application Gemfile something like:

gem "puma"
# this adds the wkhtmltopdf binary required for pdf treatment in Decidim.
# However you might want to specify the path manually to save space (this gem is huge and 90% of it won't be used in the production platform)
gem "wkhtmltopdf-binary" 

To Reproduce

  1. Check the location of your gems:
    bundle info wkhtmltopdf-binary
  2. Check the size of it (du -h $(bundle info --path wkhtmltopdf-binary))
  3. Check the content of it ls -l $(bundle info --path wkhtmltopdf-binary)/bin
  4. See that most of the files aren't used in your platform.

Expected behavior

I would like to minimize this kind of required dependencies that makes a bundle so cumbersome.

Screenshots

No response

Stacktrace

No response

Extra data

  • Device: any
  • Device OS: any
  • Browser: any
  • Decidim Version: any
  • Decidim installation: any

Additional context

No response

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions