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
__metadata should register function that returns type instead of literal type #19563
Comments
This is already referenced in #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. |
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?
The text was updated successfully, but these errors were encountered: