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
Use of legacy decorators can easily result in circular reference if a module import binding is passed to a decorator:
import Base from './base.mjs';
export default class Derived {
@type(Base)
base;
}
import Derived from './derived.mjs';
export default class Base {
@type(Derived)
derived;
}
since decorators are executed in module execution stage.
However, with block decorators, we could defer the getting of import bindings:
import Base from './base.mjs';
export default class Derived {
@deferred(@type { Base }) // Equals to @deferred(() => Base)
// We could get `Base` after all modules finished their execution!
base;
}
The text was updated successfully, but these errors were encountered:
Huh, I don't see how we'd make block decorators work in an expression context like that. If we want to have deferred references, maybe this kind of decorator could help: rbuckton/proposal-refs#11
Use of legacy decorators can easily result in circular reference if a module import binding is passed to a decorator:
since decorators are executed in module execution stage.
However, with block decorators, we could defer the getting of import bindings:
The text was updated successfully, but these errors were encountered: