Intl v1.0.0
ECMA-402 Intl for @react-native-quickjs/quickjs,
backed by the operating system's own CLDR database the way Hermes does — no locale data ships in your bundle and none ships in this package.
npm install @react-native-quickjs/intlAn app that installs it needs no other Intl polyfill.
What it provides
Intl.DateTimeFormat · Intl.NumberFormat · Intl.Collator ·
Intl.PluralRules · Intl.RelativeTimeFormat · Intl.ListFormat ·
Intl.DisplayNames · Intl.Segmenter · Intl.Locale ·
Intl.DurationFormat · Intl.getCanonicalLocales · Intl.supportedValuesOf
plus the ECMAScript-side methods that must route to the same backend:
Number.prototype.toLocaleString, BigInt.prototype.toLocaleString,
Array.prototype.toLocaleString, %TypedArray%.prototype.toLocaleString,
String.prototype.localeCompare and its toLocaleUpperCase/toLocaleLowerCase,
and Date.prototype.toLocaleString/toLocaleDateString/toLocaleTimeString.
How it works
- Algorithm in JS, data in the OS. BCP-47 parsing, option resolution and its getter order, locale negotiation,
resolvedOptions, and the class shapes are written once injs/intl.js, byte-identical on every platform. The CLDR data is reached through a narrow platform seam (cpp/IntlPlatform.h) into what iOS and Android already carry. - Lazy. Installing defines one accessor on
globalThis; readingIntlmaterializes the implementation and redefines it as a data property. An app that never readsIntlpays one property access. - Bytecode.
js/intl.jsis compiled to QuickJS bytecode at build time against the same engine revision, so materialization costs no parse. - Real classes. Ordinary JavaScript classes, so
new,instanceof,.prototypeand subclassing work.