vcfvct / typescript-retry-decorator

lightweight typescript retry decorator with 0 dependency.
MIT License
88 stars 14 forks source link

Support "ES Decorators, Stage-3" API #37

Open ivan-kleshnin opened 4 months ago

ivan-kleshnin commented 4 months ago

ES decorator proposal was updated to Stage-3 with a different internal API

https://medium.com/@aude.lellouche/typescript-decorators-stage-3-technical-challenges-and-tips-for-overcoming-them-8deed94a3de7

To my understanding, the library is based on Stage-2 and using it with Stage-3 (TS5+ without "experimentalDecorators": true) causes errors like:

TS1241: Unable to resolve signature of method decorator when called as an expression.
The runtime will invoke the decorator with 2 arguments, but the decorator expects 3

Any chance this library is updated to support Stage-3? (would require a major version bump)

vcfvct commented 4 months ago

hi @ivan-kleshnin , this is an interesting point, I also looked a bit on this when TS 5 add support for the native decorator. I have not been in nodejs ecosystem for a while, do you see the new ES Decorator been used widely?

I just checked caniuse and it seems no browser supports it native for now. Also in the proposal github issue, there are several issues related to migration guide. Not exactly sure how the community is to handle this transition. do you have any insights? 🤣

ivan-kleshnin commented 4 months ago

Yeah, it seems like we have to wait for some time 😮‍💨