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

docgen: Omit unknown type tag from Markdown format output #19571

Merged
merged 10 commits into from
Jan 16, 2020

Conversation

aduth
Copy link
Member

@aduth aduth commented Jan 10, 2020

Related: #18045
Unblocks: #19520

This pull request seeks to resolve an issue where, if docgen encounters a type that it cannot parse, the Markdown formatter will output a null literal value for the type. With these changes, it will simply not output a type at all output text indicating that the type is unknown, in order to avoid misleading the reader into thinking the type is null when it is not.

This should be considered an interim solution to the larger problem of substituting Doctrine (#18045) in order to use more complex TypeScript types (#18838).

Testing Instructions:

Verify unit tests pass:

npm run test-unit

Verify there are no changed documentation after running:

npm run docs:build

@aduth aduth added [Type] Bug An existing feature does not function as intended [Package] Docgen /packages/docgen labels Jan 10, 2020
@aduth aduth requested a review from oandregal January 10, 2020 19:45
@aduth aduth mentioned this pull request Jan 10, 2020
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

It looks like a reasonable way to handle such cases for the time being 👍

@aduth aduth requested a review from nerrad as a code owner January 15, 2020 23:30
@aduth
Copy link
Member Author

aduth commented Jan 15, 2020

I somehow missed that types are output for a number of tags, so I updated in e9da943 to output the "unknown type" more consistently (caught a few more cases in the subsequent 4e10bce).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Docgen /packages/docgen [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants