symfony polyfills are unnecessarily installed by default #12337
Unanswered
fredericgboutin-yapla
asked this question in
Q&A / Support
Replies: 1 comment 1 reply
-
This may be one day fixed by #7557 but not sure when I get to it.. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there 👋
I'll go straight to the point 😅
I'm using symfony polyfills and according to their doc it is a good practice to add a
replace
statement in thecomposer.json
file.Source: https://github.com/symfony/polyfill?tab=readme-ov-file#design
What it does is that it prevents composer from downloading, installing, registering and for the autoload to provide support for polyfills that are really NOT needed AT ALL.
So, my problem goes like this: I have to replicate and maintain this
replace
section manually in every "application" projects all the time ❗Think about it, even when not explicitly using
symfony/polyfill
packages, a LOT of components out-there depends on them so there is a great chance we are all pulling these dependencies in ourvendor
folder and packaging our applications with them without even realizing it. This is the default behavior here.Look at the downloads on packagist.org for these packages, they are astronomic.
So... I don't have a specific solution in mind but clearly if Composer had some sort of "first-class" support for polyfill or are least for php polyfills - or specifically symfony polyfills 😅 - then when the
composer.json
has a PHP version requirement then Composer could "replace" those wasteful packages automatically.For example, having something like this in your
composer.json
,would then automatically apply the equivalent of,
What do you think ?
Beta Was this translation helpful? Give feedback.
All reactions