One of our goals is to provide developers with access to newest ECMA-402 Intl APIs. Therefore, FormatJS suite also provide multiple high quality polyfills that are fully tested using the Official ECMAScript Conformance Test Suite.
Our current list of polyfills includes:
- Intl.PluralRules
- Intl.RelativeTimeFormat
- Intl.ListFormat
- Intl.DisplayNames
- Intl.NumberFormat (ES2020)
- Intl.Collator
- Intl.Locale
- Intl.LocaleMatcher
- Intl.getCanonicalLocales
- Intl.DateTimeFormat (ES2020)
- Intl.Segmenter
- Intl.DurationFormat
- Intl.supportedValuesOf
Numeric inputs#
DateTimeFormat, RelativeTimeFormat, duration fields, and numeric options use ECMAScript Number conversion and reject BigInt inputs. NumberFormat and PluralRules formatting values support BigInt through their separate mathematical-value conversion.
polyfill-fastly.io Integration#
For basic use cases, we recommend using polyfill-fastly.io or polyfill-library to generate polyfill bundle since it automatically resolves the dependencies above for you.
Conformance testing#
The repository runs Test262 both with each polyfill installed individually and with all twelve installed together. Combined tests cover interactions that an isolated test can otherwise delegate to native Intl implementations.
Run bazel test //tools/test262:combined for the combined regression gates.
A reviewed failure baseline is not full conformance; use a package's
test262-strict target or //tools/test262:combined-<polyfill>-strict for a
zero-failure check. Counts and remaining failures are tracked in
knowledge-base/014-test262-conformance.md.
Combined suites use four harness workers with matching CPU reservations. This keeps full-suite execution within CI time limits while preserving per-test process isolation and the complete test selection.
Test262 preludes load shared locale fixtures for the upstream locale metadata, including dependencies used when all polyfills are installed together.