Repository navigation
[No QA] [TS migration] Migrate 'ActiveClientManager' lib to TypeScript - #27792
Conversation
| * @returns {Promise} | ||
| */ | ||
| function isReady() { | ||
| function isReady(): Promise<void> { |
There was a problem hiding this comment.
It is one line function and TS sets type implicitly.
| function isReady(): Promise<void> { | |
| function isReady() { |
| */ | ||
| function isClientTheLeader() { | ||
| return _.last(activeClients) === clientID; | ||
| function isClientTheLeader(): boolean { |
There was a problem hiding this comment.
This case is up to you, however TS sets here automatically as well.
| function isClientTheLeader(): boolean { | |
| function isClientTheLeader() { |
There was a problem hiding this comment.
@rezkiy37 We should leave return types explicit for most cases, unless the function is like one-line and the return type is void.
| import * as Report from './libs/actions/Report'; | ||
| import BootSplash from './libs/BootSplash'; | ||
| import * as ActiveClientManager from './libs/ActiveClientManager'; | ||
| import ActiveClientManager from './libs/ActiveClientManager'; |
There was a problem hiding this comment.
I would prefer to leave the imports the old way and keep the PR more focused to just convert the files to TS.
| */ | ||
| function isClientTheLeader() { | ||
| return _.last(activeClients) === clientID; | ||
| function isClientTheLeader(): boolean { |
There was a problem hiding this comment.
@rezkiy37 We should leave return types explicit for most cases, unless the function is like one-line and the return type is void.
| @@ -0,0 +1,7 @@ | |||
| type ActiveClientManagerModule = { | |||
There was a problem hiding this comment.
Expanding more on my first comment about not changing the exports, you can create separate types for each function and use it in the files.
type Init = () => void;
type IsClientTheLeader = () => boolean;
...|
@0xmiroslav 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] |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #24880 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
@0xmiroslav are you able to handle the reviewer checklist? |
|
C+ doesn't take responsible for checklist on TS migration PRs for now. |
blazejkustra
left a comment
There was a problem hiding this comment.
LGTM, SWM still need to do the checklist.
|
Reviewing... |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromechrome.movMobile Web - Safarisafari.movDesktopdesktop.moviOSios.movAndroidandroid.mov |
|
@VickyStash I was testing your PR on web and I can't request money. It freezes my browser or starts looping and crashing. Can you check it on your side, please? Maybe it's not connected to this PR, try merging with the latest main bug.mov |
|
@Skalakid I was able to reproduce the issue, but after I merged the main it seems to be resolved, so it's not related to this PR |
|
Whoops, this PR fell off my radar. Just re-ran the checks. But otherwise, I assume we are good to go? |
|
@MariaHCD I've merged the main, and checks have passed, looks okay |
|
✋ 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/MariaHCD in version: 1.3.79-0 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.79-5 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.79-5 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.79-5 🚀
|
Details
Fixed Issues
$ #24880
PROPOSAL: N/A
Tests
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)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Web
Web.mov
Mobile Web - Chrome
android.google.browser.mov
Mobile Web - Safari
ios.safari.mov
Desktop
Desktop.mov
iOS
ios.mov
Android
android.mp4