Skip to content

docs(docs-infra): Improve support of decorators in the API pages #60411

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JeanMeche
Copy link
Member

@JeanMeche JeanMeche commented Mar 16, 2025

fixes #60244

@angular-robot angular-robot bot added area: docs Related to the documentation area: docs-infra Angular.dev application and infrastructure labels Mar 16, 2025
@ngbot ngbot bot added this to the Backlog milestone Mar 16, 2025
@JeanMeche JeanMeche changed the title WIP: 603b1c131e docs(docs-infra): Extract class constructors docs(docs-infra): Support aliased decorators in the API pages Mar 16, 2025
@JeanMeche
Copy link
Member Author

blocked on #60409

Copy link

github-actions bot commented Mar 16, 2025

Deployed adev-preview for e8f4bcc to: https://ng-dev-previews-fw--pr-angular-angular-60411-adev-prev-7htmawu8.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

@JeanMeche JeanMeche force-pushed the docs/decorators branch 8 times, most recently from 9952d8c to 7d81125 Compare March 17, 2025 00:55
@JeanMeche JeanMeche force-pushed the docs/decorators branch 2 times, most recently from cd8fb77 to 3c2209c Compare March 19, 2025 00:06
@JeanMeche JeanMeche force-pushed the docs/decorators branch 3 times, most recently from 55a3f08 to f66057c Compare May 6, 2025 09:00
@JeanMeche JeanMeche force-pushed the docs/decorators branch 6 times, most recently from 5292815 to b9507a0 Compare May 21, 2025 02:07
@JeanMeche JeanMeche force-pushed the docs/decorators branch 5 times, most recently from 78950fa to bccb49c Compare May 22, 2025 02:24
@JeanMeche JeanMeche marked this pull request as ready for review May 22, 2025 02:26
@JeanMeche JeanMeche changed the title docs(docs-infra): Support aliased decorators in the API pages docs(docs-infra): Improve support of decorators in the API pages May 22, 2025
@@ -16,6 +16,7 @@ export enum EntryType {
Component = 'component',
Constant = 'constant',
Decorator = 'decorator',
InterfaceLikeDecorator = 'interface_like_decorator',
Copy link
Member

Choose a reason for hiding this comment

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

Question: Not entirely sure I understand the naming. Aren't all decorators have/described as interfaces?

Copy link
Member

Choose a reason for hiding this comment

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

I think we should just name this decorator

Copy link
Member Author

Choose a reason for hiding this comment

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

We already has decorator though.
My idea is to have 2 distinct code path for the 2 kinds of decorators.

Copy link
Member

Choose a reason for hiding this comment

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

I'd need to look more at this PR, but I'd expect both types of decorators to share the same "entry type"

@hawkgs
Copy link
Member

hawkgs commented May 23, 2025

Since I am not very familiar with this part of the docs-infra and I am not sure that I can give a meaningful feedback, I'll let other reviewers chime in as well.

Comment on lines +20 to +25
<div className={API_REFERENCE_CONTAINER}>
<HeaderApi entry={entry} />
<SectionApi entry={entry} />
<SectionDescription entry={entry} />
<SectionUsageNotes entry={entry} />
</div>
Copy link
Member

Choose a reason for hiding this comment

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

Question: The reference member cards won't exist for these decorators?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we should be able to match the same behavior as functions.
Let me see what I can do

Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

@devversion devversion removed their request for review June 23, 2025 11:49
@JeanMeche JeanMeche marked this pull request as draft June 23, 2025 21:43
The commit introduce the distinction between

- class like decorators (like Component, Interface, NgModule. They are formatted like classes/interfaces, with each attribute being documents.
- function like decorators (Attribute, Host, Optional...)
@JeanMeche JeanMeche marked this pull request as ready for review June 24, 2025 16:13
@JeanMeche JeanMeche requested a review from devversion June 27, 2025 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adev: preview area: docs Related to the documentation area: docs-infra Angular.dev application and infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@ViewChildren metadata options in doc are not correct
4 participants