-
Notifications
You must be signed in to change notification settings - Fork 0
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
Compile decorators properly when googmodule is false and transformTypesToClosure is true #2
base: master
Are you sure you want to change the base?
Conversation
This is the error I keep getting:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have the ts option to import tslib? Tsickle has its own version of tslib.
} | ||
|
||
@annotatedAccessorDecorator(true) | ||
get age() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the demo this is getting emitted as a normal decorator, not converted to an annotation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In demo/tsickle-out/using_decorators.js
I'm seeing it get output as:
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
static propDecorators = {
age: [{ type: annotatedAccessorDecorator, args: [true,] }]
};
whereas the other decorators get output as:
__decorate([
accessorDecorator(true)
], Person.prototype, JSCompiler_renameProperty("name", Person.prototype), null);
is that not the correct behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, when I followed the testing directions from the other pr I get this output:
__decorate([
annotatedAccessorDecorator(true)
], Person.prototype, "age", null);
I also just noticed __decorate
is defined inline instead of being imported too, which doesn't seem right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What??? That doesn't make any sense :(
This adds a few example decorators to test if they are doing what we need them to do.
Modifies the handling of decorators to make sure they don't do anything that closure gets mad about.
The instructions here should still work for testing: #1