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 Owner
Current Issue Owner: @anmurali
Coming from Slack
Proposal: Use polyfill-force to skip the lookup in formatjs which checks whether the platform needs polyfilling
Problem
formatjschecks 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 functionshouldPolyfill. Doing so, results in the reduced app startup because we are skipping the lookup functionshouldPolyfill.Solution
We are already using
polyfill-forcefor 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');The PR with the changes is here .
Issue Owner
Current Issue Owner: @anmurali