Skip to main content

The Rise of Rust in JavaScript Tooling: SWC, Rspack, Biome, and Beyond

·PkgPulse Team

TL;DR

Rust ate the JavaScript tooling stack. Every major performance bottleneck in JS development — parsing, transpilation, bundling, linting, formatting — now has a Rust-powered alternative that's 10-100x faster. SWC (~20M weekly downloads) replaced Babel. Biome (~2M) is replacing ESLint+Prettier. Rspack (~2M) is Webpack in Rust. Turbopack is Next.js's Rust bundler. Oxc is a comprehensive Rust-based JS toolchain. The pattern: write your app in JavaScript/TypeScript; run tools written in Rust.

Key Takeaways

  • SWC: ~20M weekly downloads — Rust transpiler, powers Next.js, Deno, Parcel
  • Turbopack: ~8M downloads — Rust bundler (Next.js), 5-10x faster than Webpack
  • Rspack: ~2M downloads — Webpack-compatible Rust bundler from ByteDance
  • Biome: ~2M downloads — Rust linter + formatter, 100x faster than ESLint+Prettier
  • Oxc: growing fast — comprehensive Rust JS toolchain (parser, linter, transformer)

Why Rust Won JavaScript Tooling

The Performance Gap Was Unsustainable

JavaScript-based tools (2020):
- Babel transpile 1000 files: ~8 seconds
- ESLint scan codebase: ~8 seconds
- Webpack build (500 components): ~50 seconds
- Prettier format 1000 files: ~3 seconds

Rust-based equivalents (2026):
- SWC transpile 1000 files: ~0.2 seconds  (40x faster)
- Biome scan codebase: ~0.08 seconds      (100x faster)
- Turbopack build (500 components): ~5s   (10x faster)
- Biome format 1000 files: ~0.1 seconds  (30x faster)

As codebases grew from hundreds to thousands of files, JS-based tools hit a wall. A 30-second lint step doesn't fit in a tight feedback loop.

Why Rust Specifically

  1. No garbage collector — Rust's ownership model avoids GC pauses that plague Java/Go tooling
  2. True parallelism — Rust can safely parallelize across all CPU cores; JS is single-threaded
  3. Memory efficiency — Rust allocates exactly what it needs; JS runtimes have overhead
  4. WASM compatibility — Rust tools compile to WebAssembly for browser/Node embedding
  5. Existing ecosystem — Rust's napi-rs and neon make Node.js native addons easy

SWC (The Babel Killer)

// .swcrc — SWC configuration
{
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "tsx": true,
      "decorators": true
    },
    "transform": {
      "react": {
        "runtime": "automatic",
        "refresh": true          // Fast Refresh support
      }
    },
    "target": "es2022",
    "loose": false
  },
  "module": {
    "type": "es6"
  }
}
# SWC direct usage
npx @swc/cli compile src/ -d dist/ --source-maps

# Build time comparison (1000 TypeScript files):
# Babel:  ~8.2s
# SWC:    ~0.18s  (45x faster)
# esbuild: ~0.15s (similar, different approach)

SWC is used internally by:

  • Next.js (replaced Babel in Next.js 12)
  • Deno (for TypeScript compilation)
  • Parcel (as a transformer)
  • Vitest (as a transformer option)
  • Vercel (build infrastructure)

Turbopack (The Webpack Successor)

// Turbopack is transparent to Next.js users
// It's the default bundler in Next.js 15

// next.config.js — no Turbopack config needed
/** @type {import('next').NextConfig} */
export default {};  // Turbopack handles everything

// If you need Turbopack-specific config:
export default {
  experimental: {
    turbo: {
      resolveAlias: {
        '@/components': './src/components',
      },
      rules: {
        '*.svg': {
          loaders: ['@svgr/webpack'],
          as: '*.js',
        },
      },
    },
  },
};
# Turbopack benchmarks (Vercel's test suite, large Next.js app)
# First compile:           ~800ms  (vs Webpack: ~10,000ms)
# HMR (small change):     ~60ms   (vs Webpack: ~2,000ms)
# HMR (large change):     ~200ms  (vs Webpack: ~5,000ms)

Rspack (Webpack Compatible, Rust-Powered)

