-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
⬆️ Drop Symfony < 4.4 and PHP < 7.2.5 support #2070
Comments
please reconsider dopping symfony 4.4 support, look at the symfony version/release policy:
https://symfony.com/doc/current/contributing/community/releases.html#backward-compatibility so 4.4 is euqal with symfony 5.0 only that is still has the old features marked as deprecated plus the new symfony 5.0 features. so symfony 4.4 supports the new contracts namespace. as symfony 4.4 is an LTS version and supported until nov 2022 (bug) & nov 2023 (security) it would be a better choice to only drop symfony support lower than 4.4 instead of 5.0 and allow to use this awesome lib with the symfony LTS version. |
That's exactly the same for Carbon. We're developing 3.x while we still continue to maintain 2.x. Then the support of a given Symfony version by other libraries is not driven by the Symfony version policy. That policy does only concern the symfony namespace library. As you may see Laravel is developing its 8.0 version and already dropped Symfony < 5 since 7.0. Carbon won't stop to be compatible with Symfony 4, Carbon 2 will still be available as usual from packagist. Only the new version Carbon 3 which will come with other breaking changes will require Symfony 5 as the minimum requirement. |
i know that your version policy don't match symfonys, thats the reason why i added this comment, just wanted to let you know that this two symfony versions are basically exactly the same. but why? as 4.4==5.0 there is no good reason for dropping support for it.
i don't know laravel but i simply take your info for real, so my comment would also match there, it makes no sense for laravel to drop symfony 4.4 support as, i repeat myself, symfony 4.4 has the same feature set as symfony 5.0. in my symfony projects i stick with LTS -> 4.4, and i use quite a lot 5.x symfony components. they are compatible i assume that you will add return types and other great php language features which i love to use, so i would love to use carbon 3.0 with symfony 4.4 |
That may look so from the application side point of view, but that's not true, and using 1 version for you application is nothing like maintaining a range of multiple versions for each library (+ the language itself) Carbon must remain compatible with. If you don't want to upgrade to Symfony 5, you should not worry about staying with Carbon 2 either.
That's not a decisive reason for keeping/dropping support.
Great, so you can upgrade the translation component to ^5.0 (that's the only one we need) and that's the one component that forced us previously to have many if-else code to support both symfony/translation 4 and symfony/translation 5. Carbon 3 is still far from being released as a stable version. Maybe you'll no longer use Symfony 4.4 at this moment. And we still have time to check and re-enable the Symfony 4.4 at the single condition it would not require to alias namespaces/classes or to deal with differences in method signatures. |
thanks for your time and for your fast, friendly and detailed replies <3 maybe you can be so kind and give me a code example where the access/api to the symfony 4.4 translation differs from the symfony 5.0? i would be really interested in this topic because the symfony docs states 4.4 == 5.0, so symfony 4.4 translation component should be able to be accessed as if it would be a 5.0 component with the ability to access it with the old 4.x api but if you access it with the 4.x api it would show a deprecation warning. from my understanding the BC layer lies inside of symfony and it should not require you to add the bc layer in your lib.
so this should only be required if you also support 4.3 but not if you support only 4.4 for example 8106250#diff-40f47bcf6cf989bec1e8ef5c8f7bb08aR729 here component is replaced with contract. in my symfony 4.4 installation the translation-contracts are installed. so i have the right translation interface. do is overlook or miss something? and thanks for this awesome lib 👍 ❤️ |
Sadly very easy, here's what happen if you try to install Symfony 4.4 and run the unit tests: As namespace of interface is not the same, the same code cannot be used as is. Currently there are 8 broken tests in the branch 3.x (they will be progressively re-enabled). Omitting those ones, I except all unit tests to pass. If installing symfony/translation 4.4 breaks tests, I consider it's not compatible with the usage we made of it in Carbon 3 following the way documented for the symfony/translation 5 API. If we have to require "translation-contracts" while it's actually only needed for Symfony 4 users, that's pretty annoying. That's a small package but I feel not very comfortable with adding additional libraries for backward-compatibility. It does not sound like the Carbon library's responsibility. That's actually maybe worst than aliasing classes/interfaces as it's duplicate the code and classes will still only implement one or the other but not both. |
hmm, have not tried the tests locally but having a quick look on the dependnecies of sf5.0 and sf4.4 sf4.4 so adding the following to carbons composer file should/maybe fixes the tests and as the contracts gets installed anyway it is not an additional requirement only the correct requirement
https://packagist.org/packages/symfony/translation
|
Requiring symfony/translation-contracts: ^2 does not seem to help: Travis actually install 2.1.2 in this build and still fail on Component vs. Contracts interface matching. |
Actually, the interface is not missing, it's just not compatible so I doubt it could be fixed so easily. |
you maybe already have seen i played around with your test branch #2153 for testing purposes i hardcoded the php version and i personally use i dont understand why the deprecated interface is still in the codebase. requiring symfony 5.x also means there is no after my change the tests look not that bad: https://travis-ci.org/github/briannesbitt/Carbon/builds/716173343 sidenote there are some risky code parts i, my awesome phpstorm plugin made me aware of some risky code parts. maybe have a look at https://plugins.jetbrains.com/plugin/7622-php-inspections-ea-extended- |
Carbon 2 supports symfony/translation 3.4+ so it has too keep both namespaces. In Carbon 3, we'll definitely drop Symfony 3 and the old namespace. This state of tests looks good. But it has to pass with the composer flag Still this POC is very good. |
but we talk about carbon 3 here, where you want to drop symfony 4.4, if you drop everything below symfony 5.0 you would also drop symfony 3.4. ;) from my knowledge it should work with the following:
with this changes sf4.4 should behave like sf5.0 and no drop of supporting it is required as it is really basically the same as 5.0 just ping me if you need more info or testing. for me it is an important thing that sf4.4 will be supported in carbon 3.0 (slack chat is also possible) |
Obviously, and Carbon 3 is not released and this issue is still open. The branch I mentioned in your PR is the one more advanced on this topic: feature/issue-1967-week-based-on-locale already drop all the old interfaces. 4.4 => 5.0 means breaking change, and when Symfony 6.0 will be released, we'll could fall again in the same situation than Carbon 2 with 3.4 => 5.1 range and incompatibilities to handle. |
Symfony 5.0.0: public function setLocale(string $locale) https://github.com/symfony/translation/blob/v5.0.0/Translator.php#L147 Symfony 4.4.0: public function setLocale($locale) https://github.com/symfony/translation/blob/v4.4.0/Translator.php#L159 This first difference force us to pick the less precise typehint in our Translator to support 4.4.0 while the "string" enforcing would actually help users as you can see in #2157. |
if people put in an array an error occurs, as it happend in the referenced ticket. if you want to catch it near the |
The same thing happen for the type of the Here is the typings that are not compatible from Symfony 4.4 to 5.0: And I'm not enjoying to level down the hints which make error messages clean with no extra code. |
Symfony 4.4 will be supported in Carbon 3.0. I won't guarantee the continuity of the support for the whole lifetime of Carbon 3. But for now as only the |
Next major version of Carbon will drop Symfony < 5 (and so PHP < 7.2.5) and so old Translator interface in favour of the new Contracts namespace.
The text was updated successfully, but these errors were encountered: