Hello!
I've been looking Polymer for a year now, and still this syntax:
Polymer('seed-element', {
author: 'Dimitri Glazkov',
fancy: false,
ready: function() {
},
sayHello: function(greeting) {
var response = greeting || 'Hello World!';
return 'seed-element says, ' + response;
},
fireLasers: function() {
this.fire('seed-element-lasers-success', { sound: 'Pew pew pew!' });
}
});
Gives me creeps. Not a single IDE will support anything useful for that syntax. Why this syntax is like this? It should follow the biggest Javascript libraries to achive greater interoperability, e.g.
Backbone and inheritance
I really like TypeScript, and I suspect above kind of syntax does not allow normal inheritance. If the Polymer were made to follow semi-standard, one could simply inherit from Polymer element. So one could in TypeScript use familiar:
class SeedElement extends PolymerElement {
fancy: boolean = false
author: string = "Dimitri Glazkov"
public sayHello (greeting: String) {
}
public fireLasers () {
}
}
All it takes, I suspect is to have normal "javascript inheritance" in Polymer, just like in Backbone (e.g. I can already inherit from Backbone.View using TypeScript syntax) it's pure JavaScript library.
Thanks.