Skip to content

babel transpile is async, failures dropped #754

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

Closed
laurelnaiad opened this issue Nov 27, 2015 · 0 comments
Closed

babel transpile is async, failures dropped #754

laurelnaiad opened this issue Nov 27, 2015 · 0 comments

Comments

@laurelnaiad
Copy link

Babel and Typescript do not agree on what is valid es6 (even if the maintainers aim for eventual agreement in the tools). As such, that the tsc->babel process will work isn't guaranteed.

The babel transpile process is currently running asynchronously in an otherwise synchronous process, so if babel fails to transpile tsc output, it's not reported to the developer and es6 code (code which babel considered invalid, so probably not great code to have regardless of language version) is produced even though the target is es5.

I sorta-kinda have a patch for this.The easy part is transpiling synchronously. I'm still trying to figure out how to cause the errors generated by babel to be treated as similarly as they can be to TypeScript-level errors. I am not aiming for highlighting problems in the code, but giving the developer the babel error and allowing them to jump to the line number is within reach.

P.S. An easy way to reproduce this is to define a subclass in which you try to manipulate this before calling super(). This isn't legal in ES6. Typescript aims to catch this but right now it doesn't (ref: microsoft/TypeScript#3311). You'll get a .js file in this case with tsc-style ES6 in it where you expected babel-style ES5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants