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

build(docs-infra): add final labels to classes in API pages #42807

Closed

Conversation

petebacondarwin
Copy link
Contributor

@petebacondarwin petebacondarwin commented Jul 9, 2021

This change will mark classes as final unless they have been annotated
with an @extensible jsdoc tag.

Fixes #42802

For example:

Screenshot 2021-07-09 at 16 50 06

@google-cla google-cla bot added the cla: yes label Jul 9, 2021
@petebacondarwin petebacondarwin added comp: docs-infra state: WIP target: patch This PR is targeted for the next patch release labels Jul 9, 2021
@ngbot ngbot bot modified the milestone: Backlog Jul 9, 2021
@mary-poppins
Copy link

You can preview b4564e0 at https://pr42807-b4564e0.ngbuilds.io/.

@gkalpak gkalpak added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Jul 10, 2021
@mary-poppins
Copy link

You can preview 755fdf2 at https://pr42807-755fdf2.ngbuilds.io/.

@petebacondarwin
Copy link
Contributor Author

@gkalpak and @AndrewKushnir - I changed the label to final and made it a link. I am not sure this is a good UI though (to have one of these labels clickable). So I also tried out adding a line of boilerplate text under the short-description too.

For an example see https://pr42807-755fdf2.ngbuilds.io/api/forms/FormGroup

Screenshot 2021-07-12 at 12 28 46

Please take a look and let me know your thoughts.

@petebacondarwin petebacondarwin removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Jul 12, 2021
@petebacondarwin petebacondarwin changed the title build(docs-infra): add sealed markers to classes in API pages build(docs-infra): add final labels to classes in API pages Jul 12, 2021
@petebacondarwin
Copy link
Contributor Author

OK, third iteration: George and I thought that putting the "This class is "final"..." text in the short description drew too much attention to it, and would actually be more confusing.

So now, I have moved that text to the constructor's short description (if there is a constructor).

Screenshot 2021-07-12 at 16 25 03

@mary-poppins
Copy link

You can preview 1717ccb at https://pr42807-1717ccb.ngbuilds.io/.

aio/src/styles/2-modules/api-pages/_api-pages.scss Outdated Show resolved Hide resolved
aio/tools/transforms/templates/api/lib/memberHelpers.html Outdated Show resolved Hide resolved
aio/tools/transforms/templates/api/base.template.html Outdated Show resolved Hide resolved
@petebacondarwin petebacondarwin added action: review The PR is still awaiting reviews from at least one requested reviewer and removed state: WIP labels Jul 14, 2021
@mary-poppins
Copy link

You can preview 74291f7 at https://pr42807-74291f7.ngbuilds.io/.

@mary-poppins
Copy link

You can preview aef35d3 at https://pr42807-aef35d3.ngbuilds.io/.

Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

Looks great, thanks Pete 👍

@petebacondarwin petebacondarwin marked this pull request as ready for review July 15, 2021 07:13
@pullapprove pullapprove bot requested a review from jelbourn July 15, 2021 07:13
@gkalpak
Copy link
Member

gkalpak commented Jul 15, 2021

Apart from that the only concrete class I could find that is designed to be extended is UpgradeComponent.
@gkalpak / @AndrewKushnir do you know of any others?

I don't 😃

@mary-poppins
Copy link

You can preview 4e253db at https://pr42807-4e253db.ngbuilds.io/.

Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

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

One question. Otherwise lgtm 🚀

@@ -26,6 +26,9 @@ <h1>{$ doc.name | escape $}</h1>
{% if doc.deprecated !== undefined %}<label class="api-status-label deprecated">deprecated</label>{% endif %}
{% if doc.security !== undefined %}<label class="api-status-label security">security</label>{% endif %}
{% if doc.pipeOptions.pure === 'false' %}<label class="api-status-label impure-pipe">impure</label>{% endif %}
{% if doc.docType === 'class' and doc.extensible !== true and not doc.isAbstract %}<label class="github-links api-status-label final" title="This class should not be extended.">
Copy link
Member

Choose a reason for hiding this comment

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

