Open Bug 1929284 Opened 27 days ago Updated 7 hours ago

Update Temporal implementation to draft November 1, 2024

Categories

(Core :: JavaScript: Standard Library, task, P3)

task

Tracking

()

ASSIGNED

People

(Reporter: anba, Assigned: anba)

References

(Blocks 2 open bugs)

Details

Attachments

(47 files)

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
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
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
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
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
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
No description provided.
Severity: -- → N/A
Priority: -- → P3
  • Update spec references to match the current spec text more closely.
  • Use MOZ_TRY_VAR to reduce code duplication.
  • Add ParsedZonedDateTime to reduce the number of out-params for
    ParseTemporalZonedDateTimeString and ParseTemporalRelativeToString.
  • Also track "start-of-day" in preparation for the next part.
  • Remove precalculated date-time parameters from AddZonedDateTime and DifferenceZonedDateTimeWithRounding.
  • Rename GetPlainDateTimeFor to GetISODateTimeFor per current spec.
  • Inline GetOffsetStringFor into its single caller per current spec.

The options parameter is now (again) handled in the various ToTemporalThing
operations.

Also merge ToTemporalDuration and ToTemporalDurationRecord per latest spec.

Sync the operation names and add two new operations
NormalizeDurationWith24HourDays and NormalizeDurationWithoutTime.

NOTE: Later spec updates have renamed these operations. Later parts in this
patch stack will update the operations to their current names.

The spec now has a separate ISODateWithinLimits operation.

Spec operations have been renamed to all start with "AddDurationTo" and there
were some additional minor implementation changes.

  • Change AddTime, BalanceTime, and RoundTime to return a TimeRecord (per spec).
  • New callers to AddTime and BalanceTime require int64_t for days, so using
    int64_t for all three functions is now necessary.
  • The new TODO notes in AddDurationToYearMonth will be addressed when updating
    the Temporal Fields operations.
  • Sync step comments.
  • Reorder steps to match current proposal.
  • Add TODO notes for still missing changes.

Drive-by changes:

  • Make the MonthCodes constructor a bit more readable.
  • Change constants in monthcodes namespace to avoid a parser error in the CDT indexer.

"Temporal Fields" are now "Calendar Fields" in the spec. Multiple operations
have been simplified now that user-defined calendars have been removed. Sync
all operations which use "Calendar Fields" to match the current spec text.

We don't have to use Int128, because without user-defined time zones, it's guaranteed
that the values fit into int64_t.

Sync all operations and step references to the current draft proposal.

options are now processed before the early return.

Drive-by changes:

  • Update names for CompareTimeDuration, TimeDurationSign, and DateDurationDays.
  • Pass ZonedDateTime to AddZonedDateTime and DifferenceZonedDateTimeWithRounding
    instead of reading the individual fields in the callers.

Sync all operations and step references to the current draft proposal.

This allows removing SortedEnumSet.

Perform the following renames:

  • PlainDate(Time) -> ISODate(Time)
  • PlainTime -> Time
  • PlainXXXWithCalendar -> PlainXXX.

Sync all operations and step references to the current draft proposal.

The spec no longer passes Temporal.Instant objects around and instead directly
uses the nanoseconds amount. Rename the Instant struct to EpochNanoseconds to
match the current spec use more closely.

The spec now also defines a Time Duration value, so it's confusing when an
internal implementation type is named TimeDuration.

Rounding operations were reordered and split into different operations. Update
everything to match the current spec text.

Sync all operations and step references to the current draft proposal.

Rename ToTemporalCalendarIdentifier to CalendarIdentifier to avoid confusion
with the spec operation ToTemporalCalendarIdentifier.

Sync all operations and step references to the current draft proposal.

Sync all operations and step references to the current draft proposal.

Sync all operations and step references to the current draft proposal.

ICU4X doesn't yet provide this operation, so we have to write our own implementation.

ICU4X doesn't yet provide a public API for this operation, so we have to write
our own implementation.

Blocks: 1912757
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/adaacc03dc4f Part 1: Various editorial updates. r=dminor https://hg.mozilla.org/integration/autoland/rev/b6f30453153e Part 2: Disallow rounding to increment while balancing to calendar unit. r=dminor https://hg.mozilla.org/integration/autoland/rev/ee257f72e4c3 Part 3: Sync TemporalParser. r=dminor https://hg.mozilla.org/integration/autoland/rev/93b34d6de713 Part 4: Handle "start of day" separately from "midnight". r=dminor https://hg.mozilla.org/integration/autoland/rev/63c3e38aa87a Part 5: Remove precalculated date-time parameters and sync operation names. r=dminor https://hg.mozilla.org/integration/autoland/rev/6ef814f5cfef Part 6: Sync processing of "options" in ToTemporal operations. r=dminor https://hg.mozilla.org/integration/autoland/rev/21548a9ebb44 Part 7: Sync normalize duration operations. r=dminor https://hg.mozilla.org/integration/autoland/rev/0b9705544e7b Part 8: Add ISODateWithinLimits. r=dminor https://hg.mozilla.org/integration/autoland/rev/10a3237bfe6b Part 9: Synchronise operations to add durations. r=dminor https://hg.mozilla.org/integration/autoland/rev/2c0dd60a07fe Part 10: Merge CanonicalizeUValue into IsBuiltinCalendar. r=dminor https://hg.mozilla.org/integration/autoland/rev/15302cb66051 Part 11: Sync steps in PlainYearMonth. r=dminor https://hg.mozilla.org/integration/autoland/rev/347f3afc24e7 Part 12: Add missing include guards. r=dminor https://hg.mozilla.org/integration/autoland/rev/a65d72c20c3a Part 13: Sync Calendar Fields operations. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/0a8562654882 Part 14: Sync step comments for Temporal.Instant. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/36a71a646110 Part 15: Remove individual AOs for each calendar field. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/efb3a6becd0f Part 16: Reorder more Calendar operations. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/7c84fde489b3 Part 17: More editorial changes. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/e9dd7a737ebe Part 18: Sync Calendar{Date,YearMonth,MonthDay}FromFields. r=dminor https://hg.mozilla.org/integration/autoland/rev/fd8642b60cc7 Part 19: Merge operations into CalendarDateAdd and CalendarDateUntil. r=dminor https://hg.mozilla.org/integration/autoland/rev/e12cbfccea67 Part 20: Sync BalanceISODate. r=dminor
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: