ArsenyYankovsky / nova-odm

A schema-based data mapper for Amazon DynamoDB.
https://github.com/ArsenyYankovsky/nova-odm
Apache License 2.0
34 stars 3 forks source link

Any plan to migrate to Typescript 5 decorators ? #7

Open vmaerten opened 1 year ago

vmaerten commented 1 year ago

Hi ! First of all, thanks to migrate this project to aws-sdk v3, it works like a charm!

With Typescript 5, they release new decorators but they are not compatible with the old ones cf : https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#differences-with-experimental-legacy-decorators

This new decorator's proposal is not compatible with --emitDecoratorMetadata

Do you plan to do a new version with Typescript 5 decorator so we can use them in our project?

Thanks

ArsenyYankovsky commented 1 year ago

Hi, thanks for submitting a ticket.

I'll take a look at TypeScript 5 decorators but initially it seems like it's possible to support both experimental and typescript 5 decorators. Ideally, we should support both.

I'm not 100% sure when I'll be able to release a new version with support for it as I'm short on time right now, but hopefully it will be some time soon.

vmaerten commented 1 year ago

I'm glad to here that! I'm available to help / test if needed :)

ArsenyYankovsky commented 11 months ago

Hi, I got a chance to look at it and while I'd love to switch to the ecmascript decorators for future-proofing, it seems like it's currently not possible to re-implement the same decorators we have easily (maybe there's some hacky way of making it work throught the class decorator). The issue is a class field decorator not having access to any information on the class itself (either name or a reference to a prototype etc.) There is an open issue with the proposal about it.