From 359802a9c366dae645c5b1079fd1e63c9264bee4 Mon Sep 17 00:00:00 2001 From: Philipp Walter Date: Fri, 6 Dec 2024 09:41:43 +0100 Subject: [PATCH] perf: force Intl polyfill --- shim.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/shim.js b/shim.js index 0d3b548a7..b1c11ceb1 100644 --- a/shim.js +++ b/shim.js @@ -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'); }