qri-io / 2017-frontend

qri electron & web frontend
https://qri.io
MIT License
23 stars 7 forks source link

Feature Request: Ease into TypeScript #513

Open colelawrence opened 5 years ago

colelawrence commented 5 years ago

Before writing this feature request I have: [ ] checked through the issue queue to see if this feature has already been requested [ ] checked through the [rfcs] (https://github.com/qri-io/rfcs) to see if this feature has already been requested

Is your feature request related to a problem? Please describe. I like knowing what is going to happen when I run my code. I like consistent and predictable usage and module resolution behavior. I like having a minimal configuration which style gives me access to the latest features of ESNext. I like when my editor is able to help me write documented code easily, and immediately shows me the value of documenting my code by providing the above capabilities.

Describe the solution you'd like I believe that we could simplify our build system and begin using TypeScript in a single step by replacing babel plugins with just the ts-loader. I started a POC in my own branch which has 80% of the run-scripts working (not there yet with tests or linters, yet).

Describe alternatives you've considered I've considered simply using JSDoc tags across js files, which gave me a great start, but in the end has many limitations (especially when approaching the definition of a stateful React component's prop types). JSDoc is also not coupled to the actual build system, so even if you don't have any type errors, there can be very subtle issues in runtime (thinking about null checks and the like).

Additional context Again, my branch is at https://github.com/colelawrence/frontend/tree/feature/cl-06-21-storybook-designs It started as a way to include some storybook files, and was a nice platform to begin this Proof of Concept since Storybook has its own webpack.config.js file to tune.