-
Notifications
You must be signed in to change notification settings - Fork 1
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
TypeScript mixin is not transformed as a complete Polymer module definition #97
Labels
Comments
Need a hand with the decision by which mixin should be transformed into Polymer Mixin. We can have something like that: function Mixin<T extends Constructor>(Super: T) {
@Mixin()
class Mixin extends Super {
test: number;
}
return Mixin;
} This however requires that:
This would not allow to to a shorthand syntax: const Mixin = <T extends Constructor>(Super: T) => class Mixin extends Super {
test: number;
}; We could also use a JSDoc to mark mixins for transformation, which would match exactly how Polymer Tools require it: /**
* @mixinFunction
* @polymer
*/
const Mixin = <T extends Constructor>(Super: T) =>
/**
* @mixinClass
* @polymer
*/
class Mixin extends Super {
test: number;
} or with marking just the function: /**
* @mixinFunction
* @polymer
*/
const Mixin = <T extends Constructor>(Super: T) => class Mixin extends Super {
test: number;
} What looks properly? Or should we have all of the above working? |
Buslowicz
pushed a commit
that referenced
this issue
Nov 8, 2017
Buslowicz
pushed a commit
that referenced
this issue
Nov 8, 2017
Buslowicz
pushed a commit
that referenced
this issue
Nov 21, 2017
… definition - basic mixins (properties only)
Buslowicz
pushed a commit
that referenced
this issue
Nov 21, 2017
… definition - optimizing the code (just a little bit)
Buslowicz
pushed a commit
that referenced
this issue
Nov 21, 2017
… definition - added mixed content test, fixed typo
Buslowicz
pushed a commit
that referenced
this issue
Nov 26, 2017
… definition - added observer recognition
Buslowicz
pushed a commit
that referenced
this issue
Nov 27, 2017
… definition - covering further observer cases
Buslowicz
pushed a commit
that referenced
this issue
Nov 27, 2017
… definition - added computed props recognition
Buslowicz
pushed a commit
that referenced
this issue
Dec 3, 2017
… definition - added `reflectToAttribute` and `notify` recognition
Buslowicz
pushed a commit
that referenced
this issue
Dec 3, 2017
… definition - added listeners recognition
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A mixin in TypeScript can be defined as a function returning class containing properties and methods
Expected behavior
Properties are transformed to the
static get properties
method.Actual behavior
Only methods are copied to the output file.
Example
produces
The text was updated successfully, but these errors were encountered: