Skip to content

Commit a195eb7

Browse files
authored
perf: force Intl polyfill (#2387)
1 parent b5d6bb3 commit a195eb7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

shim.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,23 @@ install();
77
require('./src/polyfills/textdecoder-polyfill');
88

99
// RN still doesn't support full spec of Intl API
10+
// Don't remove -force from these because detection is VERY slow on low-end Android.
11+
// https://github.com/formatjs/formatjs/issues/4463#issuecomment-2176070577
1012
if (!Intl.Locale) {
11-
require('@formatjs/intl-locale/polyfill');
13+
require('@formatjs/intl-locale/polyfill-force');
1214
}
1315
if (!NumberFormat.formatToParts) {
14-
require('@formatjs/intl-numberformat/polyfill');
16+
require('@formatjs/intl-numberformat/polyfill-force');
1517
require('@formatjs/intl-numberformat/locale-data/en');
1618
require('@formatjs/intl-numberformat/locale-data/ru');
1719
}
1820
if (!Intl.PluralRules) {
19-
require('@formatjs/intl-pluralrules/polyfill');
21+
require('@formatjs/intl-pluralrules/polyfill-force');
2022
require('@formatjs/intl-pluralrules/locale-data/en');
2123
require('@formatjs/intl-pluralrules/locale-data/ru');
2224
}
2325
if (!Intl.RelativeTimeFormat) {
24-
require('@formatjs/intl-relativetimeformat/polyfill');
26+
require('@formatjs/intl-relativetimeformat/polyfill-force');
2527
require('@formatjs/intl-relativetimeformat/locale-data/en');
2628
require('@formatjs/intl-relativetimeformat/locale-data/ru');
2729
}

0 commit comments

Comments
 (0)