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] Generate PropTypes from type definitions #16642

Merged
merged 30 commits into from
Aug 5, 2019
Merged

Conversation

merceyz
Copy link
Member

@merceyz merceyz commented Jul 18, 2019

Adds the required infrastructure to generate PropTypes from the TypeScript type definitions using typescript-to-proptypes

Motivation

  • Prevent the TypeScript type definitions and PropTypes from getting out of sync.
  • In-editor documentation

Documented components

  • AppBar
  • Backdrop
  • Badge
  • BottomNavigation
  • Portal

@mui-pr-bot
Copy link

mui-pr-bot commented Jul 18, 2019

No bundle size changes comparing 2656c6c...3a51fe1

Generated by 🚫 dangerJS against 3a51fe1

@merceyz merceyz changed the title [core] Generate proptypes from type declarations [core] Generate proptypes from type declarations [ci skip] Jul 18, 2019
@merceyz
Copy link
Member Author

merceyz commented Jul 19, 2019

@eps1lon Is it possible to stop the CI from testing this PR?


export default Avatar;
export type AvatarProps = SimplifiedPropsOf<Avatar>;
Copy link
Member Author

Choose a reason for hiding this comment

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

SimplifiedPropsOf doesn't include component

Copy link
Member Author

@merceyz merceyz Jul 22, 2019

Choose a reason for hiding this comment

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

Seems this is true for all props that should have component

// Property 'component' does not exist on type ...
type foo = ButtonProps['component']

@eps1lon
Copy link
Member

eps1lon commented Jul 19, 2019

@eps1lon Is it possible to stop the CI from testing this PR?

You need to include [skip ci] to the latest commit when you push.

You can skip azure only [skip azpipelines]. CircleCI doesn't offer this option.

@merceyz merceyz changed the title [core] Generate proptypes from type declarations [ci skip] [core] Generate proptypes from type declarations Jul 19, 2019
@merceyz merceyz force-pushed the proptypes branch 3 times, most recently from a6b4d2b to f70e3b8 Compare July 19, 2019 18:59
@codecov

This comment has been minimized.

@merceyz merceyz force-pushed the proptypes branch 3 times, most recently from d8a1dc9 to 64fbc2b Compare July 20, 2019 21:46
@merceyz
Copy link
Member Author

merceyz commented Jul 22, 2019

Unsure what to do about props that aren't explicitly used, looking at d2e87bc a lot of the props gets removed

@merceyz merceyz force-pushed the proptypes branch 4 times, most recently from 99d95dc to 0283e3b Compare July 23, 2019 20:11
@eps1lon eps1lon merged commit d167966 into mui:master Aug 5, 2019
@eps1lon
Copy link
Member

eps1lon commented Aug 5, 2019

@merceyz Great job and thanks for sticking with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants