-
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
[TS migration] Migrate 'Report.js' lib to TypeScript #28730
[TS migration] Migrate 'Report.js' lib to TypeScript #28730
Conversation
@allroundexperts @ One of you needs to 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] |
@allroundexperts I resolved the conflicts and merged the newest main 👌 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2023-12-11.at.5.59.59.AM.movAndroid: mWeb ChromeScreen.Recording.2023-12-11.at.5.53.36.AM.moviOS: NativeScreen.Recording.2023-12-11.at.5.51.57.AM.moviOS: mWeb SafariScreen.Recording.2023-12-11.at.5.50.30.AM.movMacOS: Chrome / SafariScreen.Recording.2023-12-11.at.5.45.16.AM.movMacOS: DesktopScreen.Recording.2023-12-11.at.5.49.05.AM.mov |
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.
Testing well. Approving it since I don't want to block the merge as this gets conflicts fast.
We did not find an internal engineer to review this PR, trying to assign a random engineer to #24931 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
@blazejkustra we have typecheck errors now. |
Yep, I'm on it! |
@NikkiWines all yours! Tagging you as this PR gets conflicts pretty fast 😅 |
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.
Couple NABs but nothing worth holding the PR over. Looks good overall!
: Object.keys(report).reduce<Record<string, null>>((acc, key) => { | ||
acc[key] = null; | ||
return acc; |
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.
NAB: We prefer non-abbreviated variable names so account
would be better here.
const failureData: OnyxUpdate[] = [ | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
key: `${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportID}`, | ||
value: { | ||
isLoadingInitialReportActions: false, | ||
}, | ||
}, | ||
]; |
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.
NAB: Since failureData
is the same as successData
here, we could probably de-dupe this and just use one object called finallyData
for such cases (there are a few instances in this file).
I don't think we have any style guidelines about this though, so not a blocker.
if (typingStatus.userLogin) { | ||
normalizedStatus = {[typingStatus.userLogin]: true}; | ||
} else { | ||
normalizedStatus = typingStatus; |
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.
NAB: This could be a ternary
Onyx.connect({ | ||
key: ONYXKEYS.SESSION, | ||
callback: (val) => { | ||
callback: (value) => { |
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.
Nice, thanks for updating all these variable names 🙌
@@ -76,6 +76,8 @@ type PersonalDetails = { | |||
payPalMeAddress?: string; | |||
}; | |||
|
|||
type PersonalDetailsList = Record<string, PersonalDetails>; | |||
|
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.
NAB: Extra blank line
✋ 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/NikkiWines in version: 1.4.12-0 🚀
|
🚀 Deployed to staging by https://github.com/NikkiWines in version: 1.4.12-0 🚀
|
🚀 Deployed to staging by https://github.com/NikkiWines in version: 1.4.12-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.12-2 🚀
|
Details
Migration of
Report.js
to Typescript.Fixed Issues
$ #24931
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Same as tests
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
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
a-web.2.webm
Mobile Web - Safari
i-web.mp4
Desktop
desktop.mov
iOS
ios.mp4
Android
android.webm