So far we’ve seen how metadata are defined for adorned values, and also for public viewpoints its likely to see how this may be studied. Such as, it’s possible to write a blackdatingforfree habits injections library hence annotates sphere that have thinking so you’re able to shoot, and injects her or him when designing the fresh particularly:
Yet not, it is not you can to do this due to the fact really individual issue, as the key brand new metadata is scheduled with can’t be utilized to access it on the outside.
It target gets designers an approach to present accessibility thru metadata, that can be used in some implies.
This is why for folks who call rating or place having a great private field or accessor, this may be usually trigger the fresh accessors towards particularly.
Access is generally offered predicated on whether or not the worth are a regard supposed to be discover otherwise written. Sphere and you will automobile-accessors is each other comprehend and you can written to help you. Accessors can either end up being read inside the matter of getters, or wriitten regarding setters.
Unfortunately, we have been about antique trap out of, “The outdated procedure was deprecated, while the brand new question isn’t ready yet!” For now, best to keep using the outdated situation.
New pion group create suggest carried on to use Babel “legacy” designers otherwise TypeScript “experimental” decorators. If you are playing with decorators today, you are probably already on a single of them models. Remember that these types of decorators depend on “[[Set]] semantics” to have field declarations (from inside the Babel, reduce means). It is recommended that these tools look after assistance to have [[Set]] semantics next to legacy decorators, up until it’s possible to transition towards designers for the proposal.
Babel 7 helps the newest designers offer made available to TC39 from the TC39 fulfilling. It is fine to utilize such to possess fresh purposes, even so they deal with extreme efficiency items, aren’t but really commonly adopted; do not want to continue pressing for this offer for the TC39. Therefore, we advice against with this adaptation to own big performs. In the follow-on the proposals to incorporate a great deal more founded-in the designers, we hope to get well the extra features one to brand new designers proposal served.
Babel history-mode decorators derive from the condition of the latest JavaScript . Along with the sentence structure change in the list above, the fresh getting in touch with seminar from Babel history decorators is different from this proposition:
Despite this type of differences, it has to essentially become you’ll to really have the exact same style of features using this designers proposal like with Babel heritage decorators. When you see extremely important lost possibilities inside proposal, please document a challenge.