-
Notifications
You must be signed in to change notification settings - Fork 109
TypeScript's builtin helpers (for decorators etc.) fail Closure compilation #168
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
Comments
To make this work we pass --noEmitHelpers (see https://www.typescriptlang.org/docs/handbook/compiler-options.html ), then forked the TypeScript helpers definitions (the __metadata etc. comes from the compiler) into a format that Closure accepts. I'm actually just today still fiddling with this to avoid warnings. This upstream bug is relevant: For now, you might try passign --noEmitHelpers and see what breaks -- these helpers are just for decorator stuff that your code may not even use. |
@martine are you planning on merging a fix for this into tsickle or should we plan on contributing a fix? |
I will take a look now. Sorry for dropping this! |
To restate, the fix is to use I can publish our version, but I think the first thing to do will be to figure out the licensing for publishing this modified code. Sorry to go immediately into boring territory. |
Oops, I cited the wrong bug in the change, but I fixed this in c9546fe . Let me know if that doesn't work. |
When we compile a hello world Angular 2 app
app.component.ts
with Tsickle it generates invalid es6 closure.Input:
Output:
When we try to compile this with closure we get the error:
The body of a goog.module cannot reference this.
if we remove
(this && this.__decorate) ||
and(this && this.__metadata) ||
closure no longer complains about this.The text was updated successfully, but these errors were encountered: