Bazel + TypeScript: faster with Remote Execution
Blog post from Aspect Build
The post explores the significant speed improvements in TypeScript builds when utilizing Bazel's remote execution capabilities, particularly with Aspect's rules_ts. By employing a remote execution cluster provided by EngFlow, a 10 million line TypeScript application demonstrated an 8.4x faster build time compared to a local 16-core MacBook Pro. The benchmark highlighted the advantages of horizontal scaling, allowing builds to utilize more resources than a local machine could provide. Remote execution helps in reducing lengthy build and test durations, enhancing developer productivity by minimizing wait times. The post also discusses the challenges and solutions related to symlink compatibility in Bazel, which historically hindered remote execution with Node.js tools. Recent updates in Bazel 5.3.0 have started to address these issues, improving compatibility for remote execution. Furthermore, various configurations of ts_project and ts_library are examined, with specific focus on the performance benefits of using swc for transpilation. The overall findings suggest that remote execution can drastically cut build times for large projects, though the benefits depend on network speed and the specific build scenario, with local actions potentially being faster for smaller incremental builds.