istio.io icon indicating copy to clipboard operation
istio.io copied to clipboard

LFX'25:Update the pipeline to achieve clean build without any errors

Open Ajay-singh1 opened this issue 4 months ago • 5 comments

Description

This PR replaces Babel with esbuild as the build tool for this repository. The main goals of this is to improve build performance, reduce configuration complexity, modernize the toolchain, and generate cleaner builds.

Overview

Babel has served as a popular JavaScript transpiler for years, but it comes with some downsides in the context of modern library development:

  • Performance bottlenecks: Babel is significantly slower, especially on large codebases or repeated builds
  • Maintenance concerns: Many Babel plugins and presets are either deprecated, minimally maintained, or lag behind the evolving JavaScript standard.
  • Unnecessary complexity: Babel's plugin-based architecture leads to verbose and often brittle configurations

esbuild, on the other hand, is designed for speed and simplicity, with modern JavaScript/TypeScript support and built-in minification and bundling.

Technical Changes

Removed

  • Babel related dependencies
    • @babel/core
    • @babel/preset-env
    • Anyother babel related dependency

Added

  • esbuildas a dev dependency
  • A new build script using esbuild, capable of:
    • Transpiling modern JavaScript (ES6+) to target environments
    • Minimification of Javascript files to achieve faster builds

Testing

  1. The output structure and exports matches with previous Babel generated output
  2. The site is build successfully without having any errors or warnings

Result

  1. Simplified build setup with fewer and less boilerplate dependencies
  2. More future-proof and modern toolchain

Reviewers

  • [ ] Ambient
  • [ ] Docs
  • [ ] Installation
  • [ ] Networking
  • [ ] Performance and Scalability
  • [ ] Extensions and Telemetry
  • [ ] Security
  • [ ] Test and Release
  • [ ] User Experience
  • [ ] Developer Infrastructure
  • [ ] Localization/Translation

Ajay-singh1 avatar Jun 12 '25 05:06 Ajay-singh1