-
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
[No QA] [TS migration] Migrate 'ActiveClientManager' lib to TypeScript #27792
[No QA] [TS migration] Migrate 'ActiveClientManager' lib to TypeScript #27792
Conversation
*/ | ||
function isReady() { | ||
function isReady(): Promise<void> { |
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.
It is one line function and TS sets type implicitly.
function isReady(): Promise<void> { | |
function isReady() { |
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.
LGTM, left a comment.
*/ | ||
function isClientTheLeader() { | ||
return _.last(activeClients) === clientID; | ||
function isClientTheLeader(): boolean { |
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 case is up to you, however TS sets here automatically as well.
function isClientTheLeader(): boolean { | |
function isClientTheLeader() { |
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.
@rezkiy37 We should leave return types explicit for most cases, unless the function is like one-line and the return type is void
.
src/Expensify.js
Outdated
@@ -6,7 +6,7 @@ import {AppState, Linking} from 'react-native'; | |||
import Onyx, {withOnyx} from 'react-native-onyx'; | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! |
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.
LGTM
@0xmiroslav are you able to handle the reviewer checklist? |
C+ doesn't take responsible for checklist on TS migration PRs for now. |
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.
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 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)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
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