Repository navigation
[Audit][Implementation] Replace localeCompare with static Collator implementation - #36941
Conversation
|
@mountiny here is a PR that contains replacement of all |
|
@kacper-mikolajczak could you dig around if there is some comparison already made online? these two seems like commonly used options so I assume there might be someone who already compared them. |
|
Based on MDN reference for
Also, the docs suggests to use the solution introduced in original PR:
With general compatibility provided by internal APIs, we should focus on ensuring that our custom usage is tested and works as expected. Thus the tests that are checking if we provide (and update to) correct locale are the ones we are looking for. From the external usage standpoint, it is good to have anti-regression tests that ensures the API (in this case arguments and returning values of the function) are aligned with internal API. Additionally, I am posting a few sites that compare
Let me know if that answers your concerns, @mountiny 👍 |
|
For now, we spawn new collator for different locales, but the options stay static: const COLLATOR_OPTIONS: Intl.CollatorOptions = {usage: 'sort', sensitivity: 'base'};What might be worth to consider, is to let developers customise the options as well. Pros:
Cons:
It is not must-have thing, but can be discussed as an extension for future 👍 |
|
@kacper-mikolajczak thank you very much, I think this addressed my concerns! I think we dont have to do much more in this case given the Intl.Collator is used under the hood
I agree we dont have to worry about this now |
|
Great! In that case I am filling out the PR requirements 👍 |
|
@techievivek Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@mountiny PR ready to be reviewed 👍 |
|
Hi @techievivek 👋 Is there any way I can help you with the review? |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
I will go ahead with the merge as Vivek wont be online today I think |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.44-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.44-13 🚀
|
Details
This is a follow-up PR to original
localeCompareimprovements: #36592 (comment)Fixed Issues
$ #36592 (comment)
PROPOSAL: #35234 (comment)
Tests
In the recordings section, videos posted shows a few user behaviours to check if app works correctly
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
mandroid.mp4
iOS: Native
iOS: mWeb Safari
mios.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4