Add preparation for TypeScript 5.3 and Stage 3 decorators.

Review Request #13557 — Created Feb. 19, 2024 and submitted — Latest diff uploaded

Information

Spina
master

Reviewers

Stage 3 decorators are currently standard in TypeScript and Babel. We're
not able to use it in Spina just yet, but in preparation, we're now
adding the context argument to our decorator function to signal
support for Stage 3 decorators. It's made optional, allowing legacy
decorators to continue to work.

The decorators are also typed with <This, TBase>, which allows us to
return a proper type mixing in the decorated class.

There are also some documentation fixes around decorator arguments.

Unit tests pass with legacy decorators.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Add preparation for Stage 3 decorators.
Stage 3 decorators are currently standard in TypeScript and Babel. We're not able to use it in Spina just yet, but in preparation, we're now adding the `context` argument to our decorator function to signal support for Stage 3 decorators. It's made optional, allowing legacy decorators to continue to work.
9795845569d173d8ac4ec78a91e0ab1b52c4fd4c Christian Hammond
src/objects.ts
Loading...