What is the future of the old experimental js plugin? #5286
-
Thanks for starting this discussion @kwonoj I was about to write a new SWC plugin today and saw no mentions of JavaScript/TypeScript in the documentation which caught me off guard. I was reading your initial intro and I am a bit worried about:
Would you say it would be counterproductive for me to write a new JavaScript plugin? Unless I a missing something, if you want a plugin that works both the same way with Babel and SWC, it will be pretty tricky because they are using different languages. For example, I was hoping to port this Babel plugin to SWC and it uses other npm packages which won't be available in Rust. On top of that, for my specific use case, I want to pass custom parser functions to the plugin (as an argument) - I also don't see how this will be possible with a Rust plugin. How are you planning to support these use cases in the future? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm probably not able to give any concrete final decision, can only share what we know today. In here, I'll call JS based plugin as
|
Beta Was this translation helpful? Give feedback.
I'm probably not able to give any concrete final decision, can only share what we know today. In here, I'll call JS based plugin as
legacy
for the clear distinction between new experimental plugin.Legacy will not go away in a day or two. We have a lot of internal discussions about the right paths for the plugin ecosystem and nothing's concluded fully for the legacy yet.
However, the new plugin system will be first class citizen to get most of the support at this moment.
You may decide to write legacy plugin still, but you have to keep in mind that was only available for the node.js bindings from beginning.
@swc/wasm
was not able to run legacy plugins. New native cli (rust-based) wi…