You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Investigate workflow job failing: Typecheck/ESLint actions out of memory #48470
These symbols are used in withOnyx HOC, so I went ahead and prepared a script to automatically migrate most of them to use useOnyx hook instead, and run typecheck with diagnostics again:
Here is the PR where most of withOnyx are migrated, but there are still around 40 HOCs in use so 38s is not the final time! 🤟
Other things to consider
Split big files into smaller, especially these three:
├─ Check file /users/blazejkustra/documents/swmansion/expensify/swmapp/src/libs/actions/iou.ts (2134ms)
├─ Check file /users/blazejkustra/documents/swmansion/expensify/swmapp/src/libs/actions/policy/policy.ts (1161ms)
├─ Check file /users/blazejkustra/documents/swmansion/expensify/swmapp/src/libs/actions/report.ts (997ms)
intellisense, prettier, lint, ts are super slow in these files, splitting will help to decrease calculations while editing
Calculating translations is a heavy operation which creates a big union which slows down TS and ESLint
we should consider rewriting it a bit, maybe instead 'common.address' keys we should use an array key ['common', 'address'] or other approach - needs more investigation
Caching tsbuildinfo in Github actions (we already do it locally, --incremental flag)
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!
I'll be monitoring the performance of TS/ESLint once we got to a point where there are far less withOnyx in the codebase. Let's leave the issue open for now.
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!
Activity
melvin-bot commentedon Sep 3, 2024
Triggered auto assignment to @kadiealexander (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.blazejkustra commentedon Sep 3, 2024
I asked @roryabraham for assignment on #typescript-new-expensify channel, waiting for his approval for now.
melvin-bot commentedon Sep 3, 2024
Triggered auto assignment to @thienlnam, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
roryabraham commentedon Sep 4, 2024
🟢 from me (as discussed in slack) to try and figure out how to make lint and tsc faster
blazejkustra commentedon Sep 5, 2024
Coming back with some findings 🔍
TS server is quite fast in general, so any slowness is usually caused by the devs or complex libraries, common culprits are:
Currently, TS check is at around 54 seconds for me:
Baseline ~54s, ~4.5GB of memory
Investigation
That got me thinking what types are so complicated that E/App takes so long to compile... I looked at the AST tree and saw a lot of onyx symbols used:
These symbols are used in
withOnyxHOC, so I went ahead and prepared a script to automatically migrate most of them to useuseOnyxhook instead, and run typecheck with diagnostics again:~38s, ~2.8GB of memory (40% less memory used 🚀 )
Here is the PR where most of
withOnyxare migrated, but there are still around 40 HOCs in use so 38s is not the final time! 🤟Other things to consider
Split big files into smaller, especially these three:
├─ Check file /users/blazejkustra/documents/swmansion/expensify/swmapp/src/libs/actions/iou.ts (2134ms)
├─ Check file /users/blazejkustra/documents/swmansion/expensify/swmapp/src/libs/actions/policy/policy.ts (1161ms)
├─ Check file /users/blazejkustra/documents/swmansion/expensify/swmapp/src/libs/actions/report.ts (997ms)
Calculating translations is a heavy operation which creates a big union which slows down TS and ESLint

Caching
tsbuildinfoin Github actions (we already do it locally,--incrementalflag)Split the project into smaller pieces with typescript references
Other general solutions, but not worth the effort for now:
Hot spots, what files takes most time to compile - we should investigate them 👀
Command:
Hot Spots:
Materials
For anybody interested, here're some useful links:
blazejkustra commentedon Sep 5, 2024
TLDR;
withOnyxtouseOnyx.actions/IOU.ts,actions/Report.ts,actions/Policy.ts)melvin-bot commentedon Sep 30, 2024
This issue has not been updated in over 15 days. @thienlnam, @blazejkustra, @kadiealexander 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!
blazejkustra commentedon Oct 2, 2024
I'll be monitoring the performance of TS/ESLint once we got to a point where there are far less
withOnyxin the codebase. Let's leave the issue open for now.melvin-bot commentedon Oct 28, 2024
This issue has not been updated in over 15 days. @thienlnam, @blazejkustra, @kadiealexander 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!
blazejkustra commentedon Nov 4, 2024
Once there are no withOnyx left, I'll post an update to compare TS/ESlint speed
melvin-bot commentedon Jan 17, 2025
@thienlnam, @blazejkustra, @kadiealexander, 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.