Skip to content

API doc for pipes - #24141

Closed
jbogarthyde wants to merge 4 commits into
angular:masterfrom
jbogarthyde:jb-apidoc-pipes
Closed

jbogarthyde wants to merge 4 commits into
angular:masterfrom
jbogarthyde:jb-apidoc-pipes

Conversation

@jbogarthyde

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[x] Documentation content changes
[ ] angular.io application / infrastructure changes
[ ] Other... Please describe:

Does this PR introduce a breaking change?

[ ] Yes
[x] No
 

@jbogarthyde

Copy link
Copy Markdown
Contributor Author

@petebacondarwin FYI

@mary-poppins

Copy link
Copy Markdown

You can preview f8e6cbb at https://pr24141-f8e6cbb.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview e3d0b77 at https://pr24141-e3d0b77.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview db133ab at https://pr24141-db133ab.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview c06c867 at https://pr24141-c06c867.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview dd0d78c at https://pr24141-dd0d78c.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview 4b9b3c3 at https://pr24141-4b9b3c3.ngbuilds.io/.

@jenniferfell jenniferfell added area: common Issues related to APIs in the @angular/common package action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Jun 14, 2018

@jenniferfell jenniferfell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved with one change: Please change to "deprecated in v5" or similar (v "from v5").

Other comments....Please file an issue against caps style in auto-generated headings. Of my other comments, the rest are minor editorial.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

whitespace-separated word

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lower case.

Comment thread packages/common/src/pipes/date_pipe.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No comma when second clause is dependent. "The pipe uses the Internationalization API and is therefore only reliable in Chrome and Opera browsers."

Comment thread packages/common/src/pipes/date_pipe.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

reevaluated

Comment thread packages/common/src/pipes/date_pipe.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"and so on" - delete? change to "or other formatting characteristics"?

Comment thread packages/common/src/pipes/date_pipe.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Predefined (one word)

Comment thread packages/common/src/pipes/date_pipe.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you want en-US in single quotes or backticks or none? Above "en-US locale" has no special treatment. Let's standardize how to handle locale names. You choose.

Comment thread packages/common/src/pipes/date_pipe.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should use sentence case in table column headers, so it matches heading cap style everywhere else in docs.

Comment thread packages/common/src/pipes/json_pipe.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Need to file an issue. Usage notes heading should be sentence caps, not title caps.

Comment thread packages/common/src/pipes/date_pipe.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Need to file an issue. Input values heading should be sentence caps, not title caps.

@jenniferfell
jenniferfell requested a review from vicb June 14, 2018 18:21
@jenniferfell

Copy link
Copy Markdown
Contributor

@jbogarthyde If this is no longer just to test the new template and generator, pls update the title. Thanks!

@mary-poppins

Copy link
Copy Markdown

You can preview e2b9786 at https://pr24141-e2b9786.ngbuilds.io/.

@jbogarthyde

Copy link
Copy Markdown
Contributor Author

We are still testing the template, leaving title alone.

@mary-poppins

Copy link
Copy Markdown

You can preview 1595762 at https://pr24141-1595762.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview de04249 at https://pr24141-de04249.ngbuilds.io/.

@jbogarthyde
jbogarthyde force-pushed the jb-apidoc-pipes branch 2 times, most recently from 9a4c770 to 46097e4 Compare June 15, 2018 15:58
@mary-poppins

Copy link
Copy Markdown

You can preview 46097e4 at https://pr24141-46097e4.ngbuilds.io/.

@vicb vicb Jun 16, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would replace

+   * @param value The string to transform, with words delimited by any whitespace character,
+   * such a space, tab, or line-feed character.

with

+   * @param value The text to convert to lower case.

I don't think trying to define what a "word" is helps and I'm not sure if this is correct definition anyway.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not adressed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oops - wrong one, this should only be in title-case. Removing it.

@vicb vicb Jun 16, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sounds like we are repeating the same thing twice ?
Replace whitespace-separated word with word as the former is wrong.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure how this get rendered but the text itself adds no value IMO.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is a general rule of our new API guidelines that all code examples should be introduced with a text description of what the code is an example of. In this case, it doesn't add a whole lot of value, but it is still required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Most code examples show some specific thing -- it helps the reader know where to look in the code if you first tell them what it is supposed to show. This is part of reducing cognitive load for the reader, by making each point as explicit as possible.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same comment as earlier. I would use @param value The text to convert to title case

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For TitleCasePipe it might be valueable to explicitly mention that whitespace is used as the separator, especially since the behavior was different in the past (e.g. - where treated as boundaries, but not any more).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not adressed.

Comment thread packages/common/src/pipes/date_pipe.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

Comment thread packages/common/src/pipes/date_pipe.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

still confusing/wrong.
each locale has 2 sets of data: the "regular" one and the "extra" one. * means the extra one, this is what the former description stated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK, got it.

Comment thread packages/common/src/pipes/date_pipe.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

in the _local_ time this was important too

vicb
vicb previously requested changes Jun 19, 2018

@vicb vicb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the updates.
A few more comments

@mary-poppins

Copy link
Copy Markdown

You can preview a4f7473 at https://pr24141-a4f7473.ngbuilds.io/.

@jbogarthyde

Copy link
Copy Markdown
Contributor Author

Addressed comments, and some more small fixes.

@mary-poppins

Copy link
Copy Markdown

You can preview de33116 at https://pr24141-de33116.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview 449373b at https://pr24141-449373b.ngbuilds.io/.

@jbogarthyde

Copy link
Copy Markdown
Contributor Author

@vicb @ocombe
I believe I have made all your requested changes. I think this can go green if you both remove your "changes requested" status, and vic can do pull-approve.
Travis build appears to be failing for unrelated reasons - the preview built fine.
Please let me know if there is anything else I need to do to get this landed.

@jenniferfell jenniferfell added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 20, 2018
@mhevery

mhevery commented Jun 21, 2018

Copy link
Copy Markdown
Contributor

@mhevery
mhevery dismissed vicb’s stale review June 25, 2018 15:06

Comments addressed, Vic on vacation.

@jasonaden jasonaden closed this in d244523 Jun 25, 2018
jasonaden pushed a commit that referenced this pull request Jun 25, 2018
@cexbrayat

Copy link
Copy Markdown
Member

If I may (and @ocombe will correct me if I'm wrong), I think the docs for the currency pipe should also mention that if digitsInfo is not provided, then the format is determined by the pipe itself based on the currency: {{ 14 | currency:'CAD' }} gives $CA14.00, whereas {{ 14 | currency:'CLP' }} gives CLP14 because chilean pesos don't have cents.
Or maybe that should be in https://github.com/angular/angular/blob/master/packages/examples/common/pipes/ts/currency_pipe.ts I don't know.

I can submit a PR if you agree (unrelated, but I think there is an error in the example https://github.com/angular/angular/blob/master/packages/examples/common/pipes/ts/currency_pipe.ts#L21)

@ocombe

ocombe commented Jun 25, 2018

Copy link
Copy Markdown
Contributor

That is true, the number of digits for rounding depends on the locale

@cexbrayat cexbrayat mentioned this pull request Jun 25, 2018
3 tasks done
@cexbrayat

Copy link
Copy Markdown
Member

@ocombe 👍 I pushed #24661 to make it more obvious in the docs, added an example and fix an error with a current one. Let me know what you think when you have the occasion.

@jbogarthyde
jbogarthyde deleted the jb-apidoc-pipes branch June 28, 2018 18:03
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: common Issues related to APIs in the @angular/common package cla: yes target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants