Skip to content

Unify PatternMessage and SelectMessage #437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stasm opened this issue Jul 24, 2023 · 3 comments
Closed

Unify PatternMessage and SelectMessage #437

stasm opened this issue Jul 24, 2023 · 3 comments
Labels
data model Issues related to the Interchange Data Model Stale Obsolete?

Comments

@stasm
Copy link
Collaborator

stasm commented Jul 24, 2023

The data model proposed in #393 defines Message as the following union type:

 type Message = PatternMessage | SelectMessage

 interface PatternMessage {
   type: 'message';
   declarations: Declaration[];
   pattern: Pattern;
 }

 interface SelectMessage {
   type: 'select';
   declarations: Declaration[];
   selectors: Expression[];
   variants: Variant[];
}

Seems like it might be simpler to have a single message, which has a body attribute that's one of pattern or select, and then select would just have the selectors and variants fields? (In other words, declarations would be factored out.)

Originally posted by @catamorphism in #393 (comment)


There's also the approach @stasm has suggested, i.e. expressing single-pattern messages as having an empty list for selectors, and a single entry in variants with a corrspondingly empty list of keys.

As I mentioned on the call, I'd much prefer landing something first and then iterating on it, rather than sorting out the details all in one go.

Originally posted by @eemeli in #393 (comment)

@stasm stasm added the data model Issues related to the Interchange Data Model label Jul 24, 2023
@aphillips aphillips added the LDML45 LDML45 Release (Tech Preview) label Jan 8, 2024
@aphillips
Copy link
Member

Is this still relevant?

@catamorphism
Copy link
Collaborator

Is this still relevant?

Since I made the original suggestion: This would be a very minor refactoring of the data model spec, which would make the spec easier to read but doesn't have any impact from users. I would personally be fine with just closing the issue as wontfix, since we have plenty to do.

@aphillips
Copy link
Member

Thanks. I'll close this.

One reason I asked if this were still relevant is that our syntax has changed in a different direction (simple vs. complex) since then.

@aphillips aphillips added Stale Obsolete? and removed LDML45 LDML45 Release (Tech Preview) labels Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data model Issues related to the Interchange Data Model Stale Obsolete?
Projects
None yet
Development

No branches or pull requests

3 participants