Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

shapeshifter: replace shift with acorn #174

@felixroos

Description

@felixroos

It could be more practical to move to babel. Reasons:

  • non hacky support for top level await and ES2020
  • rich plugin system

as briefly discussed in #171 :

Maybe we could move to another parser / transformer lib in the future, like babel standalone (which is based on acorn, which supports ES2020) or if that's too heavy just the packages we need (@babel/parser @babel/traverse @bable/type @babel/generate + any plugin packages we need, like top level await.

I think the permanent solution is to switch to @babel/parser, it's strongly optimized for this kind of quick and simple AST manipulation, extremely battle-tested & well documented + you can even support sexy experimental JS syntax if you like (e.g. https://github.com/tc39/proposal-pipeline-operator)

would probably also fix #79

edit: another (faster) alternative would be SWC: https://swc.rs/docs/usage/wasm

edit: see shootout below

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions