Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixup explainer and update to latest design #66

Merged
merged 2 commits into from
Aug 25, 2021

Conversation

ryzokuken
Copy link
Member

@ryzokuken ryzokuken commented Aug 4, 2021

  • update explainer
  • update spec

/cc @justingrant @sffc @FrankYFTang

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a section explaining the motivation and design for the fractionalDigits option. Also a section for the style option.

Finally, I was hoping to see an "Options Summary" or "Design Summary" section that shows the full list of options and their allowed values. The current layout of the page with multiple, separate "Design" sections is fine, but it makes it visualize every option to understand the big picture of how the API works. I think both are helpful.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new fractionalDigits section with examples is great. But IMHO this page still needs an options summary section which lists all the possible options, their possible values, and a short sentence about each one. Something like the "parameters" section of https://tc39.es/proposal-temporal/docs/zoneddatetime.html#until.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justingrant updated! Please check out the README now and let me know what you think.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New content is much clearer and easier to understand. Thanks!

spec.emu Outdated
<li>[[MonthsDisplay]] is one of the String values `"auto"` or `"always"` identifying when to display the months field.</li>
<li>[[Weeks]] is one of the String values `"long"`, `"short"`, or `"narrow"` identifying the formatting style used for the weeks field.</li>
<li>[[WeeksDisplay]] is one of the String values `"auto"` or `"always"` identifying when to display the weeks field.</li>
<li>[[Days]] is one of the String values `"long"`, `"short"`, or `"narrow"` identifying the formatting style used for the days field.</li>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should consider supporting a 'numeric' style for days. I've seen countdown timers that add days to the left of hours, e.g. 2:23:59:59.123456789.

spec.emu Outdated
@@ -331,7 +405,26 @@ contributors: Ujjwal Sharma, Younies Mahmoud
<li>[[DataLocale]] is a String value with the language tag of the nearest locale for which the implementation has data to perform the formatting operation. It will be a parent locale of [[Locale]].</li>
<li>[[NumberingSystem]] is a String value with the `"type"` given in Unicode Technical Standard 35 for the numbering system used for formatting.</li>
<li>[[Style]] is one of the String values `"long"`, `"short"`, `"narrow"`, or `"digital"` identifying the duration formatting style used.</li>
<li>[[Fields]] is a List value specifying which duration fields are required to be printed.</li>
<li>[[Years]] is one of the String values `"long"`, `"short"`, or `"narrow"` identifying the formatting style used for the years field.</li>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is fractionalDigits option?

README.md Outdated Show resolved Hide resolved
@ryzokuken
Copy link
Member Author

Thanks @sffc and @justingrant.

@ryzokuken
Copy link
Member Author

@justingrant does this note seem good?

@justingrant
Copy link

does this note seem good?

Text for fractionalDigits is OK, but I'd suggest adding a few examples to show how it works. It's a pretty confusing option to explain with only text. Also, may want to link to #64 and/or other open issues around this option.

@ryzokuken
Copy link
Member Author

@justingrant this should do it, right? Seems like the explainer is good to go, would you mind if I extracted the spec commits from this and merged the explainer?

README.md Outdated Show resolved Hide resolved
@justingrant
Copy link

Seems like the explainer is good to go, would you mind if I extracted the spec commits from this and merged the explainer?

I'd prefer to see an options summary section added (see #66 (comment)) before merging the new explainer. I think removing the spec updates to a separate PR makes sense to iterate on both in parallel.

@ryzokuken
Copy link
Member Author

@justingrant could you check it out now and let me know how it looks?

Copy link

@justingrant justingrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the new reference section, because it helps highlight some possible disconnects. Lots of comments below!

