Implement Intl.RelativeTimeFormat.prototype.formatToParts

ASSIGNED
Assigned to
(Needinfo from 2 people)

Status

()

enhancement
ASSIGNED
Last year
15 days ago

People

(Reporter: anba, Assigned: anba, NeedInfo)

Tracking

({dev-doc-needed})

Trunk
Points:
---

Firefox Tracking Flags

(firefox63 affected)

Details

()

Attachments

(3 attachments)

Assignee

Description

Last year
Implement Intl.RelativeTimeFormat.prototype.formatToParts as specified in <http://tc39.github.io/proposal-intl-relative-time/#sec-Intl.RelativeTimeFormat.prototype.formatToParts>.

ICU feature request needed for implementing formatToParts: https://ssl.icu-project.org/trac/ticket/13256
Andre - do you think this should block us from exposing the current `Intl.RelativeTimeFormat` to the web? Seems like V8 exposed it recently - https://developers.google.com/web/updates/2018/10/intl-relativetimeformat
Assignee

Comment 2

8 months ago
Being unable to provide `formatToParts` is probably not a hard blocker - but before exposing RelativeTimeFormat we still need to fix some open issues, for example bug 1473588, which is blocked by bug 1499026. And while bug 1499026 has some patches to workaround ICU 63 build issues, it seems preferable to fix the build issues upstream (https://unicode-org.atlassian.net/browse/ICU-20209) instead of relying on local patches.
Assignee

Comment 3

2 months ago
  • Part 3 uses functions added in ICU 64, so we need to bump the version requirement.
  • Also remove a version check which is now true be default.
Assignee

Comment 4

2 months ago

Add js::intl::NumberFormatFields containing the two methods:

  • append: To append a number format field
  • toArray: To construct the result Array object

The unitType argument for NumberFormatFields::toArray will be used in part 3.

Depends on D26717

Assignee

Comment 5

2 months ago
  • The new formatted-value API is still draft-only, so extra U_HIDE_DRAFT_API guards
    are currently needed.
  • Also moves steps 4-5 of PartitionRelativeTimePattern to native code to reduce code
    duplication.

Depends on D26718

Assignee

Updated

2 months ago
Assignee: nobody → andrebargull
Status: NEW → ASSIGNED

Can we land this?

Flags: needinfo?(andrebargull)

There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:anba, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(andrebargull)
You need to log in before you can comment on or make changes to this bug.