feat(swc): export bindings for parsing JS to AST#435
Conversation
Signed-off-by: avivkeller <me@aviv.sh>
There was a problem hiding this comment.
Not sure if I should upstream this?
There was a problem hiding this comment.
Yes it needs to be upstreamed
I'm curious why there is a desire to drop Acorn as a dependency? Is there an issue where that is being discussed? Some benefits of Acorn:
|
|
To clarify, we have no issue with Acorn, I mostly want to reduce our code duplication, for instance, having two AST parsers. |
|
Thanks for clarifying. Reducing duplication makes sense, I'm just wondering if the end user impact is worth it. For the performance cost, it might work out cheaper to have more specific APIs than exposing the whole AST. Such as only returning the exports of the file or if it has top level await. For the |
As I mentioned on Slack, if I export the SWC bindings for AST parsing, we can use them in Node core, removing our reliance on two separate AST parsers (SWC and Acorn)