-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[core] Allow to reuse functions from docs:api
#28828
Conversation
docs:api
docs:api
@@ -37,7 +37,7 @@ declare module 'react-docgen' { | |||
} | |||
export interface ReactDocgenApi { | |||
description: string; | |||
props: Record<string, PropDescriptor>; | |||
props?: Record<string, PropDescriptor>; |
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 key should be optional. If the component doesn't support props it's undefined
.
I don't think we should share functionality across repositories. I've been telling this Olivier since the inception of the X repository and so far I've only had bad experiences since I constantly break a distant repository. Since I won't be involved with the work in this repository soon and I shared my opinion on this repeatedly, I don't think this is up to me anymore. |
@flaviendelangle Is b311b6c related to this PR? If not, I'll revert it since this should be only a split of the functions already in use in the core, without the introduction of any new behaviors. |
It is needed for a PR in progress on X. And since this one is lasting a lot longer than it should and my change is trivial, I added it here. |
return '{}'; | ||
} | ||
|
||
return `{ ${type.fields.map((field) => resolveType(field)).join(', ')}} `; |
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.
@flaviendelangle I found weird this line. The whitespace at the end and the missing whitespace before the closing curly bracket is a typo?
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 white space should before the closing bracket
@flaviendelangle I'll revert it. You can add it to your fork or fork my fork and add it there. I didn't check the new part, it seems to not break anything but it's outside the scope. |
Then can we take for granted that after one month without review we can merge this PR ? |
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.
Continuing on what Sebastian wrote about reusing code between repos - I think it's doable only if we maintain strict versioning rules (i.e. adopt semver) in this package.
I don't have any remarks to the code itself.
This reverts commit b311b6c.
@flaviendelangle I reverted b311b6c. You can create now a new PR with the change you added for mui/mui-x#3022 |
This PR is the counterpart of mui/mui-x#2465. To be able to generate the API docs of the X's components reusing the same code from the core, I had to split
docs/scripts/buildApi.ts
into separate files. Without doing that, once a function from this file is imported its command is executed as well.