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

Migrate Label to TypeScript #976

Merged
merged 5 commits into from
Jan 21, 2021
Merged

Migrate Label to TypeScript #976

merged 5 commits into from
Jan 21, 2021

Conversation

colebemis
Copy link
Contributor

@colebemis colebemis commented Jan 20, 2021

This PR migrates the Label and LabelGroup component to TypeScript as part of the TypeScript refactor.

@vercel
Copy link

vercel bot commented Jan 20, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/primer/primer-components/cy2wmfyae
✅ Preview: https://primer-components-git-cb-ts-label.primer.now.sh

@colebemis colebemis mentioned this pull request Jan 20, 2021
53 tasks
@vercel vercel bot temporarily deployed to Preview January 20, 2021 20:27 Inactive
Copy link

@emplums emplums left a 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'
Copy link

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! 🙌

@colebemis
Copy link
Contributor Author

@emplums

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?

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-bot
Copy link

changeset-bot bot commented Jan 21, 2021

🦋 Changeset detected

Latest commit: 397a46f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/components Patch

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

@vercel vercel bot temporarily deployed to Preview January 21, 2021 22:39 Inactive
@vercel vercel bot temporarily deployed to Preview January 21, 2021 22:42 Inactive
@colebemis colebemis merged commit 6500595 into main Jan 21, 2021
@github-actions github-actions bot mentioned this pull request Jan 21, 2021
@joshblack joshblack deleted the cb/ts-label branch January 19, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants