-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Audit][Implementation] Replace localeCompare with static Collator implementation #36941
[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 |
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.
Changes looks good to me. We have confirmed that the methods are behaving the same and added tests in this PR #36879
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
localeCompare
improvements: #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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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