Skip to content

Commit

Permalink
Merge pull request Expensify#47071 from callstack-internal/perf/use-p…
Browse files Browse the repository at this point in the history
…olyfill-force

perf: use force while importing polyfill to avoid calling shouldPolyfill which adds overhead
  • Loading branch information
Beamanator authored Aug 13, 2024
2 parents 21c7d65 + 426390a commit cda0e73
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/libs/IntlPolyfill/index.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const intlPolyfill: IntlPolyfill = () => {
// not yet implemented in hermes.
// see support: https://hermesengine.dev/docs/intl/

require('@formatjs/intl-locale/polyfill');
require('@formatjs/intl-locale/polyfill-force');

polyfillListFormat();
};
Expand Down
4 changes: 2 additions & 2 deletions src/libs/IntlPolyfill/index.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const intlPolyfill: IntlPolyfill = () => {
// not yet implemented in hermes.
// see support: https://hermesengine.dev/docs/intl/

require('@formatjs/intl-locale/polyfill');
require('@formatjs/intl-locale/polyfill-force');

// Required to polyfill NumberFormat on iOS
// see: https://github.com/facebook/hermes/issues/1172#issuecomment-1776156538
require('@formatjs/intl-pluralrules/polyfill');
require('@formatjs/intl-pluralrules/polyfill-force');
polyfillNumberFormat();

// Required to polyfill DateTimeFormat on iOS
Expand Down
2 changes: 1 addition & 1 deletion src/libs/IntlPolyfill/polyfillDateTimeFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function () {
currentTimezone = timezoneBackwardMap[currentTimezone];
}

require('@formatjs/intl-datetimeformat/polyfill');
require('@formatjs/intl-datetimeformat/polyfill-force');
require('@formatjs/intl-datetimeformat/locale-data/en');
require('@formatjs/intl-datetimeformat/locale-data/es');
require('@formatjs/intl-datetimeformat/add-all-tz');
Expand Down

0 comments on commit cda0e73

Please sign in to comment.