-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
base: main
Are you sure you want to change the base?
Conversation
ee859e1
to
5ee7821
Compare
5ee7821
to
24a0b56
Compare
blocked on #60409 |
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. |
9952d8c
to
7d81125
Compare
cd8fb77
to
3c2209c
Compare
55a3f08
to
f66057c
Compare
5292815
to
b9507a0
Compare
78950fa
to
bccb49c
Compare
bccb49c
to
8a139a5
Compare
@@ -16,6 +16,7 @@ export enum EntryType { | |||
Component = 'component', | |||
Constant = 'constant', | |||
Decorator = 'decorator', | |||
InterfaceLikeDecorator = 'interface_like_decorator', |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"
adev/shared-docs/pipeline/api-gen/rendering/transforms/code-transforms.mts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/docs/src/decorator_extractor.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/docs/src/decorator_extractor.ts
Outdated
Show resolved
Hide resolved
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. |
adev/shared-docs/pipeline/api-gen/rendering/templates/decorator-reference.tsx
Outdated
Show resolved
Hide resolved
<div className={API_REFERENCE_CONTAINER}> | ||
<HeaderApi entry={entry} /> | ||
<SectionApi entry={entry} /> | ||
<SectionDescription entry={entry} /> | ||
<SectionUsageNotes entry={entry} /> | ||
</div> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
8a139a5
to
b643df0
Compare
b643df0
to
7ffda6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
7ffda6b
to
14a28b2
Compare
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...)
14a28b2
to
e8f4bcc
Compare
fixes #60244