TypeScript Decorators: Property Decorators
TypeScript

TypeScript Decorators: Property Decorators

This post takes an in-depth look at property decorators. It examines their signature, provides sample usage, and exposes a common antipattern. Reading the previous posts in the series is encouraged but not necessary. The Series so Far Code Overview Signature target: any propertyKey: string | symbol Usage Antipattern Example Solution Recap Legal The Series so Far Decorator Introduction JavaScript Foundation Reflection Parameter Decorators Property Decorators These posts are planned but not written yet:

  • CJ Harries
    CJ Harries
TypeScript Decorators: Parameter Decorators
TypeScript

TypeScript Decorators: Parameter Decorators

This post takes an in-depth look at parameter decorators. It examines their signature and provides a couple of useful examples. Reading the previous posts in the series is encouraged but not necessary. The Series so Far Code Overview Class Method vs Global Function Signature target: any propertyKey: string | symbol parameterIndex: number Usage required Arbitrary Metadata 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: 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
Package Manager Showdown: Yarn and NPM on a VPS
NPM

Package Manager Showdown: Yarn and NPM on a VPS

I’ve worked pretty hard to stay out the whole JS package manager debate. NPM’s always done what I needed. Prior to yesterday evening, I had no baseline for comparison. Sure, like everyone else, I’ve read articles that point out how slow NPM is in comparison to Yarn. I tend to switch tabs/windows/whatever the second I forget what I was doing (i.e. every five minutes), so I don’t often wait on NPM.

  • CJ Harries
    CJ Harries
JavaScript

Deconstructing Epom Ads for Personal Edification

Completely unrelated setup Disclaimer Curiousity DIY So what? Lock your iframes Never trust the client Completely unrelated setup I’m very interested in automating small, repetitive tasks that I don’t want to do. I’m well known for this at work, and AutoHotkey has come up a bunch recently because of a slew of new unskilled, repetitive computer tasks. My work environment is totally Linux and I’ve been playing through my “needed a better GPU” Steam backlog at home, so my AHK is a little rusty.

  • CJ Harries
    CJ Harries
NPM Lifecycle Stages: A Study in Stream Editors
NPM

NPM Lifecycle Stages: A Study in Stream Editors

A majority of my work, both business and pleasure, is done in Node. I support a fairly large codebase which always needs maintenance. As I get new ideas or learn new techniques, the codebase grows. No matter how organized I try to be, every project seems to spawn half a dozen new projects. New projects means new config and packages and builds and instead of doing things the right way, I’ve just been shuffling a few master files around.

  • CJ Harries
    CJ Harries