rusackas opened a new pull request, #35302:
URL: https://github.com/apache/superset/pull/35302

   ### SUMMARY
   
   This PR revolutionizes Superset's frontend build system by combining Bun's 
fast JavaScript runtime with Nx's intelligent caching, achieving dramatic 
performance improvements:
   
   - **68x faster incremental builds** (56s → 0.8s when no changes)
   - **10-20x faster typical builds** (only rebuild what changed)
   - **Fixed TypeScript error reporting** that was silently failing
   - **DRY configuration** - reduced 325+ lines of repetitive config
   - **Local caching only** - no cloud dependencies
   
   #### Key Changes
   
   1. **Nx Build Caching**: Intelligent, dependency-aware caching that only 
rebuilds changed packages
   2. **Bun-Optimized Pipeline**: Parallel Babel compilation with better CPU 
utilization (470%+ vs 350%)
   3. **Fixed tsc.sh Bug**: TypeScript errors now properly reported (was 
silently ignoring errors)
   4. **Apache License Compliance**: Added pre-commit hooks for license header 
checking
   5. **DRY Configuration**: Moved repetitive config to nx.json, reducing each 
project.json from 20 to 7 lines
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   **Before**: Every build takes 56s regardless of changes
   ```
   $ npm run plugins:build
   ... 56 seconds later ...
   ```
   
   **After**: Incremental builds with caching
   ```
   $ npm run plugins:build
   ✔  25/25 tasks [25 read from cache]
   ... 0.8 seconds ...
   ```
   
   Performance benchmarks:
   | Scenario | Old (npm) | New (Bun+Nx) | Improvement |
   |----------|-----------|--------------|-------------|
   | **No changes** | 56s | 0.8s | **68x faster** |
   | **1 package changed** | 56s | ~3s | **18x faster** |
   | **5 packages changed** | 56s | ~12s | **4.6x faster** |
   
   ### TESTING INSTRUCTIONS
   
   1. **Test the build system**:
      ```bash
      # Clean install and initial build
      npm ci
      npm run plugins:build  # First build: ~56s (populating cache)
      
      # Test cache hit
      npm run plugins:build  # Second build: ~0.8s (100% cache hits)
      
      # Test incremental build
      echo "// test" >> 
superset-frontend/plugins/plugin-chart-table/src/index.ts
      npm run plugins:build  # Only rebuilds plugin-chart-table and dependents
      ```
   
   2. **Verify TypeScript error reporting**:
      ```bash
      # Add a type error to any package
      echo "const x: string = 123;" >> 
superset-frontend/packages/superset-ui-core/src/index.ts
      npm run plugins:build  # Should fail with TypeScript error
      git restore superset-frontend/packages/superset-ui-core/src/index.ts
      ```
   
   3. **Test license compliance**:
      ```bash
      # Create a file without license header
      echo "console.log('test');" > test.js
      git add test.js
      git commit -m "test"  # Pre-commit hook should fail
      rm test.js
      ```
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [x] Introduces new feature or API (Nx build caching)
   - [ ] Removes existing feature or API
   
   **Notes**:
   - No breaking changes - `npm run plugins:build` works exactly the same, just 
faster
   - All build outputs are identical to the previous system
   - Pre-commit hooks automatically installed on `npm install`
   - Local caching only (no Nx Cloud), stored in `.nx/cache`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to