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

docs: show overloads for functions #55565

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JeanMeche
Copy link
Member

@JeanMeche JeanMeche commented Apr 26, 2024

@angular-robot angular-robot bot added the area: docs Related to the documentation label Apr 26, 2024
@ngbot ngbot bot added this to the Backlog milestone Apr 26, 2024
Copy link

github-actions bot commented Apr 26, 2024

Deployed adev-preview for 91b9854 to: https://ng-dev-previews-fw--pr-angular-angular-55565-adev-prev-nmdfexi2.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/fix-fn-overloads branch 3 times, most recently from 68a91a7 to 2f7994b Compare April 27, 2024 22:19
@JeanMeche JeanMeche force-pushed the docs/fix-fn-overloads branch 19 times, most recently from a95b7ee to 23c7caf Compare May 2, 2024 16:39
@JeanMeche JeanMeche marked this pull request as ready for review May 2, 2024 19:35
@pullapprove pullapprove bot requested review from devversion and JoostK May 2, 2024 19:35
@JoostK
Copy link
Member

JoostK commented May 2, 2024

I haven't looked in depth yet, but I'd appreciate if the tooling updates can be pulled out into a dedicated commit, independent of the compiler changes for multiple signatures.

@JeanMeche
Copy link
Member Author

JeanMeche commented May 2, 2024

Sure, let me split the changes into 2 commits.

@@ -134,6 +134,10 @@ export interface FunctionEntry extends DocEntry {
isNewType: boolean;
}

export interface FunctionWithOverloadsEntry extends FunctionEntry {
Copy link
Member

Choose a reason for hiding this comment

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

We should instead re-use what I've built for initializer APIs: FunctionWithOverloads

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 function extractor should instead return such entry, which has clear implementation + signatures

Copy link
Member Author

@JeanMeche JeanMeche May 4, 2024

Choose a reason for hiding this comment

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

I thought about reusing it too but went with another type because the extractor needs to return a DocEntry which FunctionWithOverloads doesnt extend.

I'm still open to suggestions.

Copy link
Member

Choose a reason for hiding this comment

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

I'm thinking about an entry like we have for initializer APIs, with clear separation of implementation + signatures. Maybe we can share that one and use for both? and name it FunctionEntry, while the existing FunctionEntry becomes FunctionMetadata or similar

in order for the docs to process function entry, this commit refactor function extraction by keeping the implementation as a the default entry and adds all the overloads into a separate array of entries.
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: inject() is missing all overloads
3 participants