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
[PLAY-102] Enable and Configure Typescript in Playbook #1759
Conversation
aec6780
to
c14b4a0
Compare
1ae560d
to
80e5117
Compare
80e5117
to
6b98e8d
Compare
6b98e8d
to
b3ea7cd
Compare
b3ea7cd
to
ebede08
Compare
3d9123f
to
c6d2b1e
Compare
@@ -106,6 +106,7 @@ const Button = (props: ButtonPropTypes) => { | |||
className={css} | |||
href={link} | |||
id={id} | |||
rel="noreferrer" |
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.
is this used for SEO?
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.
It is, however, it is also part of the linter settings. We may choose later to remove this however it does serve 3rd party consumers well.
export type GlobalProps = BorderRadius & Cursor & Dark & Display & LineHeight & Margin & MaxWidth & NumberSpacing & Padding & Shadow & ZIndex | ||
|
||
// Prop categories | ||
const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} = { |
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.
is the main advantage here that you are able to specify the datatype to avoid potential errors?
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.
Absolutely! Now we can provide developers an expected and auto-documented API for these global props. TS will prevent any out-of-bounds prop values as they type. 😎
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.
this is a very interesting update it seems like the main advantage is by strictly defining datatypes to avoid future problems
Breaking Changes
No
Runway Ticket URL
How to test this
Run playbook locally
Checklist:
enhancement
,bug
,improvement
,new kit
,deprecated
, orbreaking
. See Changelog & Labels for details.Milano
label when you are ready for a review.