Re: [w3ctag/design-reviews] Temporal proposal (#311)

The Temporal champion group has made several revisions to the proposal based on feedback it's received from the TAG and others. The changes to the proposal are now complete, and now is a good time for final feedback on the [documentation](https://tc39.es/proposal-temporal/docs/index.html) and [specification](https://tc39.es/proposal-temporal/) before Stage 3 and implementation in browsers.

Some specific comments about the current proposal with respect to the TAG's past feedback: 
- To represent the delta between two Temporal types, we added an explicit [Temporal.Duration](https://tc39.es/proposal-temporal/docs/duration.html) type, which can also be used in the argument to `.plus()`. To calculate the difference between two Temporal objects, resulting in a Duration object, use the [`.since()`](https://tc39.es/proposal-temporal/docs/zoneddatetime.html#since) method that exists on each type.
- The Civil prefix has been renamed to Plain. Still likely a bit unclear, but it's the best we have. We determined that it's important to have some prefix, to indicate clearly the lack of timezone (as opposed to ZonedDateTime). We plan to edit the documentation to tersely explain this meaning.
- For the Gregorian-only limitation, we have created a [generic calendar API](https://tc39.es/proposal-temporal/docs/calendar.html) to avoiding being too Gregorian-specific. All dates have calendars attached to them, which govern date arithmetic on them.
- To get the current timezone, use [`Temporal.now.timeZone`](https://tc39.es/proposal-temporal/docs/now.html#timeZone). An API to get the list of all timezones was drafted within the Temporal proposal, but broken out into the [Intl Enumeration API](https://github.com/tc39/proposal-intl-enumeration), which is currently [blocked on investigating this fingerprinting question](https://github.com/tc39/proposal-intl-enumeration/issues/3). Your feedback would be very welcome there.
- To represent the data model for year-month and month-day date pickers, as well as other use cases, the types [`Temporal.PlainYearMonth`](https://tc39.es/proposal-temporal/docs/plainyearmonth.html) and [`Temporal.PlainMonthDay`](https://tc39.es/proposal-temporal/docs/plainmonthday.html) were added.

Specifically, about integration with WebIDL and other web specs:
- WebIDL support for the new [bigint type](https://heycam.github.io/webidl/#idl-bigint) has landed. However, the use in Temporal does not involve WebIDL, as TC39's specifications do not currently use WebIDL.
- I'm happy to work towards HTML integration whenever it is seen as appropriate by the browsers/HTML editors. Some things already "just work" by coercion to strings ([example from the docs](https://tc39.es/proposal-temporal/docs/cookbook.html#calendar-input-element)).
- Specifically, for the relationship between DOMHighResTimeStamp and Temporal.Instant: In my opinion, it would be best to accept Temporal.Instant instead, due to its ability to describe higher precision and lack of rounding errors. (Remember not to use it for applications needing a monotonic timer!)
- I get the feeling that the design philosophy used in web specifications like these is more "demand pull" than "supply push"--even if we have a mechanism which may be useful, we should maybe wait for other specification authors to ask for this integration where it's useful for them.  So it seems like the most effective thing would be to publish good documentation about the proposal, rather than push specific integrations on people. This seems to be the philosophy taken about integration about Promise and BigInt integration in Web specifications. (I proposed several BigInt integrations that received a lack of interest for a long time; I don't want to waste people's time with something similar for Temporal.) It seems that the bar for proving that the integration is useful will be high, even amid TAG encouragement.

As an introduction to the current API shape of Temporal, see [this presentation](https://docs.google.com/presentation/d/1xP3_UaXlS4-SilVpFu6UFOL8QQw0Dr_VsaR8mSSEATI/edit) which walks through the basic types and operations. Our plan is to integrate this sort of discussion into the Temporal documentation.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/311#issuecomment-734812490

Received on Friday, 27 November 2020 12:29:17 UTC