Skip to content
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

[PAID] [$250] Migrate index.js to function component #16141

Closed
1 task
marcaaron opened this issue Mar 20, 2023 · 26 comments
Closed
1 task

[PAID] [$250] Migrate index.js to function component #16141

marcaaron opened this issue Mar 20, 2023 · 26 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Improvement Item broken or needs improvement.

Comments

@marcaaron
Copy link
Contributor

Class Component Migration

Filenames

Task

  • We currently have some class components in our codebase that we would like to refactor to a function component.
  • Here's a link with some general advice on how to refactor a class component to a function component: https://react.dev/reference/react/Component#alternatives
  • If you need additional guidance, please ask in #expensify-open-source
  • Test for any regressions and verify that there are no breaking changes
@marcaaron marcaaron added Engineering Improvement Item broken or needs improvement. labels Mar 20, 2023
@melvin-bot melvin-bot bot locked and limited conversation to collaborators Mar 20, 2023
@Expensify Expensify unlocked this conversation Mar 21, 2023
@marcaaron marcaaron changed the title [HOLD] Migrate index.js to function component [HOLD][$250] Migrate index.js to function component Apr 13, 2023
@MelvinBot
Copy link

⚠️ Could not update price automatically because there is no linked Upwork Job ID. The BZ team member will need to update the price manually in Upwork.

@muxriddinmuqimov77
Copy link

I'd like to work on this issue

@s-alves10
Copy link
Contributor

I'd love to work on this.

@srikarparsi srikarparsi self-assigned this Jun 7, 2023
@srikarparsi srikarparsi added the Weekly KSv2 label Jun 7, 2023
@melvin-bot melvin-bot bot added the Overdue label Jun 15, 2023
@melvin-bot melvin-bot bot added Reviewing Has a PR in review and removed Overdue labels Jun 16, 2023
@marcaaron marcaaron changed the title [HOLD][$250] Migrate index.js to function component [$250] Migrate index.js to function component Jun 26, 2023
@marcaaron
Copy link
Contributor Author

Taking this one off HOLD.

@gedu
Copy link
Contributor

gedu commented Jul 3, 2023

Hey, I am Edu from Callstack - an expert contributor group.

I can work on this one

@gedu
Copy link
Contributor

gedu commented Jul 3, 2023

@marcaaron I found a bug, tried to look at it on Slack but couldn't find it.

Will be an easy fix, what should I do? hold on to the migration and fix this into another PR or should I fix it here? The fix will be in another file not related to the migration file.

Screenshot 2023-07-03 at 12 11 54

@marcaaron
Copy link
Contributor Author

I see @srikarparsi is assigned to this issue. Have they handed it off to you @gedu and should we update the assignment to reflect?

I think it's really up to you and maybe relative to the complexity of this refactor? If it is a small change overall then fixing should be ok. Might want to check to ensure there are no open issues or people working on the bug in parallel. Usually with the obvious bugs people are quite fast to report them.

@gedu
Copy link
Contributor

gedu commented Jul 4, 2023

@marcaaron I just saw that was assigned a month ago, didn't notice that he was working on it already, my bad.

I wouldn't recommend refactoring this one-to-one from a class component to a functional component. There are some areas that can be improved, and we need to ensure that it doesn't have any negative impact in the future.

On the other hand, the bug fixing this issue is really easy.

@marcaaron
Copy link
Contributor Author

There are some areas that can be improved, and we need to ensure that it doesn't have any negative impact in the future.

Thanks very much, can you elaborate on the specific concern and which areas could be improved?

On the other hand, the bug fixing this issue is really easy.

Got it. I think if you have found a bug then let's separate it from the refactor for now and do a small quick PR?

@srikarparsi can you sync up with @gedu and make sure we aren't doubling efforts on this one?

@gedu
Copy link
Contributor

gedu commented Jul 4, 2023

@marcaaron Yes.

Firstly, there is an if to handle a DisplayNames with and without Tooltip, I would split it into 2 components because the one without tooltip doesn't need any function, refs, or states initialization.
Secondly, the function getTooltipShiftX must be in a useCallback because deeper in the component UserDetailsTooltip it uses an useMemo so we need that function to be stable. In addition, that function is being called using a lambda function shiftHorizontal={() => getTooltipShiftX(index)}, so we must not use the lambda function and make it stable too.
Lastly, but optional, I would separate into files the different DisplayNames with/without tooltip, just to make the code more readable and avoid having all the logic in the index.js file.

Cool, I could post this bug into the expensify-bugs channel

@srikarparsi
Copy link
Contributor

Hi @gedu! Sorry for the late response, I was out of office yesterday and most of the day before for July 4th. I worked on the issue a while back and put up a draft PR but didn't get around to finishing it. I can make changes to my draft PR based on your comment. Would you be willing to review my changes?

@gedu
Copy link
Contributor

gedu commented Jul 5, 2023

Hey, @srikarparsi, no problem, I can review the PR

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Jul 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 28, 2023

This issue has not been updated in over 15 days. @srikarparsi eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@srikarparsi srikarparsi added Weekly KSv2 and removed Monthly KSv2 labels Aug 3, 2023
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

This issue has not been updated in over 15 days. @srikarparsi eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@aimane-chnaif
Copy link
Contributor

@srikarparsi can you please add Bug label for payment?

@aimane-chnaif
Copy link
Contributor

@srikarparsi can you please add Bug label for payment?

bump ^

@melvin-bot melvin-bot bot closed this as completed Oct 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 24, 2023

@srikarparsi, this Monthly task hasn't been acted upon in 6 weeks; closing.

If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.

@aimane-chnaif
Copy link
Contributor

@marcaaron can you please add Bug label for payment? Thanks

@marcaaron marcaaron added the Bug Something is broken. Auto assigns a BugZero manager. label Nov 2, 2023
@marcaaron marcaaron reopened this Nov 2, 2023
Copy link

melvin-bot bot commented Nov 2, 2023

Triggered auto assignment to @strepanier03 (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Daily KSv2 label Nov 2, 2023

This comment was marked as resolved.

@melvin-bot melvin-bot bot removed the Monthly KSv2 label Nov 2, 2023
@marcaaron marcaaron removed Not a priority Reviewing Has a PR in review labels Nov 2, 2023
@strepanier03
Copy link
Contributor

Looking at this for payment.

Am I correct in assuming this is $250 payment to both @srikarparsi and @aimane-chnaif?

@marcaaron? Do you have any context into the payment here? Once I know final amounts and who to pay I can make an Upwork job and hire/pay out.

@strepanier03 strepanier03 changed the title [$250] Migrate index.js to function component [Waiting for payment] [$250] Migrate index.js to function component Nov 6, 2023
@aimane-chnaif
Copy link
Contributor

@srikarparsi is engineer 😄
I am only the one for upwork payment

@strepanier03
Copy link
Contributor

Hahaha you're right @aimane-chnaif, what a Monday yesterday was 😂.

I'll make the job and hire you to it shortly.

@strepanier03
Copy link
Contributor

All right, well I'll try again in a bit to make a job. Upwork is giving me errors no matter how I try to create a job right now. :(

@strepanier03
Copy link
Contributor

@aimane-chnaif - I finally got that job created and hired you to it, sorry for the delay on it, sometimes Upwork is frustrating to use.

I'll check it later today to pay.

@strepanier03
Copy link
Contributor

I've paid this, closed the contract, and submitted the form for the contact list. This is all set now and I'll close it out.

@strepanier03 strepanier03 changed the title [Waiting for payment] [$250] Migrate index.js to function component [PAID] [$250] Migrate index.js to function component Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Improvement Item broken or needs improvement.
Projects
None yet
Development

No branches or pull requests

8 participants