Switch DateTimeFormat to use a component bag abstraction, rather than string skeletons
Categories
(Core :: Internationalization, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox94 | --- | fixed |
People
(Reporter: gregtatum, Assigned: gregtatum)
References
Details
(Whiteboard: [i18n-unification])
Attachments
(9 files, 1 obsolete file)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
In ICU4X, the DateTimeFormat API will take a components bag + hour cycle preference as input, and then generate the formatted results. There is no skeleton or pattern API that is being exposed, as those are implementation details. This API can directly back ECMA-402's Intl.DateTimeFormat.
However, with ICU4C, the Intl.DateTimeFormat API is implemented using pattern and skeleton manipulation, which happens directly in the strings. This lets SpiderMonkey do things like manipulate the hour cycle to follow the spec. ICU4X does this automatically.
The work for this bug is to take SpiderMonkey's pattern manipulation code, and put it in a mozilla::intl component, and then expose a component bag API. This will allow for the eventual usage of ICU4X. This may or may not block performance testing of Intl.DateTimeFormat. Some investigation is required still to see if good results can be obtained without doing this refactoring.
Here you can see where the skeletons and patterns are stored internally:
Here is code that ICU4X will be handling through a component bag:
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
This is part of the work for Bug 1713206
Assignee | ||
Comment 2•3 years ago
|
||
Depends on D123819
Assignee | ||
Comment 3•3 years ago
|
||
This patch will not compile. It naively copies over the hour cycle code
from SpiderMonkey into the unified components. In a following patch,
these will be modified to use only the unified types.
Depends on D123820
Assignee | ||
Comment 4•3 years ago
|
||
This patch will probably not compile on its own, but requires the SpiderMonkey
side as well. It aims at building a components bag interface that can be
then used in SpiderMonkey to back the ECMA 402 API.
Depends on D123821
Assignee | ||
Comment 5•3 years ago
|
||
This patch completes the move of pattern manipulation for
Intl.DateTimeFormat and places it in the unified API. If and when we
switch to ICU4X, the pattern manipulation code can be removed, as ICU4X
will handle that.
Depends on D123822
Updated•3 years ago
|
Assignee | ||
Comment 6•3 years ago
|
||
Depends on D123819
Assignee | ||
Comment 7•3 years ago
|
||
Depends on D123823
Updated•3 years ago
|
Assignee | ||
Comment 8•3 years ago
|
||
Depends on D124498
Assignee | ||
Comment 9•3 years ago
|
||
Depends on D125252
Assignee | ||
Comment 10•3 years ago
|
||
Depends on D125253
Comment 11•3 years ago
|
||
Comment 12•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/676f078fa705
https://hg.mozilla.org/mozilla-central/rev/60b2ef13fc96
https://hg.mozilla.org/mozilla-central/rev/79a3304d03df
https://hg.mozilla.org/mozilla-central/rev/0b5d9fdd57a2
https://hg.mozilla.org/mozilla-central/rev/b23f891ed375
https://hg.mozilla.org/mozilla-central/rev/268ea13a74e7
https://hg.mozilla.org/mozilla-central/rev/9a05f50a92eb
https://hg.mozilla.org/mozilla-central/rev/c36bd08f3752
https://hg.mozilla.org/mozilla-central/rev/f785d3c64243
Description
•