Skip to content

chore(dgeni): better extraction of directive metadata #9387

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

Merged
merged 2 commits into from
Jan 24, 2018

Conversation

devversion
Copy link
Member

  • No longer extracts the directive/component metadata using Regular Expressions.
  • Fixes that inherited properties from interfaces or super-classes are not showing up as inputs/outputs if they are specified in the component/directive metadata.
  • Now handles multi-line selectors (this was not possible using the Regular Expression)
  • Fixes that merged inherited properties have a reference to the original document (this causes unexpected behavior; if properties are updated).

References #9299

@devversion devversion requested a review from jelbourn as a code owner January 14, 2018 14:51
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 14, 2018
@devversion devversion added the docs This issue is related to documentation label Jan 17, 2018
* export class MyComponent {}
* ```
*/
export function getDirectiveMetadata(classDoc: CategorizedClassDoc): DirectiveMetadata | null {
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 it would be better to not have the DirectiveMetadata type alias, since it makes it more immediately obvious how to interact with the metadata. Having it as DirectiveMetadata makes me think you do, e.g., metadata.selector, etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I'd still prefer having some kind of type alias, since the type is being used in multiple places. What about DirectiveMetadataMap?

Copy link
Member

Choose a reason for hiding this comment

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

I'd still prefer just the Map, since it's super obvious

Copy link
Member Author

@devversion devversion Jan 20, 2018

Choose a reason for hiding this comment

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

Yeah, doesn't really matter. Done

* Determines the component or directive metadata from the specified Dgeni class doc. The resolved
* directive metadata will be stored in a Map.
*
* Currently only string literal assignments and array literal assignments are supported.
Copy link
Member

Choose a reason for hiding this comment

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

Add "Other value types are not necessary because they are not needed for any user-facing documentation"

Copy link
Member Author

Choose a reason for hiding this comment

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

Done 👍

@devversion devversion force-pushed the chore/dgeni-parse-metadata branch from 45d29ac to 4918b9e Compare January 20, 2018 13:04
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM, just needs rebase

* No longer extracts the directive/component metadata using Regular Expressions.
* Fixes that inherited properties from interfaces or super-classes are not showing up as inputs/outputs if they are specified in the component/directive metadata.
* Now handles multi-line selectors (this was not possible using the Regular Expression)
* Fixes that merged inherited properties have a reference to the original document (this causes unexpected behavior; if properties are updated).

References angular#9299
@devversion devversion force-pushed the chore/dgeni-parse-metadata branch from 4918b9e to c011a66 Compare January 23, 2018 18:56
@devversion
Copy link
Member Author

@jelbourn Done.

@devversion devversion added action: merge The PR is ready for merge by the caretaker and removed pr: needs rebase labels Jan 23, 2018
@jelbourn jelbourn merged commit e0fc2bd into angular:master Jan 24, 2018
tinayuangao pushed a commit that referenced this pull request Jan 24, 2018
* chore(dgeni): better extraction of directive metadata

* No longer extracts the directive/component metadata using Regular Expressions.
* Fixes that inherited properties from interfaces or super-classes are not showing up as inputs/outputs if they are specified in the component/directive metadata.
* Now handles multi-line selectors (this was not possible using the Regular Expression)
* Fixes that merged inherited properties have a reference to the original document (this causes unexpected behavior; if properties are updated).

References #9299
@jelbourn jelbourn added the target: patch This PR is targeted for the next patch release label Jan 29, 2018
@devversion devversion deleted the chore/dgeni-parse-metadata branch February 11, 2018 12:49
@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 Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement docs This issue is related to documentation target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants