typescript-transform-macros
typescript-transform-macros copied to clipboard
compile time expansion support?
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)
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.
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