Repository navigation
[NoQA] Enable prefer-locale-compare-from-context ESLint rule - #71070
roryabraham merged 3 commits into
Conversation
6374f9d to
bb79eac
Compare
|
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@shubham1206agra 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] |
Reviewer Checklist
|
|
@andriivitiv you've got conflicts to resolve here |
…ale-compare-from-context
|
@roryabraham conflicts resolved |
|
@roryabraham not sure why that workflow failed. Can you please re-run it? |
|
Fix for that workflow is here: #71395 |
|
Merging since |
|
@roryabraham looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
✋ 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/roryabraham in version: 9.2.19-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.2.19-3 🚀
|
Explanation of Change
When we use
someString.localeCompare(...), we implicitly create a new Intl.Collator object, which incurs significant performance overhead. This PR enablesprefer-locale-compare-from-contextESLint rule to enforce the use of localeCompare from E/App's LocaleContextProvider, where a single Intl.Collator object is created once and reduced between localeCompare calls, with much less overhead.Fixed Issues
$ #67426
PROPOSAL: #67426 (comment)
Tests
Verify that
localeComparefromuseLocalizehas the same behavior asstring.localeCompare.Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.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 and/or tagged@Expensify/designso 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
I used this code to verify that the old and new behaviour is the same in places where changes were made:
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop