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: Some types omitted #26971

Closed
sirreal opened this issue Nov 13, 2020 · 2 comments · Fixed by #28615
Closed

Docgen: Some types omitted #26971

sirreal opened this issue Nov 13, 2020 · 2 comments · Fixed by #28615
Assignees
Labels
[Package] Docgen /packages/docgen [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Developer Documentation Documentation for developers

Comments

@sirreal
Copy link
Member

sirreal commented Nov 13, 2020

Some types may be omitted from docgen output. For example:

/** @type {Record<string,true|undefined>} */

/**
* Object map tracking messages which have been logged, for use in ensuring a
* message is only logged once.
*
* @type {Record<string,true|undefined>}
*/
export const logged = Object.create( null );

Was rendered as:

_Type_

-   `Record<string,(|undefined)>` 

Originally posted by @sirreal in #26429 (comment)

@sirreal sirreal mentioned this issue Nov 13, 2020
6 tasks
@sirreal sirreal added [Package] Docgen /packages/docgen [Type] Bug An existing feature does not function as intended [Type] Developer Documentation Documentation for developers labels Nov 13, 2020
@sarayourfriend
Copy link
Contributor

sarayourfriend commented Jan 30, 2021

@sirreal @gziolo What do you think about us trying to re-write docgen using the TypeScript parser? We'd ditch babel and doctrine altogether and just use TS to parse the source and the JSDoc comments. It does a really good job on JavaScript files: https://astexplorer.net/#/gist/5931456cb14f4dfbeef6a824c04cacce/2ae696cccaedc016a032ff636f4b2aaf977f2514

It'd be a lot of work (basically a full re-write of the entire docgen utility) but it would solve this problem and let us ditch the deprecated doctrine library.

If this a desirable path forward for the docgen package, I'm super excited to work on this and would be happy to do so.

Update: Actually it looks like this exact solution was already proposed in #18045. Shall we close this issue and revive the topic over there?

@gziolo
Copy link
Member

gziolo commented Feb 1, 2021

Update: Actually it looks like this exact solution was already proposed in #18045. Shall we close this issue and revive the topic over there?

I think that @nosolosw would be the best person to answer your question but I believe that you are correct. #28615 should resolve two issues at once 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Docgen /packages/docgen [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants