4 ms·
I don't think decorators being a proposal matters at this point. I know I've been using them for 5+ years now, and libraries such as NestJS already use them ext
by deckard1 4y ago
I don't think decorators being a proposal matters at this point. I know I've been using them for 5+ years now, and libraries such as NestJS already use them extensively.
If you like them, you're probably already drowning in them. Me, personally, I could take them or leave them.
- madeofpalk 4y agoNestJS uses the previous, incompatible decorators implementation IIRC.
- eropple 4y agoAnd, because it does so, you can fall down really deceptive holes due to the lack of typing around things that decorators apply to, like parameters. I don't think that changes with stage 3 decorators, unfortunately. It makes NestJS really error-prone, in my experience, and it's a big reason I stopped making tooling for NestJS projects.
- WorldMaker 4y agoYeah, it's going to be really "exciting" for Angular users as well in the next few years because Angular is drowning in those old "experimental decorators" which are not wholly compatible with today's Stage 3 decorators and the transition is going to be error prone and tedious. Up until TS 5.x it at least gave you a compile error if you tried to use decorators in code without the "experimental" flag, but now they will compile (except where they don't) even if you have the wrong flags but the behavior is so different between the flags it likely won't run. That's going to cause some interesting havoc.
- swyx 4y agoyeah also feel quite ambivalent about them. theyre opaque syntax sugar. dont provide enough value to me personally but i wont begrudge others
- dmix 4y agoWhat do you use decorators for? I've never used them and I'm curious what the usecases are. The logging thing looks helpful.
- deckard1 4y agosilly things, mostly. Redux used them such as "@connect" if I recall. But I haven't touched those in awhile. Other team members invented various ways to use them, but none ever seemed to make things clearer or save much typing.