It's disconcerting to hear that some at TC39 are pushing back against decorators. @BrendanEich please tell me these rumors are unfounded nonsense. The major projects using decorators is endless, as is the pain of this feature being forever in limbo.
-
-
The only way this argument makes sense is if someone had their heart set of a very particular kind of optimization that relied on classes being *considerably* more static than any other part of JS.
-
But many of the arguments for why attributes are good enough (and in fact the result in Java) is that frameworks can still do the dynamic stuff when wiring things up. Decorators at least give TS a hint something is going on.
-
It is worth pointing out that decorator behavior, as dynamic as they are, can still be verified staticallly. The TypeScript compiler today checks that a decorator does not remove properties from a declaration, or change its type in an incompatible way.
-
And the new style of decorators can even encode that kind of information in the signature of the decorator function itself.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.