Title: Ship the Android and iOS V8 runtimes with ICU so Intl is available · Issue #11563 · NativeScript/NativeScript · GitHub
Open Graph Title: Ship the Android and iOS V8 runtimes with ICU so Intl is available · Issue #11563 · NativeScript/NativeScript
X Title: Ship the Android and iOS V8 runtimes with ICU so Intl is available · Issue #11563 · NativeScript/NativeScript
Description: Is your feature request related to a problem? Please describe. The NativeScript 9 Android and iOS runtimes ship V8 without ICU, so Intl does not exist: typeof Intl // 'undefined' new Intl.NumberFormat() // ReferenceError: Intl is not def...
Open Graph Description: Is your feature request related to a problem? Please describe. The NativeScript 9 Android and iOS runtimes ship V8 without ICU, so Intl does not exist: typeof Intl // 'undefined' new Intl.NumberFor...
X Description: Is your feature request related to a problem? Please describe. The NativeScript 9 Android and iOS runtimes ship V8 without ICU, so Intl does not exist: typeof Intl // 'undefined' new Intl.N...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/11563
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ship the Android and iOS V8 runtimes with ICU so Intl is available","articleBody":"### Is your feature request related to a problem? Please describe.\n\nThe NativeScript 9 Android and iOS runtimes ship V8 without ICU, so `Intl` does not exist:\n\n```js\ntypeof Intl // 'undefined'\nnew Intl.NumberFormat() // ReferenceError: Intl is not defined\n```\n\nVerified at runtime with `@nativescript/android` 9.1.1 on a physical device (Android 16) and `@nativescript/ios` 9.1.0 on an iOS 27 simulator. The same code works in Chromium, Safari/JSC, Node, and Hermes.\n\nThe cause is a build flag, not a runtime bug. Both build scripts in `NativeScript/v8-buildscripts` set it:\n\n- [`scripts/matrix/build-android.sh`](https://github.com/NativeScript/v8-buildscripts/blob/main/scripts/matrix/build-android.sh): `v8_enable_i18n_support=false`\n- [`scripts/matrix/build-ios.sh`](https://github.com/NativeScript/v8-buildscripts/blob/main/scripts/matrix/build-ios.sh): `v8_enable_i18n_support=false`\n\nThe script comment says this \"reproduces the shape of the 10.3 build these libraries replace\". The flag was carried over from the old build rather than chosen fresh. The 14.9 rebuild seems like a good moment to revisit it.\n\nThe flag removes more than the `Intl` constructors. These engine features also fail or quietly misbehave on Android and iOS:\n\n| Feature | Behavior without ICU |\n| --- | --- |\n| `Intl.*` (NumberFormat, DateTimeFormat, PluralRules, Collator, Segmenter, …) | `ReferenceError` |\n| `Number#toLocaleString`, `Date#toLocale*String` | Options and locales ignored (#8249, #8472) |\n| `String#localeCompare` | Locale and options ignored (#7810, #10617) |\n| `String#normalize` | No-op |\n| `toLocaleUpperCase` / `toLocaleLowerCase` | Locale rules ignored |\n| RegExp `\\p{…}` property escapes | `SyntaxError` at parse time |\n\nReal-world impact:\n\n- **Libraries crash at import.** Any module that builds a formatter at module scope throws on load. One example is the common `const fmt = new Intl.NumberFormat()` pattern.\n- **i18n libraries break.** `@lingui/core` calls `Intl.PluralRules`, so every pluralized message throws.\n- **Bundles need patching.** Libraries that use `\\p{L}` regexes (`linkifyjs`, `@lexical/link`, and others) fail to parse. Apps have to patch them or transpile the regexes.\n\n### Describe the solution you'd like\n\nBuild the Android and iOS V8 libraries with `v8_enable_i18n_support=true`, and initialize ICU in both runtimes before V8 starts.\n\nTwo packaging options would work:\n\n1. **On by default.** This matches browsers and Node. React Native's Hermes exposes `Intl` on Android and iOS too, but delegates to the platform's ICU instead of shipping its own data — a precedent for exposing `Intl` by default, not for bundling ICU data (and that delegation path isn't available to V8 anyway; see alternatives).\n2. **An ICU runtime flavor.** Ship it next to the existing AAR flavors and the iOS framework, selectable from app config. This also fits the \"optional\" direction in https://github.com/NativeScript/NativeScript/issues/10297#issuecomment-2095041966. The optional piece would be the engine build, not a JS polyfill.\n\nSize data to help weigh the cost:\n\n| ICU data file (Chromium's ICU checkout, `chromium/deps/icu`) | Size |\n| --- | --- |\n| `common/icudtl.dat` (full CLDR) | 10.3 MiB (4.4 MiB gzip) |\n| `android/icudtl.dat` (Chromium's Android filter) | 8.9 MiB |\n| `ios/icudtl.dat` (Chromium's iOS filter) | 6.2 MiB |\n| `flutter/icudtl.dat` (Flutter's filter — text layout only, not an `Intl` implementation) | 0.8 MiB |\n\n- **Ship the data once.** The scripts set `icu_use_data_file=false`, which embeds the data in every ABI's `.so`. With `icu_use_data_file=true`, Android can ship one architecture-independent `icudtl.dat` in assets. That stores it once per APK instead of once per ABI.\n- **Filter the data.** ICU's data filters can trim locales and features further, as the Chromium and Flutter variants show.\n- **Precedent:** `react-native-v8` reports about 7 MiB per ABI for ICU, and the `jsc-android` intl variant about 6 MiB.\n- **Not measured yet:** the ICU code-size delta under these exact GN args.\n\n### Describe alternatives you've considered\n\n**FormatJS polyfills.** These are the current workaround, as suggested in #10588. They work: for the cases we tested, forced FormatJS gave byte-identical formatter output on Android, iOS, Chromium, and macOS JSC. They aren't a substitute for engine ICU:\n\n- **They can't fix engine features.** `\\p{…}` regexes, `normalize`, locale case mapping, and `localeCompare` stay broken.\n- **Size**, measured with esbuild, minified:\n - About 957 KiB (250 KiB gzip) for eight constructors with English only.\n - About +337 KiB per extra locale.\n - About +789 KiB for time-zone data.\n - `Intl.Collator` with all locale data is 5.8 MiB.\n- **Startup:** importing a full bundle (about 10 MiB) took 314 ms in a debug build on a physical Android device.\n- **Setup burden:** every app must wire up load order, locale data, and defaults itself. Without that, the polyfills fall back to `en` and `UTC` on device.\n\n**Platform formatter bridges** (`android.icu`, `NSNumberFormatter`/`NSDateFormatter`, like the legacy `nativescript-intl`). These give only a partial API whose output varies by OS version. iOS has no public plural-rules API. Hermes's maintainers describe the platform APIs as \"simply inadequate for a complete and correct implementation\" (https://github.com/facebook/hermes/discussions/1211). Hermes itself took this path for space efficiency and still hasn't reached parity — it lacks `PluralRules`, `RelativeTimeFormat`, `ListFormat`, `Locale`, and `Segmenter`, which a third-party ICU4X library ([hermes-intl](https://github.com/magrinj/hermes-intl)) now fills.\n\n### Anything else?\n\n- **Related:** #10297 (comment on `Intl`), #10617, #10588, #8249, #8472, #7810.\n- **Where this came from:** we found this building a cross-platform framework on NativeScript, where the same app code runs on web, macOS, iOS, and Android.\n- **Open question for maintainers:** which shape would you accept — on by default or a separate flavor, and embedded data or a shared data file?\n\n### Please accept these terms\n\n- [x] I have searched the [existing issues](https://github.com/NativeScript/NativeScript/issues) as well as [StackOverflow](https://stackoverflow.com/questions/tagged/nativescript) and this has not been posted before\n- [x] I agree to follow this project's [Code of Conduct](https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#coc)","author":{"url":"https://github.com/aleclarson","@type":"Person","name":"aleclarson"},"datePublished":"2026-10-21T22:44:56Z","url":"https://github.com/NativeScript/NativeScript/issues/11563"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b38cf3f1-cdc1-e3e8-fbbb-02281eb03e33 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DCA2:33D24F:10721E5:151E828:6B011A46 |
| html-safe-nonce | e060f964b69d00ff2d75d6a2e104a40e9c39f1993096ede7789ee72f4d8d5e22 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQ0EyOjMzRDI0RjoxMDcyMUU1OjE1MUU4Mjg6NkIwMTFBNDYiLCJ2aXNpdG9yX2lkIjoiNTQ3MTEyMTU3NzU4NjI2ODc0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c5431bff472f679c0d54d5c55acbbf282c2df4b38df1624a0f9a3cac38356226 |
| hovercard-subject-tag | issue:5969736257 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/NativeScript/11563/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3c9e61629da976b67df47690e0304f66f4ca95e9c21b21d0e85abd94dfbf6aca/NativeScript/NativeScript/issues/11563 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3c9e61629da976b67df47690e0304f66f4ca95e9c21b21d0e85abd94dfbf6aca/NativeScript/NativeScript/issues/11563 |
| og:image:alt | Is your feature request related to a problem? Please describe. The NativeScript 9 Android and iOS runtimes ship V8 without ICU, so Intl does not exist: typeof Intl // 'undefined' new Intl.NumberFor... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aleclarson |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 31492490 |
| octolytics-dimension-repository_nwo | NativeScript/NativeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31492490 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/NativeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width