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
Richard Simpson (@RichiCoder1) Sure, I'm working on a inversion of control container and I want to add contextual binding support. One of the things that I want to allow developers to do is to use constraints based on the injection target. Take for example:
My problem is that If the javascript is compressed, the value of target.name would be "a" and "b" and the IoC container would not be able to resolve the service.
We do not intend to make any changes to decoratos implementation until the TC39 discussions about the current proposal are finalized. there will be some changes that we need to make with the latest draft of the proposal; after that is done, we can look into adding these additional feature requests.
Mohamed Hegazy (@mhegazy) - Its been a year since your last comment on this. Any updates on when this might be able to be implemented? It would be super useful to be able to use this to do DI when code has been minified.
I'd also love to see this implemented as it would allow me to map the properties of an object (input parameters from a GraphQL query) on to the parameters of a function (the resolver). I was hoping to find a way to augment the metadata emitted by tsc but it seems compiler plug-ins are not yet a thing.
+1. At LoopBack, we introduce decorators to annotate method parameters to describe how to map methods to REST APIs. It will be great that we can infer parameter types/names from the design time metadata. For example:
@returnValue()asynccreateOrder(@param()order: Order): Promise<Order>{// ...}Wewouldliketoknow:
-Theparametername('order')N/Atoday-Theparametertype(Order)(It's already supported, but not for array item types)
-Thereturntype(Promise)butwecaremoreabout`Promise<Order>`
Activity
RichiCoder1 commentedon Sep 22, 2015
If I may ask, what's the use case of this?
remojansen commentedon Sep 22, 2015
Richard Simpson (@RichiCoder1) Sure, I'm working on a inversion of control container and I want to add contextual binding support. One of the things that I want to allow developers to do is to use constraints based on the injection target. Take for example:
When I declare the bindings I can use a constraint to resolve ambiguous bindings:
My problem is that If the javascript is compressed, the value of
target.namewould be"a"and"b"and the IoC container would not be able to resolve the service.RichiCoder1 commentedon Sep 23, 2015
Ahh, that would make sense.
Joshua-F commentedon Jan 1, 2016
I would love to see this added.
remojansen commentedon Jan 27, 2016
Hi Mohamed Hegazy (@mhegazy) It's been a while since this was tagged as
In Discussion. Do you have an update on this? Thanks!mhegazy commentedon Jan 28, 2016
We do not intend to make any changes to decoratos implementation until the TC39 discussions about the current proposal are finalized. there will be some changes that we need to make with the latest draft of the proposal; after that is done, we can look into adding these additional feature requests.
isuda commentedon Jan 9, 2017
Mohamed Hegazy (@mhegazy) - Its been a year since your last comment on this. Any updates on when this might be able to be implemented? It would be super useful to be able to use this to do DI when code has been minified.
sdc395 commentedon Dec 8, 2017
I'd also love to see this implemented as it would allow me to map the properties of an object (input parameters from a GraphQL query) on to the parameters of a function (the resolver). I was hoping to find a way to augment the metadata emitted by
tscbut it seems compiler plug-ins are not yet a thing.sdc395 commentedon Dec 8, 2017
While we're at it, knowing the type a promise will return would also be very useful so metadata for generics too, please.
raymondfeng commentedon Dec 19, 2017
+1. At LoopBack, we introduce decorators to annotate method parameters to describe how to map methods to REST APIs. It will be great that we can infer parameter types/names from the design time metadata. For example:
nodkz commentedon Apr 9, 2019
Duplicate #12626