-
-
Notifications
You must be signed in to change notification settings - Fork 97
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-infra] New API reference generator #1537
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to set up a test case for hook types (maybe after useRender is merged). Also, could be try running this in other repos?
Would it make sense to make the extractor part this GitHub org, to make it easier to make changes for other people?
@@ -41,12 +40,10 @@ | |||
}, | |||
"cssVariables": { | |||
"--accordion-panel-height": { | |||
"description": "The accordion panel's height.", | |||
"type": "number" | |||
"description": "The accordion panel's height." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep the previous logic for the @type info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the extractor doesn't handle the @type tag yet, but will soon.
"type": "boolean | undefined", | ||
"default": "false", | ||
"required": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit strange. It says it's required, but we allow undefined as value. Is there a way to change the props that have default values not to be flagged as required?
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state." | ||
}, | ||
"render": { | ||
"type": "React.ReactElement | (props, state) => React.ReactElement", | ||
"type": "React.ReactElement | ((props: unknown, state: unknown) => React.ReactElement)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to specify the state & props for each component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this doesn't look right. These aren't really the props of a component but attributes to be spread on the rendered HTML element. I'll try to display in a better way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to exclude internal components.
Using https://github.com/michaldudak/react-api-extractor