What about other docTypes, such as ngmodule (see for example CommonModule) or directive (see for example NgIf)?

Don't we need to also mark them as "final" (even if they don't have a public constructor most of the time)?

(NOTE: If we change the logic here, the same changes should be applied in memberHelpers.html.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah - I decided that we should start with only classes, since they are more likely to feel like they can be extended. Also those kinds of classes are rendered in the docs in a way that doesn't make it so obvious that they are classes.

We can easily add that at a later stage if it looks useful.

@petebacondarwin petebacondarwin requested review from IgorMinar and removed request for jelbourn July 22, 2021 11:46
@petebacondarwin petebacondarwin removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 17, 2021
@petebacondarwin petebacondarwin removed the request for review from IgorMinar August 17, 2021 15:10
@pullapprove pullapprove bot requested a review from jelbourn August 17, 2021 15:10
This change will mark classes as `sealed` unless they have been annotated
with an `@extensible` jsdoc tag.

Fixes angular#42802
This class is designed to be used as a base class. Therefore it should not be
marked as `final` in the API docs.
@petebacondarwin petebacondarwin added action: merge The PR is ready for merge by the caretaker action: presubmit The PR is in need of a google3 presubmit labels Aug 17, 2021
@petebacondarwin
Copy link
Contributor Author

@AndrewKushnir - can you override the presubmit check, since this PR only changes a comment in code that will be synched to G3?

@mary-poppins
Copy link

You can preview 5879ed9 at https://pr42807-5879ed9.ngbuilds.io/.

@AndrewKushnir AndrewKushnir removed the action: presubmit The PR is in need of a google3 presubmit label Aug 17, 2021
@AndrewKushnir
Copy link
Contributor

can you override the presubmit check, since this PR only changes a comment in code that will be synched to G3?

@petebacondarwin done! I'm adding "merge-assistance" label and this PR should be ready for merge. Thanks for implementing that Pete 👍

@AndrewKushnir AndrewKushnir added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Aug 17, 2021
@AndrewKushnir
Copy link
Contributor

Merge-assistance: Pete has global docs approval permissions and this PR was reviewed and approved by 2 engineers, so this PR is ready for merge now.

@dylhunn dylhunn closed this in e4e98ed Aug 17, 2021
dylhunn pushed a commit that referenced this pull request Aug 17, 2021
)

This class is designed to be used as a base class. Therefore it should not be
marked as `final` in the API docs.

PR Close #42807
dylhunn pushed a commit that referenced this pull request Aug 17, 2021
This change will mark classes as `sealed` unless they have been annotated
with an `@extensible` jsdoc tag.

Fixes #42802

PR Close #42807
dylhunn pushed a commit that referenced this pull request Aug 17, 2021
)

This class is designed to be used as a base class. Therefore it should not be
marked as `final` in the API docs.

PR Close #42807
@petebacondarwin petebacondarwin deleted the docs-infra-sealed branch August 17, 2021 16:26
TeriGlover pushed a commit to TeriGlover/angular that referenced this pull request Sep 16, 2021
…lar#42807)

This change will mark classes as `sealed` unless they have been annotated
with an `@extensible` jsdoc tag.

Fixes angular#42802

PR Close angular#42807
TeriGlover pushed a commit to TeriGlover/angular that referenced this pull request Sep 16, 2021
…ular#42807)

This class is designed to be used as a base class. Therefore it should not be
marked as `final` in the API docs.

PR Close angular#42807
@angular-automatic-lock-bot
Copy link

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 17, 2021
TeriGlover pushed a commit to TeriGlover/angular that referenced this pull request Sep 22, 2021
…lar#42807)

This change will mark classes as `sealed` unless they have been annotated
with an `@extensible` jsdoc tag.

Fixes angular#42802

PR Close angular#42807
TeriGlover pushed a commit to TeriGlover/angular that referenced this pull request Sep 22, 2021
…ular#42807)

This class is designed to be used as a base class. Therefore it should not be
marked as `final` in the API docs.

PR Close angular#42807
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 cla: yes merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AIO: indicate which classes can be extended as a part of public API
4 participants