// rspack.config.js — drop-in Webpack replacement
const path = require('path');

/** @type {import('@rspack/core').Configuration} */
module.exports = {
  entry: './src/index.ts',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'bundle.js',
  },
  module: {
    rules: [
      {
        test: /\.tsx?$/,
        use: 'builtin:swc-loader',  // Built-in SWC (no extra package)
        exclude: /node_modules/,
      },
      {
        test: /\.css$/,
        use: ['style-loader', 'css-loader'],  // Webpack loaders work!
      },
    ],
  },
  resolve: { extensions: ['.ts', '.tsx', '.js'] },
};
# Rspack is designed for Webpack migration
# Most Webpack configs work with minimal changes

# Build comparison (500 component React app):
# Webpack 5:  ~35s cold build
# Rspack:     ~4s  cold build  (8x faster)
# Vite:       ~8s  cold build
# Turbopack:  ~3s  cold build

# Who should use Rspack:
# - Large Webpack apps that can't easily migrate to Vite
# - Teams using Webpack-specific loaders/plugins
# - ByteDance open-sourced this; battle-tested at TikTok scale

Biome (ESLint + Prettier in Rust)

// biome.json — one config replaces .eslintrc + .prettierrc
{
  "$schema": "https://biomejs.dev/schemas/1.5.0/schema.json",
  "formatter": {
    "enabled": true,
    "indentStyle": "space",
    "lineWidth": 100
  },
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true
    }
  }
}
# Biome speed on a 1000-file TypeScript monorepo:
# ESLint + Prettier: ~12 seconds
# Biome:            ~0.15 seconds  (80x faster)

# The Biome trade-off:
# ✅ Unified config, blazing fast, actively maintained
# ⚠️ Fewer rules than ESLint (no eslint-plugin-react-hooks yet in 2026)
# ⚠️ Newer — some teams wait for rule parity

# Migration from ESLint: ~2-4 hours for medium codebase
# Migration from Prettier: ~30 minutes

Oxc (The Comprehensive Toolchain)

Oxc (Oxidation Compiler) is the newest entrant — a comprehensive Rust-based JavaScript/TypeScript toolchain aiming to replace multiple tools at once:

# Oxc components:
# oxc_parser    — fastest JS/TS parser (3x faster than SWC parser)
# oxlint        — linter (50-100x faster than ESLint)
# oxc_transform — transformer (competing with SWC)
# rolldown      — Rollup-compatible Rust bundler (powers Vite's future)

# oxlint — try it now
npx oxlint@latest src/

# Comparison on 500 TypeScript files:
# ESLint:  ~5,000ms
# Biome:   ~80ms
# oxlint:  ~50ms   (100x faster than ESLint)

Rolldown (Rust port of Rollup, built by the Vite team) is particularly significant — it's the future production bundler for Vite 6, giving Vite the same Rust speed advantage for production builds that it already has in dev (via esbuild).


The Rust Tooling Map

Transpilation:    Babel → SWC (done)
Formatting:       Prettier → Biome (in progress, ~60% adoption for new projects)
Linting:          ESLint → Biome / oxlint (in progress, ~40% for new projects)
Bundling (app):   Webpack → Turbopack / Rspack / Vite (in progress)
Bundling (lib):   Rollup → Rolldown (coming in Vite 6)
Type checking:    tsc → ? (no Rust replacement yet — tsc remains the authority)

The one thing Rust can't replace: TypeScript's type checker. The type system is complex enough that a Rust reimplementation doesn't exist yet (though teams like Speedy Web Compiler explored it). tsc --noEmit remains the gold standard for type checking in 2026.


When to Choose Rust Tools

ScenarioRust Tool
New Next.js projectTurbopack (default)
Migrating from Webpack (can't use Vite)Rspack
Replacing Babel in custom setupSWC
Replacing ESLint + PrettierBiome
Fastest possible linting in CIoxlint
Publishing npm librarytsup (uses esbuild/Rollup, transitioning to Rolldown)
Framework-specific lint rules neededKeep ESLint + add Biome for formatting

Compare Rust-based tooling package health on PkgPulse.

Comments

Stay Updated

Get the latest package insights, npm trends, and tooling tips delivered to your inbox.