Skip to content

[internal] Handle RecordType and FieldType in generatePropDescription.ts - #29467

Merged
flaviendelangle merged 1 commit into
mui:masterfrom
flaviendelangle:generatePropDescription
Nov 4, 2021
Merged

flaviendelangle merged 1 commit into
mui:masterfrom
flaviendelangle:generatePropDescription

Conversation

@flaviendelangle

Copy link
Copy Markdown
Member

@mui-pr-bot

mui-pr-bot commented Nov 2, 2021 •

Copy link
Copy Markdown

No bundle size changes

Generated by 🚫 dangerJS against c444f53

@mnajdova mnajdova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. For easier review can we add props in a random component that have these types and verify that it works?

@flaviendelangle

Copy link
Copy Markdown
Member Author

@mnajdova where do you want me to add one ?
Basically it is when you have this type https://github.com/mui-org/material-ui-x/pull/3022/files#diff-36939e58755c91e3693a4f18aa7796b137ba1e32f65357a940fb358286048088R363 (MuiEvent<{}>)

@mnajdova

mnajdova commented Nov 3, 2021

Copy link
Copy Markdown
Member

@mnajdova where do you want me to add one?

It doesn't matter, we will revert it, just to test out what would be the output.

@flaviendelangle

flaviendelangle commented Nov 3, 2021 •

Copy link
Copy Markdown
Member Author

@mnajdova here it is 7871783

@flaviendelangle
flaviendelangle force-pushed the generatePropDescription branch 2 times, most recently from 3c916b6 to 7871783 Compare November 3, 2021 15:27

@michaldudak michaldudak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't know if this will be a problem - I noticed this doesn't work correctly when the record has a function field:

@returns {React.FunctionComponent<{ testNum: number, testStr: string, testFn: () => number }>}

It doesn't seem to be caused by your changes, though. The PR looks solid. Just don't forget to revert the test code :)

@flaviendelangle

Copy link
Copy Markdown
Member Author

I don't know if this will be a problem - I noticed this doesn't work correctly when the record has a function field:

For my current use case, clearly not (I only use the empty Record for my MuiEvent<{}> not to crash).

I think we can improve it later it the use case come.
It should probably not, if we start inlining complex objects instead of creating types, I think we are doing something wrong.

@flaviendelangle
flaviendelangle force-pushed the generatePropDescription branch from 7871783 to c444f53 Compare November 4, 2021 10:13
@flaviendelangle
flaviendelangle merged commit a53ce46 into mui:master Nov 4, 2021
@flaviendelangle
flaviendelangle deleted the generatePropDescription branch November 4, 2021 11:59
@zannager zannager added the internal Behind-the-scenes enhancement. Formerly called “core”. label Jan 24, 2023
@oliviertassinari oliviertassinari changed the title [core] Handle RecordType and FieldType in generatePropDescription.ts [internal] Handle RecordType and FieldType in generatePropDescription.ts Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Behind-the-scenes enhancement. Formerly called “core”.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants