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

Use TypeScript with Babel! #4

Closed
benmvp opened this issue Feb 21, 2018 · 1 comment
Closed

Use TypeScript with Babel! #4

benmvp opened this issue Feb 21, 2018 · 1 comment
Milestone

Comments

@benmvp
Copy link
Contributor

benmvp commented Feb 21, 2018

See: https://github.com/Microsoft/TypeScript-Babel-Starter

This will allow us to leverage the vast Babel plugin ecosystem for transpiling, but still leverage TypeScript for type-checking.

(may be worth waiting until Babel 7 is out of Beta)

@rwholey-eb rwholey-eb self-assigned this Feb 21, 2018
BenAtEventbrite pushed a commit that referenced this issue Feb 22, 2018
#3 Replaced Flow w/ Typescript and as a result removed Babel because TypeScript both transpiles and type checks. However this makes us miss out on a lot of the plugins that are a part of the Babel community. Babel 7 adds support for Typescript.

Use babel 7 to build assets instead of tsc. The tsc command is still used for static type checking. Note that the babel typescript plugin will transpile code regardless of its typecheck correctyness. 

tsc is also still used to generate the declaration files, since it looks as though the babel-typescript-plugin does not support creating those at this time. However there's a "create declaration only" flag that is convenient for this. 

I've excluded the .spec files from the babel build, so now they won't appear in lib. I didn't move the ignore declaration into the .babelrc because I can imagine a situation where we might want to use a cool feature in our test suite that babel can transpile for is (even though node 8 gets us there at the moment). However there's never a need to have the transpiled versions in our lib. 

Lastly, we can now support async await etc with the additions of lib -- es2015 and dom which I think will be especially useful in our tests because most of our exports will likely be functions that return promises.

PS: i'm not tied to the tests, i just want to prove that they work! I'm happy to remove them, as we definitely should in the future, thought it might be nice while we're building the foundation though.

Fixes #4
@BenAtEventbrite BenAtEventbrite added this to the Alpha milestone Apr 5, 2018
@ebtravis
Copy link
Collaborator

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

4 participants