You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: meetings/2024/notes-2024-04-29.md
+20-4Lines changed: 20 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -93,13 +93,13 @@ EAO: I think it’s premature because we don’t yet agree that attributes shoul
93
93
94
94
MIH: I’m generally reluctant to have runtime errors unless they’re essential to have. With HTML, if you have junk, your page doesn’t explode – it still renders. It is not useful to give an error that isn’t actionable by the user. This does comport with how ICU does things in my ICU4J implementation.
95
95
96
-
EAO: Are you saying that the ICU mandates that a fallback returns
96
+
EAO: Are you saying that the ICU mandates that a fallback is returned?
97
97
98
98
MIH: I defer to the ICU-TC. I’m just describing the situation in ICU.
99
99
100
-
EAO: The spec text on formatting says that
100
+
EAO: The spec text on formatting says that, "In all cases, when encountering a runtime error, a message formatter MUST provide some representation of the message. An informative error or errors MUST also be separately provided."
101
101
102
-
TIM: It’s true that ICU can only concurrently return one error. I want to know where we require
102
+
TIM: It’s true that ICU can only concurrently return one error. I want to know where we require multiple errors to be returned.
103
103
104
104
MIH: It’s not just that. In ICU, if you return a value, then you ignore the error, and vice versa. You don’t return an error and a value at the same time.
105
105
@@ -131,6 +131,22 @@ RGN: True, but in the case of syntax errors, you –
131
131
132
132
EAO: Yes, syntax errors are different.
133
133
134
-
TIM: This means that #738 will be blocked on an issue that MIH will raise.
134
+
RGN: Yes, I agree. The other JS Intl APIs provide a fallback value or best effort return value when formatting. But it makes sense to me that MessageFormat is different enough that it would be useful to return the error in addition to returning a value.
135
+
136
+
ECH: I'd like to understand RGN's reasoning on what makes MessageFormat different from the other JS Intl APIs in his mind, that MessageFormat should return the error(s) and a return value when the other APIs don't.
137
+
138
+
RGN: I think it's the impact of MessageFormat. MessageFormat will in turn call the other APIs, so the scope of the API is bigger, and the ways that the API to go wrong is greater.
139
+
140
+
EAO: In addition, because MessageFormat depends on user data, the distance between the developer and the user's localized experience is much greater. If an error is introduced during translation, it might not even be possible to catch that in CI systems or elsewhere, before it goes to production.
141
+
142
+
ECH: In one way, MessageFormat is a formatter just like all of the other i18n APIs in JS Intl. I understand the argument the argument that the scale warrants different behavior, but that is only one way of looking at it.
143
+
144
+
Another way of looking at it is in terms of how actionable an error message is to the person it bubbles up to. In the example that MIH brought up earlier, an end user can't do much when the browser throws an exception on input HTML, so the browser has to make its best effort to render. Another example is ICU, which is in that same category as a browser since it is a library that is depended on by other applications, so it can't throw exceptions that take down the entire dependent application. That's why it has provides best effort results.
145
+
146
+
So in the second way of looking at things, if we really care about returning errors, an alternative approach could be to provide two different types of formatting APIs, one that provides a best effort like the other JS Intl and ICU APIs do, and another one that is allowed to throw exception. But there's not one way to look at things.
147
+
148
+
RGN: Yes, and to be clear, I am not opinionated about which approach we would take. I see both of those approaches as being a part of the same solution space.
149
+
150
+
TIM: This discussion means that #738 will be blocked on an issue that MIH will raise.
135
151
136
152
MIH: Another idea why we shouldn’t force it in the spec is what RGN said about being lenient about how we choose an option from the design space. For example, RGN would be equally okay with having a solution that provides an API that includes 2 different functions (ex: format_strict and format_loose)
0 commit comments