-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[RFC] Split the Intl polyfill from the Intl CLDR features #37758
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
Comments
That'd make sense, help wanted! |
Do we want to make some complex git magic to preserve the git history of the various polyfill files in the polyfill repository (this would probably result into a branch starting from an separate root in the history, and merged when merging the code, as we don't want to rewrite the history of symfony/polyfill) or are we OK with a dumb copy in the new repo resulting into a single |
There is one thing I wonder: to avoid duplicate class definitions, we might need to make
|
@nicolas-grekas any answer ? |
I gave this a try. I have a locally rewritten history of the polyfill classes. But I have one blocker: |
@nicolas-grekas the fallback NumberFormatter implements English only, and only needs 2 info about the currencies: the symbol and the fraction digits. We could bundle that (much smaller) info in the polyfill package (without exposing it to the outside, as that's what |
@nicolas-grekas should this really be closed ? I think it requires changes in symfony/symfony too. |
…l-intl-icu (nicolas-grekas) This PR was merged into the 5.x branch. Discussion ---------- [Intl] deprecate polyfills in favor of symfony/polyfill-intl-icu | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | Fix #37758 | License | MIT | Doc PR | - Follows symfony/polyfill#310 /cc @stof Commits ------- 6ad0169 [Intl] deprecate polyfills in favor of symfony/polyfill-intl-icu
Uh oh!
There was an error while loading. Please reload this page.
Description
The
symfony/intl
package provides 2 independent sets of features:ext-intl
classes exposing ICU features (IntlDateFormatter
,IntlNumberFormatter
,Collator
andLocale
)ext-intl
. That's the\Symfony\Component\Intl\Intl
class in older Symfony versions, and its replacements in newer versions (\Symfony\Component\Intl\{Currencies,Locales,Locale,Languages,Countries,Scripts,Timezones}
)When we created the symfony polyfills (many years later), we created a
symfony/polyfill-intl-icu
, which is semantically meant to provide the first half, but is actually implemented by requiringsymfony/intl
. This has several effects:symfony/polyfill-intl-icu
)symfony/polyfill-intl-icu
actually receive the fullsymfony/intl
package, which is by far the biggest contributor to the size of vendors among Symfony components (and bigger than many packages in the ecosystem) due to the size of the CLDR data, which is not needed for their use case.symfony/polyfills
but can be confusing when finding it insymfony/symfony
(see [Intl] IntlDateFormatter is abstract, yet it promotes instantiation #37756 for instance, which is caused by such confusion)replace
trick to remove unnecessary polyfills because your project has a requirement onext-intl
, you will still get the polyfill implementation in your vendors (which might confuse the IDE due to double class definitions)Proposal
My proposal is to actually move the implementation of ICU polyfills to
symfony/polyfill-intl-icu
directly (the only change needed would be the namespace used for internal classes), and then change the order of the dependency.symfony/polyfill-intl-icu
would be standalone, andsymfony/intl
would requiresymfony/polyfill-intl-icu
(with the new version containing the polyfill as lowest bound).This would give clear responsibilities to both packages, one providing the polyfill and the other one providing extra features.
The only impact would be on projects requiring
symfony/polyfill-intl-icu
and actually using thesymfony/intl
APIs without noticing they don't define a requirement for them, assymfony/intl
might not be installed anymore. But thesymfony/polyfill-intl-icu
package does not document that these APIs become available due to the implementation details.The text was updated successfully, but these errors were encountered: