Closed franksl closed 3 years ago
I agree with @franksl . In my opinion, it's best to leave the sokil/php-isocodes as optional
+1 This blew up my project by 85 MB. :open_mouth: After finding the issue I did roll back to 2.1.0.
We are also concerned with this.
We deploy our application as a lambda function, which limits the compressed package size to 50MB (unless you store it on s3). Installing Respect doubled our package size because of iso-codes.
We do not use the rules that require that package, so it is not ideal.
As noted in PR #1335 by @henriquemoody, removing this would be a breaking change, and thus need a major release. However, I would argue that adding a >80MB dependency is also a breaking change for some people (like us...it broke our deployment process).
If anyone is interested while waiting for a resolution for this or waiting for some free time to evaluate other libraries I added a script in composer.json in my packages to remove the sokil library from vendor:
{
....
"scripts": {
"post-update-cmd": [
"rm -rf vendor/sokil"
]
}
}
Hope this helps, Frank
That's a good fix for now, @franksl! The problem is that "sokil/php-isocodes" stored the translations for all languages inside itself. If you only need them in English you can add this to your composer.json
file:
{
"scripts": {
"post-update-cmd": [
"rm -rf vendor/sokil/php-isocodes/messages"
]
}
}
With that, the validations for "CountryCode", "CurrencyCode", "LanguageCode", and "SubdivisionCode" will still work
I'm sorry it took so long. I've removed "sokil/php-isocodes" as a dependency and it's available on version 2.2.3.
I will try to introduce a smarter way to implement this on the next version.
Thanks for reporting! 🐼
Hi, I noticed that sokil/php-isocodes is set in both the "suggest" and "require" fields in composer.json. That is a very big library causing the vendor directory to become very big, this is a problem where space is limited. I suggest to leave that as only suggested (sorry, no pun intended :-) ). Thanks, Frank