README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated
* `minutesDisplay` (`String`): When to display minutes. `"auto"` means that minutes won't be displayed if they are zero. Can be either `"always"` or `"auto"`. Defaults to `"auto"` if `minutes` is `undefined` and `"always"` otherwise.
* `seconds` (`String`): The style to be used for formatting seconds. Can be one of `"long"`, `"short"`, or `"narrow"`. Defaults to the value of `style`.
* `secondsDisplay` (`String`): When to display seconds. `"auto"` means that seconds won't be displayed if they are zero. Can be either `"always"` or `"auto"`. Defaults to `"auto"` if `seconds` is `undefined` and `"always"` otherwise.
* `milliseconds` (`String`): The style to be used for formatting milliseconds. Can be one of `"long"`, `"short"`, or `"narrow"`. Defaults to the value of `style`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expect some discussion here (and in the microseconds and nanoseconds docs below) about:

  • when ms/μs/ns values will be displayed as decimals after seconds (or after milliseconds or microseconds for smaller units) and when they'll be displayed as standalone values like "123 ms".
  • how fractionalDigits affects display of ms/μs/ns units
  • whether trailing zeroes are shown or hidden by default

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link

@justingrant justingrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New content looks really good. Makes it much easier to understand, and also easy to highlight a small number of things that I commented on. I didn't review the spec yet but can do that once the explainer content is revised.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New content is much clearer and easier to understand. Thanks!

README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
Copy link

@justingrant justingrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explainer text looks great, modulo a few minor comments I added. I moved on to review the spec and it looks like a few things are missing there, e.g. fractionalDigits, the numeric->2-digit upgrade, defaults for digital style (maybe), etc.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
spec.emu Outdated
@@ -331,7 +445,26 @@ contributors: Ujjwal Sharma, Younies Mahmoud
<li>[[DataLocale]] is a String value with the language tag of the nearest locale for which the implementation has data to perform the formatting operation. It will be a parent locale of [[Locale]].</li>
<li>[[NumberingSystem]] is a String value with the `"type"` given in Unicode Technical Standard 35 for the numbering system used for formatting.</li>
<li>[[Style]] is one of the String values `"long"`, `"short"`, `"narrow"`, or `"digital"` identifying the duration formatting style used.</li>
<li>[[Fields]] is a List value specifying which duration fields are required to be printed.</li>
<li>[[YearsStyle]] is one of the String values `"long"`, `"short"`, or `"narrow"` identifying the formatting style used for the years field.</li>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is fractionalDigits?

spec.emu Outdated
1. Set _stylesList_ to the list-concatenation of _stylesList_ and &laquo; "2-digit" &raquo;.
1. Let _style_ be ? GetOption(_options_, _unit_, _stylesList_, *undefined*).
1. If _style_ is *undefined*, then
1. Set _style_ to _baseStyle_.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if baseStyle is digital?

spec.emu Outdated

<emu-alg>
1. Let _stylesList_ be the List &laquo; `"long"`, `"short"`, `"narrow"` &raquo;.
1. If _unit_ is one of `"hours"`, `"minutes"`, `"seconds"`, `"milliseconds"`, `"microseconds"`, or `"nanoseconds"`, then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does the upgrade from numeric to 2-digit happen?

spec.emu Outdated
<p>The GetUnitOptions abstract operation is called with the arguments _unit_ (which must be a String), _options_ (which must be an Object) and _baseStyle_ (which must be a String) and returns a Record containing the relevant options for that unit. The following steps are taken:</p>

<emu-alg>
1. Let _stylesList_ be the List &laquo; `"long"`, `"short"`, `"narrow"` &raquo;.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens with weird styles, e.g. {hours: numeric, minutes: 'long'}. Error? Does "long" get upgraded to 2-digit? Something else?

@ryzokuken
Copy link
Member Author

@justingrant do you think it's okay to merge this if I take the spec changes out and file a different PR for them?

@justingrant
Copy link

@justingrant do you think it's okay to merge this if I take the spec changes out and file a different PR for them?

I'm OK with splitting into different PRs, but there are still two outstanding comments on the explainer content that probably should be addressed before merging.

@ryzokuken
Copy link
Member Author

@justingrant does the explainer look good to go now?

@ryzokuken
Copy link
Member Author

@justingrant can I merge this now? Thanks.

Copy link

@justingrant justingrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for doing all the explainer fixes, we caught and resolved some useful things.

@ryzokuken ryzokuken merged commit 84aec32 into tc39:master Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants