TypeScript Decorators: Reflection
TypeScript

TypeScript Decorators: Reflection

This post takes a cursory look at reflection with TypeScript. Its primary focus is how reflection can be used with TypeScript decorators. It introduces Reflect, reflect-metadata, and some miscellaneous related components. The Series so Far Code Overview Reflect emitDecoratorMetadata reflect-metadata Example: Validate a Parameter Range Recap Legal The Series so Far Decorator Introduction JavaScript Foundation Reflection Parameter Decorators Property Decorators Method Decorators Class Decorators Eventual Topics: Where Decorators Work Decorating Instance Elements vs.

  • CJ Harries
    CJ Harries
TypeScript Decorators: JavaScript Foundation
TypeScript

TypeScript Decorators: JavaScript Foundation

This post looks at how TypeScript compiles decorators. It pulls the raw JavaScript from the compiler and breaks down the result. It has basic decorator examples of each type to examine the JavaScript output. The Series so Far Code Why Look at the JavaScript? Configuration From the Source Raw Prettified and Polished Analysis Parameter Decorators Property Decorators Method Decorators Class Decorators Recap Legal The Series so Far Decorator Introduction JavaScript Foundation Reflection Parameter Decorators Property Decorators Method Decorators Class Decorators Eventual Topics:

  • CJ Harries
    CJ Harries
TypeScript Decorators: Introduction
TypeScript

TypeScript Decorators: Introduction

This post serves as introduction to TypeScript decorators. It looks at basic decorators, decorator factories, and decorator composition. You should have some familiarity with TypeScript and some object-oriented programming experience. The Series so Far Code Decorators Configuration Simple Example Decorator Factories Composition Recap Legal The Series so Far Decorator Introduction JavaScript Foundation Reflection Parameter Decorators Property Decorators Method Decorators Class Decorators Eventual Topics: Where Decorators Work Decorating Instance Elements vs. Static Elements Examples Pairing Parameter Decorators with Method Decorators Pairing Property Decorators with Class Decorators Code You can view the code related to this post under the post-01-decorator-intro tag.

  • CJ Harries
    CJ Harries