Skip to content

Commit

Permalink
perf: remove intl polyfills which are supported by hermes
Browse files Browse the repository at this point in the history
  • Loading branch information
hurali97 committed Mar 13, 2024
1 parent f52bb02 commit dabcb16
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/libs/IntlPolyfill/index.native.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import polyfillDateTimeFormat from './polyfillDateTimeFormat';
import polyfillListFormat from './polyfillListFormat';
import polyfillNumberFormat from './polyfillNumberFormat';
import type IntlPolyfill from './types';

/**
* Polyfill the Intl API, always performed for native devices.
*/
const intlPolyfill: IntlPolyfill = () => {
// Native devices require extra polyfills
require('@formatjs/intl-getcanonicallocales/polyfill');
// Native devices require extra polyfills which are
// not yet implemented in hermes.
// see support: https://hermesengine.dev/docs/intl/

require('@formatjs/intl-locale/polyfill');
require('@formatjs/intl-pluralrules/polyfill');
polyfillNumberFormat();
polyfillDateTimeFormat();

polyfillListFormat();
};

Expand Down

0 comments on commit dabcb16

Please sign in to comment.