Conversation
…esolveValue wrappers
…ssageformat/functions/utils
|
Very happy to see this working going on. I didn't read to the bottom of the code yet. I do notice lots of good general code hygiene in here as well. |
Member
Author
|
Added CST backreferences to the parsed data model, available as |
…(src)) instead of asDataModel(parseMessage(src))
Member
Author
|
Added |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should bring the implementation to parity with the current spec, pre-emptively also including changes from:
<matchSignature>for:number, together with:ordinal&:pluralaliases unicode-org/message-format-wg#560Some ESLint changes are included, which is why this touches some files outside the
packages/mf2-*directories. I've also dropped commitlint, as it was getting too annoying during development.The
@messageformat/fluentpackage is here made ES-only, as that was the easiest way to satisfy TS regarding its@fluent/syntaxdependency. This may be a temporary thing; we'll see. The Fluent -> MF2 converters now use duck-typing to detect plural selectors; this can be disabled with an option.The XLIFF representation is streamlined a bit. Am considering using
<originalData>and<res:resourceData>for some of what's currently in a wholly custom<mf:messageformat>container.The
messageformatexports are refactored quite a bit, adding new endpointsmessageformat/functionsandmessageformat/functions/utilswith relevant parts of the API.Two new data model tools are added:
visitis a specialized message data visitor, andvalidatechecks that the model does not have any data model errors, and reports the function & variable dependencies of a message. Currently it effectively duplicates functionality from the CST parser; that should get resolved at some point, but that'll require a datamodel -> CST mapper so that the errors can still be reported by character position.The JSON test fixtures are refactored a bit, separating out:
The internal file structures of the main package have evolved quite a bit, and feel like they make some sense again. I'm not really expecting anyone to review all the changes here, as that would likely be quite a slog.
CC @aphillips, @mradbourne