-
Notifications
You must be signed in to change notification settings - Fork 3k
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 'EmojiPickerAction.js' lib to TypeScript #26795
[TS migration] Migrate 'EmojiPickerAction.js' lib to TypeScript #26795
Conversation
We did not find an internal engineer to review this PR, trying to assign a random engineer to #24798 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
vertical: ValueOf<typeof CONST.MODAL.ANCHOR_ORIGIN_VERTICAL>; | ||
}; | ||
|
||
type EmojiPicker = { |
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.
Why are we defining the component type in this file?
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's not the component type, it's what is defined in useImperativeHandle
here. Do you think the name is misleading? @hayata-suenaga
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 mean this is component API right? the methods exposed the component through useImperativeHandle
?
I think we should define this inside the component file instead of defining this here where we store the reference to the component.
I know we haven't started migration of component files, but I think we should start thinking about where type definitions should belong and how to coordinates the migration when the type needed are not defined yet.
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 agree that EmojiPicker
type should be defined next to EmojiPicker
component. But until it's not migrated we have couple options:
- Put this PR on hold until we get to
EmojiPicker
component - Merge this now, and move the type when
EmojiPicker
component is migrated (we can add a comment on the issue to remember about this) - Define types.ts file with
EmojiPicker
type next to the component
Generally I think we won't be able to avoid such situations and sometimes we have to define types in undesirable places. At some point of the migration we will have to clean a bit, for example we'll have to clean style types or define shared types that are often used - until then we have to accept that we will repeat or litter the code sometimes.
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'm confortable with option two, and adding a TODO comment above the type as well:
Merge this now, and move the type when EmojiPicker component is migrated (we can add a comment on the issue to remember about this)
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.
We can create some cleanup and review issues for some of the categories of files (I kinda have been done this cleanup for styles
already) , e.g. styles
, models
, libs
, hooks
, hoc's
, components
and pages
I think are good candidates for these clean ups. After each migration of all issues of that category we will create a new issue to review all past work and ensure consistency. I can add these "checkpoints" on our spreadsheet, WDYT? @hayata-suenaga @blazejkustra
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.
@fabioh8010 That sounds good to me 😄 Add it to the spreadsheet please, and we will get back to this.
I don't have the capacity to manage this, so I'd appreciate if SWM and CallStack and develop a strategy to coordinate and keep track the cleanup efforts we have to do. 🙇
Sure thing @hayata-suenaga, that's on me and @fabioh8010, we will coordinate such cleanups!
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.
Let me know if issues need to be created in App 🙇
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.
@hayata-suenaga @blazejkustra I created new rows in the spreadsheet about these review issues, here are the lines:
- 57
- 261
- 277
- 295
- 486
- 550
@hayata-suenaga Could you please create the issues? Thank you!
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.
@hayata-suenaga bump
vertical: ValueOf<typeof CONST.MODAL.ANCHOR_ORIGIN_VERTICAL>; | ||
}; | ||
|
||
type EmojiPicker = { |
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'm confortable with option two, and adding a TODO comment above the type as well:
Merge this now, and move the type when EmojiPicker component is migrated (we can add a comment on the issue to remember about this)
@fabioh8010 @hayata-suenaga Ready for your review! |
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, CK still need to do the checklist.
I'll wait for the checklist to be completed before I do review 🙇 |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-09-19.at.10.28.30.movScreen.Recording.2023-09-19.at.10.28.48.movDesktopScreen.Recording.2023-09-19.at.10.33.51.movMobile Web - ChromeScreen.Recording.2023-09-19.at.10.30.14.movAndroidScreen.Recording.2023-09-19.at.10.30.59.movMobile Web - SafariScreen.Recording.2023-09-19.at.10.32.47.moviOSScreen.Recording.2023-09-19.at.10.33.14.mov |
@hayata-suenaga Kind bump 😄 |
✋ 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/hayata-suenaga in version: 1.3.75-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.75-12 🚀
|
🚀 Deployed to staging by https://github.com/hayata-suenaga in version: 1.3.76-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.76-6 🚀
|
Details
Migration of
EmojiPickerAction.js
to Typescript.Fixed Issues
$ #24798
PROPOSAL: N/A
Tests
EmojiPicker
is working correctlyOffline tests
N/A
QA Steps
N/A
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-web.mov
Mobile Web - Safari
ios-web.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov