rplugin 0.2.0

Rust plugin system for AST processing
docs.rs failed to build rplugin-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: rplugin-0.3.0

AST processing plugin system.

Designed as a general crate, to support using it from other libraries too. This depends on the [abi_stable] crate.

Why new crate?

I (kdy1) wants to pass the AST data to plugin without having to change the type of AST nodes.

e.g. Using RBox instead of Box is not an acceptable option, as many users already use swc as a crate.

Instead, we just use proc-macro to convert ast into something that can be passed directly to the plugin, using [StableAbi][abi_stable::StableAbi]. In plugin, we convert it back to normal AST before processing, so the plugin authors can use exactly same code as core transforms. Of course, this is slow, but it's only slow if it's compared to the changing type. It's much faster than serializing/deserializing.

In short, we do

Normal AST -> Plugin AST -> Normal AST -> plugin -> Normal AST -> Plugin AST -> Normal AST

Note for potential users

Currently this crate depends on swc_common, but if there's a request, I can change it to not depend on swc_common.