JaimeGensler / thyseus

An archetypal Entity Component System, built entirely in Typescript
MIT License
74 stars 3 forks source link

[FEAT] Migrate decorators to new ES Decorators #3

Closed JaimeGensler closed 1 year ago

JaimeGensler commented 1 year ago

New impl should be class auto-accessor decorators, but we could open a discussion on also supporting plain getters / setters.

This will be a breaking change that requires consumers to remove "experimentalDecorators" from their tsconfig and use the new accessor keyword instead of declare.

Last I looked into this, there were some issues with support particularly for prettier and some bundlers. If those aren't resolved yet, this may need to be delayed.

3mcd commented 1 year ago

Link to explanation of auto-accessors, since it took me a bit to find a reference to them: https://2ality.com/2022/10/javascript-decorators.html#auto-accessors

JaimeGensler commented 1 year ago

Blocked by esbuild (used by Vite, our recommended bundler) not allowing accessor keyword. Also on hold while serializing/deserializing objects is being investigated as an alternative to accessors.