question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docgen does not extract type information from prop declared using @Prop(Type)

See original GitHub issue

Docgen currently doesn’t extract type information for props declared using @Prop(Type) instead of @Prop({ type: Type }). This usage is advertised in the vue-property-decorator manual and I quite like it.

The problem arises here, where it checks if the @Prop argument is an object https://github.com/vue-styleguidist/vue-styleguidist/blob/dc9b82a46a336be47b643871ec78b82c2c83adea/packages/vue-docgen-api/src/script-handlers/classPropHandler.ts#L87-L89

There should be an alternative branch added here to handle “bare” type definitions - unfortunately it seems that implementing this requires a bit too much knowledge of the AST for me.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
stale[bot]commented, Feb 18, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

0reactions
oxancommented, Jun 7, 2021

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

@motiz88/react-native-docgen - npm
It uses ast-types and @babel/parser to parse the source into an AST and provides methods to process this AST to extract the desired...
Read more >
Extracting structured type information | by Atanas Stoyanov
This approach worked fine until trying to extract type information on class-like types that inherit another class-like type located in another file. Trying...
Read more >
Typechecking With PropTypes - React
To run typechecking on the props for a component, you can assign the special propTypes property: import PropTypes from 'prop-types'; class Greeting extends ......
Read more >
Importing propTypes from external file in React Styleguidist
The problem is the 'Props & Methods' section isn't displayed in the Styleguidist guide when textProps is imported. When I define textProps ...
Read more >
vue-styleguidist - Bountysource
Docgen currently doesn't extract type information for props declared using @Prop(Type) instead of @Prop({ type: Type }) . This usage is advertised in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found