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
[HOLD for payment 2024-04-05] [HOLD for payment 2024-03-26] [Performance] Use Intl API from Hermes where possible #38447
Coming from Slack cc @hurali97 please comment so I can assign you
### Problem
We have Intl polyfills in the codebase to provide for the missing JS APIs. While that’s not a bad thing, we can take advantage of Hermes supported Intl APIs and avoid polyfilling them. If we don’t do it, we add ~500 ms to the App Startup time on android on a heavy account.
Solution
Hermes has a list of Intl supported APIs and we can take advantage of them. On native platforms, we can remove the Intl APIs that are supported by Hermes and only polyfill the ones that are currently not supported/ worked on by Hermes.
We can safely remove the following polyfills from localize/index.native.ts:
@formatjs/intl-getcanonicallocales/polyfill
@formatjs/intl-datetimeformat
@formatjs/intl-numberformat
@formatjs/intl-pluralrules/polyfill
Below is how things will look like after the removal:
import polyfillListFormat from './polyfillListFormat';
import type IntlPolyfill from './types';
/**
* Polyfill the Intl API, always performed for native devices.
*/
const intlPolyfill: IntlPolyfill = () => {
// Native devices require extra polyfills which are
// not yet implemented in hermes.
// see support: https://hermesengine.dev/docs/intl/
require('@formatjs/intl-locale/polyfill');
polyfillListFormat();
};
export default intlPolyfill;
With this, we only polyfill the APIs that are not supported/ worked on by hermes. Doing so, we save ~500 ms in the App Startup. Before and After Hermes trace screenshots are attached in the PR description.
Here’s the PR with the implementation.
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.54-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@rlinoz] The PR that introduced the bug has been identified. Link to the PR:
[@rlinoz] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@rlinoz] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@rlinoz] Determine if we should create a regression test for this bug.
[@rlinoz] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@abekkala] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
changed the title [-][HOLD for payment 2024-03-26] [Performance] Use Intl API from Hermes where possible[/-][+][HOLD for payment 2024-04-05] [HOLD for payment 2024-03-26] [Performance] Use Intl API from Hermes where possible[/+]on Mar 29, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.57-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@rlinoz] The PR that introduced the bug has been identified. Link to the PR:
[@rlinoz] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@rlinoz] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@rlinoz] Determine if we should create a regression test for this bug.
[@rlinoz] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@slafortune / @abekkala] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Activity
melvin-bot commentedon Mar 16, 2024
Triggered auto assignment to @abekkala (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Mar 18, 2024
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
2 remaining items
melvin-bot commentedon Mar 19, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 19, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.54-4 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 2024-03-26. 🎊
melvin-bot commentedon Mar 19, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
abekkala commentedon Mar 20, 2024
PAYMENT SUMMARY FOR MAR 26
@rlinoz do you think this one needs a regression test? otherwise, I can close this one out on Mar 26 after the PR regression period ends.
rlinoz commentedon Mar 20, 2024
This got reverted actually, so let's keep it open.
But I don't think it needs a regression test
abekkala commentedon Mar 22, 2024
PAYMENT SUMMARY FOR MAR 26
No regression test needed - this can be closed on Mar 26 after waiting period has ended
slafortune commentedon Mar 26, 2024
Just taking the action here - @abekkala has it all summarized 👍
[-][HOLD for payment 2024-03-26] [Performance] Use Intl API from Hermes where possible[/-][+][HOLD for payment 2024-04-05] [HOLD for payment 2024-03-26] [Performance] Use Intl API from Hermes where possible[/+]melvin-bot commentedon Mar 29, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.57-5 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 2024-04-05. 🎊
melvin-bot commentedon Mar 29, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed: