-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Extract the EmojiTransliterator
to a dedicated package
#49947
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
Conversation
"symfony/http-client": "^5.4|^6.0", | ||
"symfony/translation-contracts": "^2.5|^3.0", | ||
"symfony/var-exporter": "^5.4|^6.0" | ||
}, | ||
"conflict": { | ||
"symfony/intl": "6.2.*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This conflict is part of the BC layer. An existing project using $slugger->withEmoji(true)
will have symfony/string: ^6.2, symfony/intl: ^6.2
as requirement. If we were upgrading to symfony/string 6.3 while keeping symfony/intl 6.2.x, we would not be able to use EmojiTransliterator as symfony/string 6.3 uses the new class from symfony/emoji-transliterator. If symfony/intl is also updated to 6.3, the BC requirement on symfony/emoji-transliterator in symfony/intl will make sure that the code keeps working (for 7.0, you will need to depend on symfony/emoji-transliterator
though)
$this->assertNotEmpty($tr->transliterate('😀')); | ||
} | ||
|
||
public static function provideLocaleTest(): iterable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intentionally kept most tests as legacy tests, to ensure that the BC layer works fine (and I added the assertion about actually instantiating the requested class as my first version of the BC layer was broken in that regard, which could break type checks for existing code using the old class as type). I only removed this test because it relied on the data to find all supported locales, and the data is gone from this component. This is still tested in the new component.
Thanks 👍🏼 |
8f9ab87
to
df5ac55
Compare
df5ac55
to
88757ed
Compare
@fabpot fabbot needs to be updated to exclude the Regarding other CI failures:
|
Due to the size of the data needed to transliterate emojis, using a dedicated package allows to include the package in the project only when needed. In Symfony 6.x, the symfony/intl component depends on this component for BC reasons. Root projects can implement a replace hack in their composer.json to skip this package if they don't need it. This dependency will be removed in Symfony 7.0.
88757ed
to
1a44940
Compare
src/Symfony/Component/EmojiTransliterator/Tests/EmojiTransliteratorTest.php
Show resolved
Hide resolved
EmojiTransliterator
to a dedicated package
This PR was merged into the 6.2 branch. Discussion ---------- [Intl] Improve the description of the Intl component | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a As of Symfony 6.0, the symfony/intl component does provide a replacement for ext-intl (that code was moved to symfony/polyfill instead). Now, this component is _only_ about exposing the ICU data (note that I intentionally avoid mentioning the EmojiTransliterator that expands a bit that scope in 6.2 because of #49947) Commits ------- 7d1e3c5 Improve the description of the Intl component
@@ -24,12 +24,13 @@ | |||
}, | |||
"require-dev": { | |||
"symfony/error-handler": "^5.4|^6.0", | |||
"symfony/intl": "^6.2", | |||
"symfony/emoji-transliterator": "^6.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe put the emoji-transliterator
in composer's suggest
section and explain its use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We stopped using the suggest section IIRC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed
Closing in favor of #49970, as discussed there. Thanks for the PR! |
Due to the size of the data needed to transliterate emojis, using a dedicated package allows to include the package in the project only when needed.
In Symfony 6.x, the symfony/intl component depends on this component for BC reasons. Root projects can implement a replace hack in their composer.json to skip this package if they don't need it. This dependency will be removed in Symfony 7.0.