You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Decorate all properties with type metadata in TypeScript #11861
For this I need design:type metadata for all properties, but I see it's emitted only if a property is decorated (also a bogus decorator will do), e.g.
class Foo { var Foo = (function () {
bar: Bar; function Foo() {
} }
return Foo;
}());
function bogus(t, k) {}
class Foo { var Foo = (function () {
@bogus bar: Bar; function Foo() {
} }
__decorate([
bogus,
__metadata('design:type', Bar)
], Foo.prototype, "bar", void 0);
return Foo;
}());
It would be very useful to have a compiler option to enable the implicit metadata decoration for all design:* metadata, without the need of an additional decorator.
Metadata is just a decorator, just one that the compiler emits. decorating all propoerties/method/classes would explode the size of the output, will cause a decorator call for every declaration. it is not clear that there is much utility of this despite the cost. you can see more discussion about why this does not really work for the general case in #3628.
Activity
mhegazy commentedon Oct 26, 2016
Metadata is just a decorator, just one that the compiler emits. decorating all propoerties/method/classes would explode the size of the output, will cause a decorator call for every declaration. it is not clear that there is much utility of this despite the cost. you can see more discussion about why this does not really work for the general case in #3628.