Skip to content

Commit

Permalink
perf: force Intl polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
pwltr committed Dec 6, 2024
1 parent b5d6bb3 commit 359802a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ install();
require('./src/polyfills/textdecoder-polyfill');

// RN still doesn't support full spec of Intl API
// Don't remove -force from these because detection is VERY slow on low-end Android.
// https://github.com/formatjs/formatjs/issues/4463#issuecomment-2176070577
if (!Intl.Locale) {
require('@formatjs/intl-locale/polyfill');
require('@formatjs/intl-locale/polyfill-force');
}
if (!NumberFormat.formatToParts) {
require('@formatjs/intl-numberformat/polyfill');
require('@formatjs/intl-numberformat/polyfill-force');
require('@formatjs/intl-numberformat/locale-data/en');
require('@formatjs/intl-numberformat/locale-data/ru');
}
if (!Intl.PluralRules) {
require('@formatjs/intl-pluralrules/polyfill');
require('@formatjs/intl-pluralrules/polyfill-force');
require('@formatjs/intl-pluralrules/locale-data/en');
require('@formatjs/intl-pluralrules/locale-data/ru');
}
if (!Intl.RelativeTimeFormat) {
require('@formatjs/intl-relativetimeformat/polyfill');
require('@formatjs/intl-relativetimeformat/polyfill-force');
require('@formatjs/intl-relativetimeformat/locale-data/en');
require('@formatjs/intl-relativetimeformat/locale-data/ru');
}
Expand Down

0 comments on commit 359802a

Please sign in to comment.