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

[core] Allow to reuse functions from docs:api #28828

Merged
merged 4 commits into from
Nov 2, 2021
Merged

Conversation

m4theushw
Copy link
Member

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.

@mui-pr-bot
Copy link

mui-pr-bot commented Oct 4, 2021

No bundle size changes

Generated by 🚫 dangerJS against 3dbe4c6

@m4theushw m4theushw changed the title [docs] Allow to reuse functions from docs:api [core] Allow to reuse functions from docs:api Oct 4, 2021
@@ -37,7 +37,7 @@ declare module 'react-docgen' {
}
export interface ReactDocgenApi {
description: string;
props: Record<string, PropDescriptor>;
props?: Record<string, PropDescriptor>;
Copy link
Member Author

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.

/~https://github.com/reactjs/react-docgen/blob/7298b8628e4bd436cfd094f77404fde875ba6c96/src/Documentation.js#L13

@eps1lon
Copy link
Member

eps1lon commented Oct 12, 2021

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.

@eps1lon eps1lon removed their request for review October 12, 2021 09:40
@m4theushw
Copy link
Member Author

@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.

@flaviendelangle
Copy link
Member

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(', ')}} `;
Copy link
Member Author

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?

Copy link
Member

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

@m4theushw
Copy link
Member Author

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.

@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.

@flaviendelangle
Copy link
Member

Then can we take for granted that after one month without review we can merge this PR ?
I can't create a PR before that. This fork situation should not last that long.

Copy link
Member

@michaldudak michaldudak left a 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.

@m4theushw m4theushw merged commit 37ab548 into mui:master Nov 2, 2021
@m4theushw
Copy link
Member Author

@flaviendelangle I reverted b311b6c. You can create now a new PR with the change you added for mui/mui-x#3022

@zannager zannager added the core Infrastructure work going on behind the scenes label Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants