Skip to content

[Payment Due August 22, 2024] [Performance] Use polyfill-force to speed up formatjs #47305

Description

@mountiny

Coming from Slack

Proposal: Use polyfill-force to skip the lookup in formatjs which checks whether the platform needs polyfilling

Problem

formatjs checks whether the platform needs polyfilling for the respective polyfilling API. This appears redundant because we mean to have those APIs polyfilled, so we can skip the function shouldPolyfill . Doing so, results in the reduced app startup because we are skipping the lookup function shouldPolyfill.

Solution

We are already using polyfill-force for some polyfills but not for all of them. So we just have to add it to others, for eg, require('@formatjs/intl-locale/polyfill-force');

  • On iOS, we save around ~70ms on App startup.
  • On Android, we save around ~15ms on App startup.

The PR with the changes is here .

Issue OwnerCurrent Issue Owner: @anmurali

Metadata

Metadata

Labels

AutoAssignerNewDotQualityUsed to assign quality issues to engineersAwaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions