-
Notifications
You must be signed in to change notification settings - Fork 535
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
Migrate Label to TypeScript #976
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/primer/primer-components/cy2wmfyae |
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.
Looks good!
Quick question - are we still planning on removing all the prop types once the refactor is done? Is there any harm to keeping them in there so that non TS users at least get console warnings when a prop is used incorrectly? or is it more of a maintenance issue because we'd have to keep both in sync?
const Label = styled('span')` | ||
const Label = styled.span< | ||
{ | ||
variant?: 'small' | 'medium' | 'large' | 'xl' |
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.
I didn't know you could do this syntax! Nice! 🙌
Yeah, the maintaince cost of keeping the TypeScript types and propTypes in sync is pretty high. I've noticed that most of our propTypes are actually inaccurate right now. I don't think the benefits of runtime console warnings out weight the maintaince cost of keeping TS and propTypes in sync. |
🦋 Changeset detectedLatest commit: 397a46f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This PR migrates the
Label
andLabelGroup
component to TypeScript as part of the TypeScript refactor.