Open pie6k opened 7 years ago
This is already referenced in https://github.com/Microsoft/TypeScript/issues/14971
We plan on revisiting some of the decorator decisions as we implement the new decorator proposal
@mhegazy I understand it might be hard to answer - but do you have any, even rough estamine on that? It's something thats quite urgent for my project :)
I do not have an ETA at the moment.
Hi, is there any update on the ETA of this? I can imagine some simple changes that would make things work. For example, emit all the decorators at end of file. Or after last class defined in the file.
today i change my tsconfig target to es2015, this problem come out. Error: SomeClass is not defined any update or alternative work around ? and why target es5 work fine ?
Any developments? I'm stuck with the same issue...
Imagine case with circular dependencies
Typescript metadata would be emitted here like
eg.
__metadata('design:type', Person)
.As
Person
is injected for the first time beforePerson
class is initialized, it will result withReferenceError
sayingPerson is not defined
.If it'd emit metadata like:
__metadata('design:type', () => Person)
it'd be fine.
Later on, when using Reflect.metadata, it would also need to call meta function instead of just returning the type.
If you think it's good idea, do you have any suggestions about starting point for PR that would implement this change?