Skip to content

typed-macro/typed-macro

Repository files navigation

logo

version

code coverage ci wrappers license

🤠 Provide macros to your projects.

Documentation

🧐 Why @typed-macro

There are already many solutions that provide macro capabilities for Javascript and Typescript projects. Some of them are very mature, such as babel-plugin-macros (it's awesome, and maybe you will be interested in it).

However, according to my personal experience, they are not suitable for people like me - all my projects are in Typescript, but their support for Typescript is usually not so good.

Also, in those solutions, macros cannot interact with each other, such as importing or nesting. And users cannot import macros like normal functions.

Most of them are Babel plugins, so they may read something that has been changed by other plugins but not updated yet (like bindings), and can't control its position in the transformation chain. But in the modern dev flow, the main pain point of being a Babel plugin may be that Babel is just a transformer, knowing nothing about modules and dependency graph, which means they cannot re-expand macros when changes occurs in dependent external conditions.

😎 @typed-macro stands on the shoulders of Typescript and ES Module - none of the above problems exist anymore.

📈 Road Map

Package Status Documentation
@typed-macro/core core English
@typed-macro/runtime runtime -
@typed-macro/test-utils core English
vite-plugin-macro core English
*rollup 🚧 🚧
*webpack 🚧 🚧