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

docs: fix imported types not showing up in docs #667

Merged
merged 2 commits into from
Aug 5, 2021

Conversation

Brailor
Copy link
Contributor

@Brailor Brailor commented Aug 3, 2021

This PR fix the issue with our current solution for importing propTypes and TS types not showing up in the documentation.
It uses an upcoming feature of react-docgen, thus I bumped its version from 5 to 6.alpha
For more info: reactjs/react-docgen#352

@Brailor Brailor force-pushed the INSTUI-3222/fix-imported-types-not-showing-in-docs branch from 7b9e403 to 70118eb Compare August 3, 2021 12:15
@@ -35,7 +35,8 @@ module.exports = function getReactDoc(source, fileName, error) {
reactDocgen.resolver.findAllExportedComponentDefinitions,
null,
{
filename: fileName
filename: fileName,
importer: reactDocgen.importers.makeFsImporter()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This new upcoming feature of react-docgen allows us to operate on imported types as well.

@@ -124,7 +124,7 @@
"html-webpack-plugin": "^4",
"jsdoc-api": "^6.0.0",
"mkdirp": "^1",
"react-docgen": "^5",
"react-docgen": "^6.0.0-alpha.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This new importer feature is not fully released in production yet, but according to the maintainers of the repo v6 won't contain any breaking changes, so it seems like a safe thing for us to use the pre-release version of the lib.

Copy link
Contributor

Choose a reason for hiding this comment

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

The yarn.lock is missing, please add it :) I couldn't find any problems with it, the View props display correctly now, and it could recognise the "query" and "props" prop of Responsive as "object" (typeof this and that) too. Well, it cannot go deeper than one level, but that's why we need that type-linking ticket too :)

@Brailor Brailor requested a review from ke1k0 August 3, 2021 12:25
@github-actions
Copy link

github-actions bot commented Aug 3, 2021

@Brailor Brailor requested a review from HerrTopi August 3, 2021 12:28
@@ -124,7 +124,7 @@
"html-webpack-plugin": "^4",
"jsdoc-api": "^6.0.0",
"mkdirp": "^1",
"react-docgen": "^5",
"react-docgen": "^6.0.0-alpha.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

The yarn.lock is missing, please add it :) I couldn't find any problems with it, the View props display correctly now, and it could recognise the "query" and "props" prop of Responsive as "object" (typeof this and that) too. Well, it cannot go deeper than one level, but that's why we need that type-linking ticket too :)

@Brailor Brailor merged commit d8ab044 into master Aug 5, 2021
@Brailor Brailor deleted the INSTUI-3222/fix-imported-types-not-showing-in-docs branch August 5, 2021 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants