-
-
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
[docs] Generate proptypes from typescript demos #16521
Conversation
Details of bundle changes.Comparing: 8d8a8dd...50b57dd
|
Source of truth should be typescript but you can be less strict most of the time e.g. you can used
Prettier is used for formatting not our personal opinion. So if it does compact small objects then we stick with it. About future work: Do you think we could make this work for our own components? It's been a long term goal to move props documentation to the .d.ts files (for in-editor docs) and generate docs and propTypes from it. |
I'm aware, just pointing out that they were not compact before.
Yes, might work already if the definition is changed to look like a function, otherwise it will need some work |
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.
Really hyped about this for core components. Just some minor polish needed.
@merceyz I have heard feedback from TypeScript users behind confused by the presence of the prop-types in the demos. I'm really happy to see this problem worked on, you know how to pick your fights 👍. |
That should cover it for now. I can update it to be more detailed, if that's wanted. |
@eps1lon @oliviertassinari Is this too much? Feels like overkill. |
@merceyz withStyles has its own runtime checks to warn against wrong input. 👍 for keeping PropTypes.object. As for the other prop "object to shape" migrations. I would say that yes, it hits the point of diminishing returns. We have disabled https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md in our eslint config file. Not using shape would be aligned with it. |
Yeah it's overkill for |
So the requested changes are
|
Yes, always.
Yes, preferably via explicit configuration. |
@eps1lon Done |
docs/src/pages/components/autocomplete/IntegrationReactSelect.js
Outdated
Show resolved
Hide resolved
Nicely done. Thanks! |
Follow-up to #15438 (comment)