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

Try out TypeScript #343

Merged
merged 14 commits into from
Feb 25, 2018
Merged

Try out TypeScript #343

merged 14 commits into from
Feb 25, 2018

Conversation

searls
Copy link
Member

@searls searls commented Feb 25, 2018

Progress

  • install typescript
  • rip out babel
  • move our existing typings test in with the other tests, deleting its npm script & the generated directory
  • see npm test pass
  • verify the dist/testdouble.js looks okay
  • see the whole build pass
  • set up a second standard task for linting typescript
  • convert an actual JS file to typescript
  • measure build performance

Blockers

  • Currently using ts-node for its require.extensions hook to run our tests, but it appears to blow up on Node v4 which is failing the build. (Fix: the explosion was caused by me targeting es2015 instead of es5)

@searls
Copy link
Member Author

searls commented Feb 25, 2018

I'm deciding to merge for two reasons:

  1. It seems to mostly work
  2. It's much faster than under babel.

In particular, $ time npm t takes this long under Node v8.90 on master:

real	0m9.226s
user	0m7.091s
sys	0m0.998s

And here's the same command compiled under typescript:

real	0m1.945s
user	0m1.566s
sys	0m0.189s

For a better than 4x speedup in walltime for my test feedback loop, I'd gladly switch compilers even if I never write a single '.ts' file.

@searls searls merged commit cca1f7a into master Feb 25, 2018
@searls searls deleted the typescriptify branch February 25, 2018 20:50
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

Successfully merging this pull request may close these issues.

None yet

1 participant