-
Notifications
You must be signed in to change notification settings - Fork 204
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
Optional transpilation with Babel #475
Conversation
@nycdotnet I'd be happy to merge and support this till typescript has emits for "let with closure" as well as "async await" Till then typescript currently supports both these things with target es6. I think it provides great value to allow people to chain the typescript type checker and babel transpiler ie others have asked for it as well. So merge at will and thanks! 🌹 |
And the name you have chosen seems to be worth supporting till infinity! |
+1 for this! |
@basarat I believe that this is ready. It actually seems to work shockingly smoothly for something I coded, especially with the fixes you made yesterday. Would you please eyeball this and merge/release if you feel happy? Note: I'm not quite sure of the best way to test uninstall/reinstall of atom-typescript without actually releasing it. Are all the modules referenced in |
node_modules? Yes. As a part of |
:FANCY: |
Optional transpilation with Babel
Pushed with |
I became despondent the other day when I saw that the
let
keyword's special scoping rules infor
-loop iterators wouldn't be transpiled properly by TypeScript 1.5 to ES5. microsoft/TypeScript#3915While I am pleased that @danquirk seems amenable to implementing this in TypeScript, and I agree with @basarat that doing so is the best long-term solution, it could take some time.
Since this feature of
let
is transpiled properly by Babel today, I wondered if I could put together an enhancement for atom-typescript to optionally run the JS emitted by the TypeScript language service through Babel during the compile-on-save process. As Bas predicted, it was actually fairly straight-forward, and this pull request is the result.This PR utilizes a new optional key in tsconfig.json:
If key exists exactly as above, the emitted JS from the TS language service will be run through Babel; if not, it's not.
I would love your feedback on this. Bas - would you consider merging? I am open to any and all suggestions with regards to the config file, key names, etc.
ToDo:
%userprofile%\.atom\packages\atom-typescript\node_modules
folder and then ranapm install
, so I am hopeful this is fine.