npm / pofile-ts
pofile-ts
What changed in pofile-ts 2 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-25.
15 breaking30 new APIs and options8 performance3 behavior and defaults3 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpofile-ts 413 changes
Breaking changes 4
The helper was removed because node types are self-documenting.
IcuErrorKind is now just the 'SYNTAX_ERROR' string type.
IcuNodeType is now a string union of literal, argument, number, date, time, select, plural, pound, and tag instead of a numeric enum.
Renames ArgType to ParentArgType.
New APIs and options 9
Adds more than 50 built-in format styles for number, date, time, and list formatting.
Adds a factory for creating pre-configured compilers.
Adds support for custom number, date, time, and list format styles.
Adds extended Intl format types for list, duration, relativeTime, and displayNames.
Adds getPluralFormsHeader.
Adds hasSelectOrdinal.
Adds metadata support for translation items.
Adds typed style properties aligned with Intl APIs.
Supports supplying a dynamic currency through values.currency.
pofile-ts 338 changes
Breaking changes 6
Plural rules are now compliant with CLDR 48, which may affect pluralization results.
The default export is removed; import named exports instead.
The Item class is removed; use the functional API instead.
The PO class is removed; use the functional API instead.
PoFile is exported as an interface instead of a class.
PoItem is exported as an interface instead of a class.
New APIs and options 21
Adds compileCatalog() for compiling catalogs.
Adds compileIcu() for runtime message compilation.
Adds generateCompiledCode() for generating compiled code.
Adds an ICU MessageFormat v1 parser.
Adds getPluralSamples as a new utility, exported from index.
Adds parsePluralFormsHeader as a new utility, exported from index.
Adds splitMultilineComments as a new helper, exported from index.
Adds helpers for converting catalogs.
Adds support for CLDR plural categories.
Adds a helper for creating default headers.
Adds an option for better TMS readability.
Adds a helper for formatting PO dates.
Adds conversion from Gettext to ICU.
Adds utilities for generating message IDs.
Adds utilities for parsing and formatting references.
Adds SerializeOptions for Crowdin-compatible output format.
Create an item with the new functional API.
Create a PO file with the new functional API.
Parse PO content with the new functional API.
Serialize an item with the new functional API.
Serialize a PO file with the new functional API.
Performance 8
Optimizes hot paths in new helper functions.
Optimizes plural serialization.
String extraction uses indexOf and a fast path for unescaping.
Replacing a regular expression with startsWith and inlining the obsolete check improves performance.
Pre-compiled regular expressions and native methods optimize parsing.
First-character dispatch and inline plural-index extraction improve performance.
Fast-path escaping and loop improvements optimize serialization.
A fast path for simple strings and optimized line folding improve performance.
Behavior and default changes 2
Supports numeric tags such as <0> and <1> for Lingui compatibility.
Message IDs use 8-character Base64URL encoding.
Fixes and other changes 1
Robustness for partial or incomplete input is improved.
pofile-ts 28 changes
Breaking changes 5
The load() method was removed for browser compatibility.
The save() method was removed for browser compatibility.
The minimum supported Node.js version is now 22.
PO.load() now returns Promise<PO> instead of using callbacks.
po.save() now returns Promise<void> instead of using callbacks.
Behavior and default changes 1
Adds support for running pofile-ts on Node.js 20.
Fixes and other changes 2
Uses separate type declarations for ESM and CJS exports, improving type resolution for consumers of either module format.
The PO.ts filename case was corrected.