-
-
Notifications
You must be signed in to change notification settings - Fork 7
merged v1.1.x and v1.2.x #12
Conversation
|
I forgot to mention one optimization that we might make later on: this PR packages 2 versions of the ICU data (one per format version.) The more recent version is way more compact, but it cannot be read by intl extensions, compiled against the old format (but the newer version can read the old format.) So, if there are no significant performance gains when using the newest format, we can drop it altogether and only package the old format (that will save about 8Mb.) |
|
For those reviewing this PR, the only interesting part is the changes done in the |
|
Looks good to me. For DX reasons, I suggest to completely deprecate symfony/icu and create a new package symfony/intl-data instead. This will make the meaning of the package much clearer, especially now that people have to manually add it. |
|
Furthermore, the intl/icu dependencies should be removed from composer.json. Otherwise people can't install lock-files that contain symfony/intl-data unless they have the extension loaded. |
|
@webmozart I've removed the |
An alternative would be to implement the |
|
@webmozart What about dropping the dependency on |
|
@fabpot Yes, makes sense. |
|
@webmozart I've added the following to the composer file: |
|
@webmozart We can indeed create a new repository named |
|
I also agree about changing the name of the package. If we want to be consistent, the class name could be |
|
@stof I agree with you: |
|
And the repository would be named |
|
yes (and the composer package too) |
|
btw, should it be intl-data or icu-data ? We are talking about ICU currently |
|
It should be intl-data. To be 100% precise, we're talking about the CLDR data used by the ICU project, which is in turn used by PHP's intl extension. But that's useless information for our users. So intl-data should be fine. |
|
Closing this PR as I've moved everything to https://github.com/symfony/intl-data |
|
@fabpot I thinkt that the |
|
I'm not sure whether it's good to drop the |
|
@fabpot the readme needs to be updated |
|
@webmozart I'm not sure we have in the Symfony organization (which mostly contains subtree splits), but the PHP-CS-Fixer uses |
|
symfony/symfony#11884 is the counterpart of this PR. I've submitted here now to gather feedback but as I worked on it quite a long time ago, I'm sure it's finished yet. |
|
@webmozart For the Intl dep, I've created an issue on the other repository (symfony/intl-data#1.) |
|
@stof which README file? |
|
https://github.com/symfony/intl-data/blob/7cbe6f1b278072fa9e5c3339c4eb7cea11ae1388/README.md which says it contains data for ICU 4.4+ |
I can't seem to find my post where I tested all this and then described everything. But it's complicated. AFAIR: The old format has to be generated with the old genrb as even though you specify the new genrb to generate the old format res file it doesn't do so. P.S. The data shipped here is old. As there is already ICU 53 |
That's what we do ATM.
Yes, we need to update it when this bug fix is through. |
Quick remainder of the problem we are facing right now with the ICU component:
When running
composer installwhensymfony/intlis required, a trick makes Composer install either the 1.1 or 1.2 branch of thesymfony/ICUcomponent. As the decision is done at installation time, you can have problems if you deploy on a server with a different version of PHP intl (or no intl at all.) That's also a big problem for the pre-packaged Symfony projects that one can download from symfony.com as they always contain the 1.2 data (as this is what is installed on the packaging server.)This PR proposes to switch the check at runtime via the
IcuDataclass to fix the problem once and for all. To achieve this goal, several changes are needed:1/ The current 1.0 branch (which contains the stubbed data for the English locale only) are moved to the
symfony/intlcomponent;2/ The classes from all branches are moved to the
symfony/intlcomponent as well;3/ The 1.0, 1.1, 1.2 branches are deprecated and kept only for BC reasons;
4/ The new master branch contains the data from 1.1 and 1.2. The
IcuDataclass uses the correct version of the ICU data depending on the user PHP intl extension version.Now, about compatibility. The PR on
symfony/symfonywill be done on the 2.3 branch as the problem is a real blocker for a lot of our users (and hosters), so we cannot just make it for the master branch.Current:
symfony/intldepends onsymfony/icuand the right version of the data is installed depending on the intl version of your machine. So, without intl, you get the stub data, and with intl you get the 1.1 or 1.2 versions (8 or 20 Mb.)Target:
symfony/intldoes not depend onsymfony/icuanymore. Without an explicit dependency onsymfony/icu, you will get the stubbed data (even if you have the PHP intl extension.) To get the data, one need to explicitely add thesymfony/icudependency tocomposer.json, which will get you the 8+20 Mb data for both ICU data formats.As you understand, that breaks BC for people relying on the ICU data as they need to explicitely add the
symfony/icudependency (2.0 version) in their project. I think this acceptable as it fixes one of the biggest WTF problem of Symfony.1/ and 2/ are going to be submitted as a PR to symfony/intl soon.
This PR is based on the 1.2.x branch and so it CANNOT be merged as is as it should be the new master branch of the Icu repository.