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

feat(compiler): extract directive docs info #51697

Closed
wants to merge 3 commits into from

Conversation

jelbourn
Copy link
Member

@jelbourn jelbourn commented Sep 7, 2023

Based on top of #51685

This expands on the extraction with information for directives, including inputs and outputs. As part of this change, I've refactored the extraction code related to class and to directives into their own extractor classes to more cleanly separate extraction logic based on type of statement.

cc @devversion

@jelbourn jelbourn added area: compiler Issues related to `ngc`, Angular's template compiler target: minor This PR is targeted for the next minor release labels Sep 7, 2023
@ngbot ngbot bot modified the milestone: Backlog Sep 7, 2023
@pullapprove pullapprove bot requested a review from atscott September 7, 2023 20:32
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Sep 7, 2023
jelbourn added a commit to jelbourn/angular that referenced this pull request Sep 8, 2023
Based on top of angular#51697

Adds extraction for accessors (getters/setters), rest params, and resolved type info for everything so far. This also refactors function extraction into a new class and splits tests for common class info and directive info into separate files.
jelbourn added a commit to jelbourn/angular that referenced this pull request Sep 8, 2023
Based on top of angular#51697

Adds extraction for accessors (getters/setters), rest params, and resolved type info for everything so far. This also refactors function extraction into a new class and splits tests for common class info and directive info into separate files.
/** Extractor to pull info for API reference documentation for a TypeScript class. */
class ClassExtractor {
constructor(
protected declaration: ClassDeclaration,
Copy link
Contributor

Choose a reason for hiding this comment

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

It's somewhat unclear to me what things actually need to be protected here. It seems like just the extract and extractClassProperty methods. reference and checker aren't used at all, at least in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

My thought process was to make methods that were a "top-level" part of extracting class info protected, but keep things that were more implementation details private. In reality it doesn't really matter, since the class isn't even exported.

checker is used in the next commit to get type info. I think I will need Reference in a future change to get information about which package and/or the symbol comes from, but that is admittedly speculative based on my limited knowledge of the compiler.

@angular-robot angular-robot bot requested a review from atscott September 8, 2023 17:06
jelbourn added a commit to jelbourn/angular that referenced this pull request Sep 8, 2023
Based on top of angular#51697

Adds extraction for accessors (getters/setters), rest params, and resolved type info for everything so far. This also refactors function extraction into a new class and splits tests for common class info and directive info into separate files.
This commit adds a barebones skeleton for extracting information to be used for extracting info that can be used for API reference generation. Subsequent PRs will expand on this with increasingly real extraction. I started with @alxhub's angular#51615 and very slightly polished to get to this minimal commit.
Based on top of angular#51682

This expands on the skeleton previously added to extract docs info for classes, including properties, methods, and method parameters. Type information and Angular-specific info (e.g. inputs) will come in future PRs.
Based on top of angular#51685

This expands on the extraction with information for directives, including inputs and outputs. As part of this change, I've refactored the extraction code related to class and to directives into their own extractor classes to more cleanly separate extraction logic based on type of statement.
jelbourn added a commit to jelbourn/angular that referenced this pull request Sep 9, 2023
Based on top of angular#51697

Adds extraction for accessors (getters/setters), rest params, and resolved type info for everything so far. This also refactors function extraction into a new class and splits tests for common class info and directive info into separate files.
@jelbourn jelbourn removed the request for review from atscott September 14, 2023 16:27
jelbourn added a commit to jelbourn/angular that referenced this pull request Sep 15, 2023
Based on top of angular#51697

Adds extraction for accessors (getters/setters), rest params, and resolved type info for everything so far. This also refactors function extraction into a new class and splits tests for common class info and directive info into separate files.
jelbourn added a commit to jelbourn/angular that referenced this pull request Sep 15, 2023
Based on top of angular#51697

Adds extraction for accessors (getters/setters), rest params, and resolved type info for everything so far. This also refactors function extraction into a new class and splits tests for common class info and directive info into separate files.
pkozlowski-opensource pushed a commit that referenced this pull request Sep 18, 2023
…51733)

Based on top of #51697

Adds extraction for accessors (getters/setters), rest params, and resolved type info for everything so far. This also refactors function extraction into a new class and splits tests for common class info and directive info into separate files.

PR Close #51733
@jelbourn
Copy link
Member Author

Changes merged in #51733

@jelbourn jelbourn closed this Sep 18, 2023
@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 Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: compiler Issues related to `ngc`, Angular's template compiler detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants