-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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][base] List slots in API documentation #36104
Conversation
Netlify deploy previewhttps://deploy-preview-36104--material-ui.netlify.app/ Bundle size report |
1138d03
to
a3f50f9
Compare
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.
Great job overall! It should be much clearer to the developers what they can use now. However, we definitely need to work on making JSDocs more comprehensive.
Was creating a separate interface for slots necessary? I don't think it'll ever be used on its own. We already have a ton of types starting with {ComponentName}Unstyled
, so if we can avoid adding new ones, that would be great. I understand that it allowed you to reuse lots of code responsible for parsing the classes interface. Perhaps it wouldn't be that difficult to get to the description of {ComponentName}UnstyledProps.slots
directly instead. Let me know what you think.
Also, tagging the @mui/docs-infra team for a review.
Are you suggesting that we add default value for |
Instead of |
Only in JSDoc, though (unless it will cause linting errors saying that the prop must be also initialized in code).
Great idea! We don't have slot class names documented anywhere, so it'll come in handy for sure. |
Yes, the code and the default value declared in JSDoc must match to avoid the errors and to pass all CI tests. |
I added to the documentations the slot class names as @siriwatknp suggested. |
Looks good! I'll do a more thorough review a bit later. |
Yes, it sounds better. On my way. |
b383f1b
to
f35741c
Compare
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.
👍 Awesome
fa45d1b
to
1d3f499
Compare
Agree. I renamed it. |
…ponents" This reverts commit 2eef0cd.
6603334
to
a722874
Compare
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 like it!
Closes #35791
Changes:
${ComponentName}Slots
interface forslots
prop (inside the interface, it has the JSDoc default value and description for each slot).${ComponentName}Slots
interfaces and updates API JSON filesslots
prop and add JSDoc default value forslots
(henceslots
in "Props" section of the API doc now has a default value); UPDATE: Reverted this after realising that setting default values toslots
prop brings implementation changesPreview: https://deploy-preview-36104--material-ui.netlify.app/base/api/select-unstyled/#slots <-
SelectUnstyled
API Doc