4.0.0 (2020-05-23)
Features
- @formatjs/intl-numberformat: Use native Intl.getCanonicalLocales (54cea38)
This is a rewrite of Intl.NumberFormat polyfill:
- Feature compatible with ES2021 spec.
- Pass most of Intl.NumberFormat test262 cases.
- New version is 3 to 4 times faster in the benchmark of instantiating NumberFormat object + formatting numbers in currency or unit styles. It is almost 2 times faster in the benchmark variant that reuses the NumberFormat object.
- Slightly reduce locale data JSON size.
- Support compound unit like
kilometer-per-second
, wherekilometer
andsecond
can be any simple unit whitelisted in [IsSanctionedSimpleUnitIdentifier][]. - Polyfill for
NumberFormat.prototype.toLocaleString
. - Drop
Unified
prefix from the type definitions. - Reorganized source module structure.
BREAKING CHANGES
- @formatjs/intl-numberformat: This requires @formatjs/intl-getcanonicallocales for
IE11 and below