Super-fast alternative to Babel for when you can target modern JS runtimes
Sucrase "cheats" though:
> Sucrase bypasses most of these steps, and works like this: Tokenize the input source code into a token stream using a trimmed-down fork of the Babel parser. This fork does not produce a full AST, but still produces meaningful token metadata specifically designed for the later transforms.
While this is fine for simple transformations like transpiling JSX, it's not very suitable for full-on AST analysis like some eslint plugins do. Most notoriously, Sucrase is specifically designed to be garbage-in-garbage-out, whereas Babel will throw proper errors on things like early errors.
Tools written in lower level languages like esbuild can take advantage of facilities that aren't well supported in Node, such as cheap concurrent coroutines and greater control over memory layout (Babel ASTs are notoriously megamorphic and can silently fall off perf cliffs depending on how you manipulate them). These caveats are not reflected in Sucrase's benchmark.
This is that facebook project though (not just the same name), see here: https://github.com/rome/tools/blob/main/website/src/blog/pos...
Seems like the author could take it with him when leaving facebook, which is nice.
ChatGPT with full context of any GitHub repo. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at app.getonboardai.com.
Show HN: JSX in Browser with Sucrase
1 project | news.ycombinator.com | 30 Oct 2023
Run Bun Run! Building an AWS CDK Template with Bun
4 projects | dev.to | 28 Sep 2023
Why use Vite when Bun is also a bundler? - Vite vs. Bun
5 projects | dev.to | 19 Sep 2023
Rspack: A fast Rust-based web bundler
4 projects | news.ycombinator.com | 9 Mar 2023
The TypeScript compiler is now implemented internally with modules
16 projects | news.ycombinator.com | 2 Nov 2022