diff --git a/.eslintrc.js b/.eslintrc.js index 8915c501..9d2b7bbb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -33,7 +33,6 @@ module.exports = { ], 'bsky-internal/use-exact-imports': 'error', 'bsky-internal/use-typed-gates': 'error', - 'bsky-internal/keep-i18n-patch-in-sync': 'error', 'simple-import-sort/imports': [ 'warn', { diff --git a/eslint/index.js b/eslint/index.js index cb6291d7..cf5d4122 100644 --- a/eslint/index.js +++ b/eslint/index.js @@ -2,7 +2,6 @@ module.exports = { rules: { - 'keep-i18n-patch-in-sync': require('./keep-i18n-patch-in-sync'), 'avoid-unwrapped-text': require('./avoid-unwrapped-text'), 'use-exact-imports': require('./use-exact-imports'), 'use-typed-gates': require('./use-typed-gates'), diff --git a/eslint/keep-i18n-patch-in-sync.js b/eslint/keep-i18n-patch-in-sync.js deleted file mode 100644 index ee183a5c..00000000 --- a/eslint/keep-i18n-patch-in-sync.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable bsky-internal/keep-i18n-patch-in-sync */ -const LOCALE_DATA_FOLDER = '@formatjs/intl-pluralrules/locale-data/' -const GEN_MODULE_PATH = - '@formatjs/intl-pluralrules/supported-locales.generated.js' - -exports.create = function create(context) { - delete require.cache[require.resolve(GEN_MODULE_PATH)] - const {supportedLocales} = require(GEN_MODULE_PATH) - return { - Literal(node) { - if (typeof node.value !== 'string') { - return - } - if (!node.value.startsWith(LOCALE_DATA_FOLDER)) { - return - } - const code = node.value.slice(LOCALE_DATA_FOLDER.length) - if (!supportedLocales.includes(code)) { - context.report({ - node, - message: - 'Edit .patches/@formatjs+intl-pluralrules+XXX.patch to include ' + - code, - }) - } - }, - } -} diff --git a/patches/@formatjs+intl-pluralrules+5.2.10.patch b/patches/@formatjs+intl-pluralrules+5.2.10.patch deleted file mode 100644 index 329eba2e..00000000 --- a/patches/@formatjs+intl-pluralrules+5.2.10.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/node_modules/@formatjs/intl-pluralrules/supported-locales.generated.js b/node_modules/@formatjs/intl-pluralrules/supported-locales.generated.js -index 5e0692b..d11157a 100644 ---- a/node_modules/@formatjs/intl-pluralrules/supported-locales.generated.js -+++ b/node_modules/@formatjs/intl-pluralrules/supported-locales.generated.js -@@ -2,3 +2,24 @@ - Object.defineProperty(exports, "__esModule", { value: true }); - exports.supportedLocales = void 0; - 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"]; -+ -+// PATCHED FOR ANDROID PERF. KEEP IN SYNC WITH i18n.ts -dan -+exports.supportedLocales = [ -+ 'ca', -+ 'de', -+ 'en', -+ 'es', -+ 'fi', -+ 'fr', -+ 'ga', -+ 'hi', -+ 'id', -+ 'it', -+ 'ja', -+ 'ko', -+ 'pt', -+ 'tr', -+ 'uk', -+ 'zh' -+]; -+ diff --git a/src/locale/i18n.ts b/src/locale/i18n.ts index 9f75f83f..baec4b8a 100644 --- a/src/locale/i18n.ts +++ b/src/locale/i18n.ts @@ -1,5 +1,5 @@ import '@formatjs/intl-locale/polyfill' -import '@formatjs/intl-pluralrules/polyfill' +import '@formatjs/intl-pluralrules/polyfill-force' // Don't remove -force because detection is very slow import '@formatjs/intl-pluralrules/locale-data/en' import {useEffect} from 'react'