Broken @lazyInject decorator in TypeScript >=3.7 #1212
Comments
|
Hm, seems as potential trouble in the future, because TS team wants to use DefineForClassFields compiler strategy as default as I understood. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@lazyInject relies on instrumenting class prototype and prototype bubble mechanism. For now in TS >= 3.7 any of decorators from inversify-inject-decorators don't work
Why worked earliar
@lazyInject*instruments prototype of class with getter and setter for fieldsomethingclassInstance.something.doSomethingsomethingpropery in current instancesomethinggetter inclassInstance.__proto__Current Behavior
@lazyInject*instruments prototype of class with getter and setter for fieldsomethingclassInstancewithsomethinggetter on constructionclassInstance.something.doSomethingsomethingpropery getter in current instanceJS findsomethinggetter inclassInstance.__proto__JS calls inversify resolver...PROFIT!!!Possible Solution
For now there are two solutions:
"useDefineForClassFields": falseintsconfig.json-- set by defaultThe text was updated successfully, but these errors were encountered: