Bluesky app fork with some witchin' additions 💫

Unconditionally polyfill Intl.PluralRules for native (#4554)

* Revert "Fix Android startup perf regression (#4544)"

This reverts commit e6213d7aa56faa6994a27bf127c63ded69e67d6f.

* Force polyfill

authored by danabra.mov and committed by

GitHub 08cfb095 f142339e

+1 -60
-1
.eslintrc.js
··· 33 33 ], 34 34 'bsky-internal/use-exact-imports': 'error', 35 35 'bsky-internal/use-typed-gates': 'error', 36 - 'bsky-internal/keep-i18n-patch-in-sync': 'error', 37 36 'simple-import-sort/imports': [ 38 37 'warn', 39 38 {
-1
eslint/index.js
··· 2 2 3 3 module.exports = { 4 4 rules: { 5 - 'keep-i18n-patch-in-sync': require('./keep-i18n-patch-in-sync'), 6 5 'avoid-unwrapped-text': require('./avoid-unwrapped-text'), 7 6 'use-exact-imports': require('./use-exact-imports'), 8 7 'use-typed-gates': require('./use-typed-gates'),
-28
eslint/keep-i18n-patch-in-sync.js
··· 1 - /* eslint-disable bsky-internal/keep-i18n-patch-in-sync */ 2 - const LOCALE_DATA_FOLDER = '@formatjs/intl-pluralrules/locale-data/' 3 - const GEN_MODULE_PATH = 4 - '@formatjs/intl-pluralrules/supported-locales.generated.js' 5 - 6 - exports.create = function create(context) { 7 - delete require.cache[require.resolve(GEN_MODULE_PATH)] 8 - const {supportedLocales} = require(GEN_MODULE_PATH) 9 - return { 10 - Literal(node) { 11 - if (typeof node.value !== 'string') { 12 - return 13 - } 14 - if (!node.value.startsWith(LOCALE_DATA_FOLDER)) { 15 - return 16 - } 17 - const code = node.value.slice(LOCALE_DATA_FOLDER.length) 18 - if (!supportedLocales.includes(code)) { 19 - context.report({ 20 - node, 21 - message: 22 - 'Edit .patches/@formatjs+intl-pluralrules+XXX.patch to include ' + 23 - code, 24 - }) 25 - } 26 - }, 27 - } 28 - }
-29
patches/@formatjs+intl-pluralrules+5.2.10.patch
··· 1 - diff --git a/node_modules/@formatjs/intl-pluralrules/supported-locales.generated.js b/node_modules/@formatjs/intl-pluralrules/supported-locales.generated.js 2 - index 5e0692b..d11157a 100644 3 - --- a/node_modules/@formatjs/intl-pluralrules/supported-locales.generated.js 4 - +++ b/node_modules/@formatjs/intl-pluralrules/supported-locales.generated.js 5 - @@ -2,3 +2,24 @@ 6 - Object.defineProperty(exports, "__esModule", { value: true }); 7 - exports.supportedLocales = void 0; 8 - exports.supportedLocales = ["af", "ak", "am", "an", "ar", "ars", "as", "asa", "ast", "az", "bal", "be", "bem", "bez", "bg", "bho", "bm", "bn", "bo", "br", "brx", "bs", "ca", "ce", "ceb", "cgg", "chr", "ckb", "cs", "cy", "da", "de", "doi", "dsb", "dv", "dz", "ee", "el", "en", "eo", "es", "et", "eu", "fa", "ff", "fi", "fil", "fo", "fr", "fur", "fy", "ga", "gd", "gl", "gsw", "gu", "guw", "gv", "ha", "haw", "he", "hi", "hnj", "hr", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "io", "is", "it", "iu", "ja", "jbo", "jgo", "jmc", "jv", "jw", "ka", "kab", "kaj", "kcg", "kde", "kea", "kk", "kkj", "kl", "km", "kn", "ko", "ks", "ksb", "ksh", "ku", "kw", "ky", "lag", "lb", "lg", "lij", "lkt", "ln", "lo", "lt", "lv", "mas", "mg", "mgo", "mk", "ml", "mn", "mo", "mr", "ms", "mt", "my", "nah", "naq", "nb", "nd", "ne", "nl", "nn", "nnh", "no", "nqo", "nr", "nso", "ny", "nyn", "om", "or", "os", "osa", "pa", "pap", "pcm", "pl", "prg", "ps", "pt", "pt-PT", "rm", "ro", "rof", "ru", "rwk", "sah", "saq", "sat", "sc", "scn", "sd", "sdh", "se", "seh", "ses", "sg", "sh", "shi", "si", "sk", "sl", "sma", "smi", "smj", "smn", "sms", "sn", "so", "sq", "sr", "ss", "ssy", "st", "su", "sv", "sw", "syr", "ta", "te", "teo", "th", "ti", "tig", "tk", "tl", "tn", "to", "tpi", "tr", "ts", "tzm", "ug", "uk", "und", "ur", "uz", "ve", "vi", "vo", "vun", "wa", "wae", "wo", "xh", "xog", "yi", "yo", "yue", "zh", "zu"]; 9 - + 10 - +// PATCHED FOR ANDROID PERF. KEEP IN SYNC WITH i18n.ts -dan 11 - +exports.supportedLocales = [ 12 - + 'ca', 13 - + 'de', 14 - + 'en', 15 - + 'es', 16 - + 'fi', 17 - + 'fr', 18 - + 'ga', 19 - + 'hi', 20 - + 'id', 21 - + 'it', 22 - + 'ja', 23 - + 'ko', 24 - + 'pt', 25 - + 'tr', 26 - + 'uk', 27 - + 'zh' 28 - +]; 29 - +
+1 -1
src/locale/i18n.ts
··· 1 1 import '@formatjs/intl-locale/polyfill' 2 - import '@formatjs/intl-pluralrules/polyfill' 2 + import '@formatjs/intl-pluralrules/polyfill-force' // Don't remove -force because detection is very slow 3 3 import '@formatjs/intl-pluralrules/locale-data/en' 4 4 5 5 import {useEffect} from 'react'