[17.3.x]: Patch port of angular.dev signal API docs generation changes#55053
Closed
devversion wants to merge 7 commits intoangular:17.3.xfrom
Closed
[17.3.x]: Patch port of angular.dev signal API docs generation changes#55053devversion wants to merge 7 commits intoangular:17.3.xfrom
devversion wants to merge 7 commits intoangular:17.3.xfrom
Conversation
crisbeto
previously approved these changes
Mar 26, 2024
5b65f4a to
530f1b0
Compare
530f1b0 to
6e3bbdd
Compare
Contributor
|
Looks like this one needs a rebase. |
This commit adds support for extracting initializer API functions. Initialixer API functions are functions conceptually that can are intended to be used as class member initializers. Angular started introducing a few of these for the new signal APIs, like `input`, `model` or signal-based queries. These APIs are currently confusingly represented in the API docs because the API extraction: - does not properly account for call signatures of interfaces - does not expose information about sub-property objects and call signatures (e.g. `input.required`) - the docs rendering syntax highlighting is too bloated and confusing with all types being included. This commit adds support for initializer API functions, namely two variants: - interface-based initializer APIs. e.g. `export const input: InputFunction`- which is a pattern for `input` and `input.required`. - function-based simpler initializer APIs with overloads. e.g. `contentChildren` has many signatures but doesn't need to be an interface as there are no sub-property call signatures.
This commit ensures that extracted initializer API functions are showing up in angular.dev and can be filtered.
…ev support This commit improves the API documentation for `input` after we added support for initializer APIs in angular.dev docs generation. Changes: - Rename `ReadT` to `T`. This conceptually makes it easy to talk about inputs of type `T` if there is no transform involved. The common case. - Rename `WriteT` to `TransformT`. This makes it clear that this is the type that the "transform" needs to handle. - Improves the "overall" description of the input function so that it can be shown as a general overview for the API site. - Improves usage notes to be a little more helpful, yielding more useful content in the API docs usage notes section. - Add short JSDoc description for each individual overload.
Improves the API documentation for `model`, similarly to how we updated the `input` function.
This improves the API documentatino for `output` in angular.dev, similar to how we improved the API for `input`. Angular.dev can now show these documentation entries more readable if annotated explicitly as initializer API. Note: output API is short enough that we want to include the types in the code snippet previews.
Similar to `input`, `model`, `output`, the query initializer APIs are also explicitly denoted as such. This allows angular.dev to display them more readable and compactly.
…extraction This commit adds support for ignoring specific doc entries when extracting doc entries. This allows us to drop e.g. `InputFunction` from the API docs, given that the `input` API entry holds all the relevant information. `InputFunction` only exists for type purposes in the `.d.ts`.
6e3bbdd to
67c2956
Compare
dylhunn
approved these changes
Mar 28, 2024
Contributor
|
This PR was merged into the repository by commit ee76001. |
dylhunn
pushed a commit
that referenced
this pull request
Mar 28, 2024
…55053) This commit adds support for extracting initializer API functions. Initialixer API functions are functions conceptually that can are intended to be used as class member initializers. Angular started introducing a few of these for the new signal APIs, like `input`, `model` or signal-based queries. These APIs are currently confusingly represented in the API docs because the API extraction: - does not properly account for call signatures of interfaces - does not expose information about sub-property objects and call signatures (e.g. `input.required`) - the docs rendering syntax highlighting is too bloated and confusing with all types being included. This commit adds support for initializer API functions, namely two variants: - interface-based initializer APIs. e.g. `export const input: InputFunction`- which is a pattern for `input` and `input.required`. - function-based simpler initializer APIs with overloads. e.g. `contentChildren` has many signatures but doesn't need to be an interface as there are no sub-property call signatures. PR Close #55053
dylhunn
pushed a commit
that referenced
this pull request
Mar 28, 2024
This commit ensures that extracted initializer API functions are showing up in angular.dev and can be filtered. PR Close #55053
dylhunn
pushed a commit
that referenced
this pull request
Mar 28, 2024
…ev support (#55053) This commit improves the API documentation for `input` after we added support for initializer APIs in angular.dev docs generation. Changes: - Rename `ReadT` to `T`. This conceptually makes it easy to talk about inputs of type `T` if there is no transform involved. The common case. - Rename `WriteT` to `TransformT`. This makes it clear that this is the type that the "transform" needs to handle. - Improves the "overall" description of the input function so that it can be shown as a general overview for the API site. - Improves usage notes to be a little more helpful, yielding more useful content in the API docs usage notes section. - Add short JSDoc description for each individual overload. PR Close #55053
dylhunn
pushed a commit
that referenced
this pull request
Mar 28, 2024
dylhunn
pushed a commit
that referenced
this pull request
Mar 28, 2024
This improves the API documentatino for `output` in angular.dev, similar to how we improved the API for `input`. Angular.dev can now show these documentation entries more readable if annotated explicitly as initializer API. Note: output API is short enough that we want to include the types in the code snippet previews. PR Close #55053
dylhunn
pushed a commit
that referenced
this pull request
Mar 28, 2024
…extraction (#55053) This commit adds support for ignoring specific doc entries when extracting doc entries. This allows us to drop e.g. `InputFunction` from the API docs, given that the `input` API entry holds all the relevant information. `InputFunction` only exists for type purposes in the `.d.ts`. PR Close #55053
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Patch port of #54925