Add preparation for TypeScript 5.3 and Stage 3 decorators.
Review Request #13557 — Created Feb. 19, 2024 and submitted
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 thecontext
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.
Summary | ID |
---|---|
9795845569d173d8ac4ec78a91e0ab1b52c4fd4c |
- Summary:
-
Add preparation for Stage 3 decorators.Add preparation for TypeScript 5.3 and Stage 3 decorators.
- Description:
-
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 signalsupport 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.