Why is reflect-metadata only working when using a decorator? Why is reflect-metadata only working when using a decorator? typescript typescript

Why is reflect-metadata only working when using a decorator?


The PR that implements this feature states:

emit design-time type metadata for decorated declarations in source.

So it explicitly was designed to emit metadata just if there is a decorator on a class.

I am unable to find the rationale behind this decision, but my guess it that it would be wasteful to emit this code for all classes (js is sensitive to size) and decorators and metadata are seen as related concepts.