Proposal: Faster transpilation by passing babel an AST

Could the new –ast mode be used to pass asts to babel for transpilation directly, instead of emitting js that gets re-parsed by babel?

coffee -t is slower than it ought to be, possibly 2x slower than without transpilation in my very quick test. This is a pain compared to otherwise smooth setups with nodemon, where I’m reloading on save. I’m choosing between using JSX and slowed iteration cycles vs strings of HTML and fast iteration cycles. I suspect it’s the unnecessary js stringification and second parse, maybe plus composing sourcemaps.

Alternatively, CJSX syntax emitting React.createElement calls would solve my problem.

1 possible answer(s) on “Proposal: Faster transpilation by passing babel an AST

  1. I was about to suggest linking to these tools from coffeescript.org

    There was a PR to add a new “Integrations” section to the docs to make these more prominent. #5334. We should really finish that 😄