typescript-transform-macros icon indicating copy to clipboard operation
typescript-transform-macros copied to clipboard

compile time expansion support?

Open beenotung opened this issue 6 years ago • 2 comments
trafficstars

From the example in readme, it seems the expanded code is going to be executed in the runtime, instead of in the compile time. If this is the case, it seems similar to just inclining the function (with name conflict avoidance)

beenotung avatar Oct 16 '19 03:10 beenotung

yeah, it is more like inlining and not actual macros, although I've thought about expansion in compile time I'm not planning to work on it in the near feature.

The project is kind of dead right now tbh, I'm not using it myself.

danielpza avatar Oct 16 '19 04:10 danielpza

I just made a compile-time expand macro tool, it's string-based, not AST-based though. But that should be fine as tsc can further check the generated file. https://github.com/beenotung/tsc-macro

beenotung avatar Oct 16 '19 07:10 beenotung