-
-
Notifications
You must be signed in to change notification settings - Fork 36
In test suite, drop source from non-fallback formatted parts #1061
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
Conversation
Needed to fix up the JSON schema a bit to make this work. The relative |
…ormat-wg#1061) The source adds no value, and is directly constructable from the `name` and `kind`.
@@ -347,6 +342,23 @@ | |||
}, | |||
"value": {} | |||
} | |||
}, | |||
{ | |||
"description": "Fallback part.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we be more verbose with the descriptions? They're here as documentation, after all...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is literally a fallback part, i.e. the result of formatting a value that experienes fallback. I don't really know what else to say about it?
"id": "foo", | ||
"value": "world" | ||
}, | ||
{ "type": "string", "dir": "ltr", "id": "foo", "value": "world" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to lose the formatting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean that this is on a single line, rather than the multiple lines it had previously? It's because with the change, it's now short enough to easily fit on a single line.
I'm not sure of the reasoning behind still including the |
It's needed to hold the representation that's also used in the string output, i.e. |
While reviewing the messageformat.dev documentation, I started to re-think the
source
value that's currently included in formatted parts.I think we should drop it, as it makes a part of what ought to be considered implementation details into a public API (such as the name of a message variable or function). If a user does have a need to identify a specific part in the output, that ought to be explicit, and it's what we have
u:id
for.For markup in particular it adds no value, as the
source
value is constructable from thename
and thekind
.CC @ryzokuken