Skip to content

Add a separate MF2 parser optimised for formatting#418

Merged
eemeli merged 3 commits intomainfrom
data-parser
Feb 23, 2024
Merged

Add a separate MF2 parser optimised for formatting#418
eemeli merged 3 commits intomainfrom
data-parser

Conversation

@eemeli
Copy link
Member

@eemeli eemeli commented Feb 12, 2024

The spec discussion and probable change in tc39/proposal-intl-messageformat#47 of requiring messages to be input as data models has highlighted the need for a performant parser. That's added here as parseMessage(source, options). Its only supported option is privateAnnotation, a function that can be defined to parse private ^ and & annotations.

Unlike the CSV parser, this one does not create any intermediate structure on its way to the data model. It's also smaller, minifying & compressing to 2.3kB compared to the CSV's 4.4kB (The MessageFormat runtime is about 4.2kB).

@eemeli eemeli merged commit ee1bc08 into main Feb 23, 2024
@eemeli eemeli deleted the data-parser branch February 23, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant