-
Notifications
You must be signed in to change notification settings - Fork 130
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
Initial config for TypeScript refactor #518
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). |
Codecov Report
|
@@ -0,0 +1,65 @@ | |||
{ | |||
"compilerOptions": { |
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.
Note: when we ship this, we can remove jsconfig.json
(see #520) and merge its config into this file.
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.
} | ||
|
||
interface Props { | ||
size: SIZE_PROP_TYPE // Size of the button. Use the Button's KILO, MEGA, or GIGA properties. |
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.
The comments need to remain this format so they can be picked up by react-docgen.
size: SIZE_PROP_TYPE // Size of the button. Use the Button's KILO, MEGA, or GIGA properties. | |
/** | |
* Size of the button. Use the Button's KILO, MEGA, or GIGA properties. | |
*/ | |
size: SIZE_PROP_TYPE |
primary: boolean // Renders a primary button using the brand color. | ||
disabled: boolean // Should the Button be disabled? | ||
secondary: boolean // Renders a secondary button. Secondary buttons look the same for primary (default) and flat buttons. | ||
defaultProps: {} |
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 not a prop type 😉
Button.KILO = KILO; | ||
Button.MEGA = MEGA; | ||
Button.GIGA = GIGA; |
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.
Do you know how to type static properties on a function? I couldn't find anything when I googled it 🤔
@@ -0,0 +1,65 @@ | |||
{ | |||
"compilerOptions": { | |||
"noEmit": true, |
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.
We want to use TypeScript as our compiler, not just for type checking.
/* Basic Options */ | ||
// "incremental": true, /* Enable incremental compilation */ | ||
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ | ||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ |
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 needs to be es2015
or higher, otherwise, tree-shaking won't work.
"noEmit": true, | ||
/* Basic Options */ | ||
// "incremental": true, /* Enable incremental compilation */ | ||
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ |
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.
We want to publish modern code so the user can decide if they need to transpile the code. Next.js and CRA now transpile node modules, and Next.js even provides modern bundles for newer browsers.
Closing in favor of #563. |
Addresses #516
Purpose
Approach and changes
Definition of done