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
There are valid use cases for every API, potentially we could support all.
For now, we'll add APIs as necessary and reported by users.
This will increase bundle size though, we should evaluate how much. Potentially we could also split useFormatter into separate hooks like const dateTimeFormat = useDateTimeFormatter(), const relativeTimeFormat = useRelativeTimeFormat(), const numberFormat = useNumberFormatter() (could be introduced alongside useFormatter for a longer transition period).
Also note that only a subset of these formatting APIs is supported by ICU.
Describe alternatives you've considered
Supporting only a subset, e.g. none of the ToParts variants and asking users to implement this in userland.
There are even more APIs from Intl (not necessarily related to formatting), so we'll likely not wrap every single API.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
We currently support a subset of formatting APIs from
Intl
:Intl.DateTimeFormat
format
formatRange
(feat: Addformat.dateTimeRange
#769)formatToParts
formatRangeToParts
Intl.NumberFormat
format
formatRange
(see previous discussion in Add support for number range formatting #540)formatToParts
formatRangeToParts
Intl.ListFormat
format
formatToParts
Intl.RelativeTimeFormat
format
formatToParts
Describe the solution you'd like
There are valid use cases for every API, potentially we could support all.
For now, we'll add APIs as necessary and reported by users.
This will increase bundle size though, we should evaluate how much. Potentially we could also split
useFormatter
into separate hooks likeconst dateTimeFormat = useDateTimeFormatter()
,const relativeTimeFormat = useRelativeTimeFormat()
,const numberFormat = useNumberFormatter()
(could be introduced alongsideuseFormatter
for a longer transition period).Also note that only a subset of these formatting APIs is supported by ICU.
Describe alternatives you've considered
Supporting only a subset, e.g. none of the
ToParts
variants and asking users to implement this in userland.There are even more APIs from
Intl
(not necessarily related to formatting), so we'll likely not wrap every single API.The text was updated successfully, but these errors were encountered: