Re:Fusion.js: A Plugin-Based Universal Web Framework
by xanderjanz on Wednesday August 01, 2018 @07:23PM
(#17667970)
We have high order functions in JS. Which are similar to decorators.
Re:Fusion.js: A Plugin-Based Universal Web Framework
by sbjs on Wednesday August 01, 2018 @07:30PM
(#17668011)
Similar, but harder to use safely and correctly in class methods using the new class syntax. There's more surface area for typos and other mismatch errors since you have to type the method names twice. See: https://mobx.js.org/best/decorators.html
> Allow default imports from modules with no default export. This does not affect code emit, just typechecking.
https://www.typescriptlang.org/docs/handbook/compiler-option...
And I think you're right about decorators. They are an iffy concept in the context of JS semantics, and I personally avoid using them and try to avoid libraries that use them. That's probably why TS has them disabled by default and calls them "experimental". I like the concept of decorators in and of themselves, but they don't fit cleanly into the JS world, and I am looking forward to seeing how the JS/TS world innovates alternative "cleaner" solutions that fit better into the existing model!