-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
refactor(compiler-cli): Don't extract type implementations #56489
base: main
Are you sure you want to change the base?
Conversation
Deployed adev-preview for 6d930af to: https://ng-dev-previews-fw--pr-angular-angular-56489-adev-prev-7lmdybs8.web.app Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt. |
9b55473
to
3f0010d
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.
This needs a test (e.g. in https://github.com/angular/angular/blob/0d78a92431178be73342aeddda4b62d9e49138ba/packages/compiler-cli/test/ngtsc/doc_extraction/doc_extraction_filtering_spec.ts#L20
) and ideally also a comment in getDeclarationOfSymbol
with background on why this flag exists.
d13a390
to
049e797
Compare
packages/compiler-cli/test/ngtsc/doc_extraction/doc_extraction_filtering_spec.ts
Outdated
Show resolved
Hide resolved
getExportsOfModule(node: ts.Node): Map<string, Declaration> | null { | ||
getExportsOfModule( | ||
node: ts.Node, | ||
skipPrivateValueDeclarationTypes: boolean = false, |
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.
The compiler typically avoids using defaulted args to make every caller consider the value instead of assuming the default. This case is a bit debatable given that the flag isn't typically desired, so from that perspective I can see how keeping the default makes sense, but it does make me wonder if this is more appropriate as a class field passed via the constructor.
049e797
to
18bb248
Compare
getExportsOfModule(node: ts.Node): Map<string, Declaration> | null { | ||
getExportsOfModule( | ||
node: ts.Node, | ||
skipPrivateValueDeclarationTypes: boolean = false, |
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.
Can be reverted now
@@ -30,10 +30,16 @@ import {isNamedClassDeclaration} from './util'; | |||
* reflector.ts implements static reflection of declarations using the TypeScript `ts.TypeChecker`. | |||
*/ | |||
|
|||
/** |
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.
This ought to be the docblock for the parameter itself, or the constructor alternatively, not the class
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.
18bb248
to
6d930af
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.
Thanks for all the updates!
This is useful for cases like class
FormControl
is defined asinterface
but the actual implementation uses a private typeexport const FormControl: ɵFormControlCtor
.fixes #56144
Demo: https://ng-dev-previews-fw--pr-angular-angular-56489-adev-prev-1fannvm9.web.app/api/forms/FormControl#usage-notes