Lukas Taegert-Atkinson | Reinventing Rollup | ViteConf 2023

Reinventing Rollup: Building a Faster and More Efficient Bundler for Native Code and JavaScript, with features like statement-level code splitting and native support for TypeScript.

Key takeaways
  • Rollup’s main issue is the conversion from JavaScript to binary, which takes time and memory.
  • The parser from SWC was used to replace Acorn, resulting in faster parsing and a smaller output.
  • The syntax tree created by SWC is non-standard and required additional work to make it compatible with Rollup.
  • The array buffer is smaller than the JSON representation, making it a more efficient option.
  • The goal is to create a more efficient bundler that can handle native code and JavaScript.
  • Features planned for Rollup 4 include:
    • Statement-level code splitting
    • Native code and JavaScript code splitting
    • Better error handling
    • Improved cache management
    • Native support for TypeScript
    • Improved tree shaking
  • The next step is to transition to a Rust-based implementation, which will be used for the parser, transformer, and bundler.
  • The goal is to make Rollup faster and more efficient, with a focus on native code and JavaScript code splitting.
  • The idea of paralleling code splitting and bundling to make it faster.
  • The use of SWC’s JavaScript bindings to create a faster syntax tree traversal API.
  • The goal is to make Rollup more efficient by reducing memory consumption and improving bundling speed.