Open BANOnotIT opened 4 years ago
Hm, seems as potential trouble in the future, because TS team wants to use DefineForClassFields compiler strategy as default as I understood.
This is an issue for us as well, because of using mobX with Inversify. MobX 6.x requires the setting of useDefineForClassFields to true (or the Babel equivalent ["@babel/plugin-proposal-class-properties", { "loose": false }]
), which breaks lazyInject
. Is there any update on this issue?
This is an issue for us as well, because of using mobX with Inversify. MobX 6.x requires the setting of useDefineForClassFields to true (or the Babel equivalent
["@babel/plugin-proposal-class-properties", { "loose": false }]
), which breakslazyInject
. Is there any update on this issue?
same issue here :(
@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 fieldsomething
classInstance.something.doSomething
something
propery in current instancesomething
getter inclassInstance.__proto__
Current Behavior
@lazyInject*
instruments prototype of class with getter and setter for fieldsomething
classInstance
withsomething
getter on constructionclassInstance.something.doSomething
something
propery getter in current instanceJS findsomething
getter inclassInstance.__proto__
JS calls inversify resolver...PROFIT!!!Possible Solution
For now there are two solutions:
"useDefineForClassFields": false
intsconfig.json
-- set by default