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

[HOLD for payment 2023-10-30] Optimize React Context usages in New Expensify #28177

Closed
muttmuure opened this issue Sep 25, 2023 · 4 comments
Closed
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2

Comments

@muttmuure
Copy link
Contributor

Coming from: https://expensify.slack.com/archives/C05LX9D6E07/p1695377829998599

Problem:

Poorly implemented React Context will lead to unnecessary re-renders of Context.Consumers.

Solution:

Making sure that each time React Context is used, the value passed to Context.Provider will be properly memoized. Apart from fixing problem in existing files it would be nice to share the knowledge to developers (and reviewers) to pay attention to this problem.

Go through this list and optimize these context usages:

  1. src/components/ScrollViewWithContext.js
  2. src/components/AnimatedStep/AnimatedStepProvider.js
  3. src/components/Attachments/AttachmentCarousel/Pager/index.js
  4. src/components/DragAndDrop/Provider/index.js
  5. src/components/PopoverProvider/index.js + index.native.js
  6. src/components/withWindowDimensions/index.js + .native.js
  7. src/pages/home/ReportScreen.js
  8. src/pages/home/report/ReportActionItem.js
  9. src/pages/settings/Security/TwoFactorAuth/TwoFactorAuthSteps.js
@melvin-bot melvin-bot bot added the Monthly KSv2 label Sep 29, 2023
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Monthly KSv2 labels Oct 10, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 23, 2023
@melvin-bot melvin-bot bot changed the title Optimize React Context usages in New Expensify [HOLD for payment 2023-10-30] Optimize React Context usages in New Expensify Oct 23, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.88-11 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-10-30. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

  • @burczu does not require payment (Contractor)

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@mountiny mountiny moved this to MEDIUM in [#whatsnext] #quality Oct 24, 2023
@mountiny mountiny moved this from MEDIUM to Done in [#whatsnext] #quality Oct 24, 2023
@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 29, 2023
Copy link

melvin-bot bot commented Nov 1, 2023

@burczu, @mountiny Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@mountiny
Copy link
Contributor

mountiny commented Nov 2, 2023

all done here

@mountiny mountiny closed this as completed Nov 2, 2023
@melvin-bot melvin-bot bot removed the Overdue label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2
Projects
Status: Done
Development

No branches or pull requests

3 participants