-
Notifications
You must be signed in to change notification settings - Fork 15
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
Why use babel with typescript? #1
Comments
Hi @pkieltyka - This is a good question! The reason is due to existing project infrastructure. If starting a project from scratch we would most certainly stick with |
We use some babel plugins that are quite essential to our code-bases, such as the Relay and styled-components ones. This means that we needed to have a pipeline like Even if we’d really wanted to (but I don’t think we’d want to), Babel indeed doesn’t support namespaces and const enums, but haven’t really had a need for that. |
Thanks for the reply guys. That makes sense. I am starting a project from scratch and going to use just tsc but I have the feeling eventually I’ll miss out on features Babel has such as tree shaking. I’m pretty sure tsc doesn’t have tree shaking and neither a way to make it work with async module loading for browsers, but I am sure it will support it someday.
Btw, I also use styled components and there is a typescript plugin that works very well with plain tsc.
… On Dec 21, 2017, at 6:37 PM, Eloy Durán ***@***.***> wrote:
We use some babel plugins that are quite essential, such as the Relay and styled-components one. This means that we needed to have a pipeline like tsc -> babel -> js. Especially during development this can be quite costly (parse & generate code twice) and can be tedious to setup and maintain.
Even if we’d really wanted to (but I don’t think we’d want to), tsc has no plugin support at the moment, so being able to build TS code all within Babel is a win in that regard.
Babel indeed doesn’t support namespaces and const enums, but haven’t really had a need for that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hey guys,
Thanks for the thorough blog post. What I'm trying to understand is: why use babel at all with typescript? the tsc is quite good and will only get better, and Babel 6/7 do not support the full TS language.
The text was updated successfully, but these errors were encountered: