Skip to content

Build the dist files with Rolldown - #42758

Merged
mdo merged 2 commits into
v6-devfrom
rolldown-dist
Jul 28, 2026
Merged

Build the dist files with Rolldown#42758
mdo merged 2 commits into
v6-devfrom
rolldown-dist

Conversation

@mdo

@mdo mdo commented Jul 27, 2026

Copy link
Copy Markdown
Member

Draft on purpose: queued behind #42724 and #42732. It stacks on #42732's branch and auto-retargets as the parents merge. Mark it ready after both land and a final rebase + rebuild.

Adopts the second proposal from #42620: build the dist files with Rolldown. Karma and the integration configs stay on Rollup until karma-rolldown-preprocessor ships an upstream fix.

  • Why Rolldown: it is Rollup's native-speed successor and already sits in our lockfile — Vite 8 (via Astro 7) builds the docs with it today. Adopting it for our own dist adds no new supply chain.
  • Speed: bundling drops from ~700ms to ~20ms per bundle; the 34 per-plugin builds finish in ~15ms total. Watch-mode rebuilds become near-instant. Total npm run js time is still dominated by terser and tsc.
  • Less tooling in the dist path: resolve.extensionAlias replaces our custom rollup-plugin-ts-resolve.cjs here, and Rolldown's built-in transforms replace Babel — which applies zero transforms at our browser floors (verified: output is byte-identical with and without it). Both stay installed for Karma.
  • Browser targets live in build/browser-targets.mjs with a comment tying them to .browserslistrc, since Rolldown does not read browserslist.
  • Output equivalence, verified: identical export statements; verbatim relative specifiers in js/dist/*.js; process.env.NODE_ENV fully replaced in the bundle; banner survives terser; the build is deterministic (two runs, zero drift). Minified sizes are slightly smaller (32.64 vs 32.77 kB gzip standalone; 54.63 vs 54.77 kB bundle).
  • Gates run against the new output: full Karma suite (1192 tests), the integration builds (Rollup re-bundles the new dist/js/bootstrap.js — proves it is consumable ESM), the consumer type test (js-typecheck-dist), lint, typecheck, bundlewatch, and the docs build (the site consumes the new bundle through its @bootstrap alias).
  • Churn note: the unminified dist/js/dist files change formatting wholesale in the rebuild commit (Rolldown's output style; ~19k insertions / ~25k deletions, net smaller). The unminified bundlewatch budgets now carry slack (41.6 kB actual vs 60.25 kB budget) and can ratchet down after merge.
  • rolldown is pinned exactly (1.2.0) — pre-2.0 API drift is real; we saw an option move between minor versions during evaluation.

References #42620.

@mdo
mdo force-pushed the rolldown-dist branch 2 times, most recently from bae39dd to 9f9996b Compare July 28, 2026 00:38
@github-project-automation github-project-automation Bot moved this to Inbox in v6.0.0 Jul 28, 2026
@mdo
mdo force-pushed the post-ts-followups branch from ed46ba3 to 5357dd8 Compare July 28, 2026 06:02
Base automatically changed from post-ts-followups to v6-dev July 28, 2026 06:04
mdo added 2 commits July 27, 2026 23:08
Rolldown is Rollup's native-speed successor and already sits in our lockfile
through Vite and Astro, so the docs build uses it today. Moving our dist
builds to it makes bundling about 35x faster and deletes tooling: the
built-in `resolve.extensionAlias` replaces our custom ts-resolve plugin in
this path, and the built-in transforms replace Babel, which applies zero
transforms at our browser floors. Browser targets live in
`build/browser-targets.mjs`; keep them in sync with `.browserslistrc`.

Karma and the integration configs stay on Rollup and Babel until
karma-rolldown-preprocessor ships a fix, so those dependencies remain.

Output stays equivalent: identical exports, verbatim relative specifiers in
js/dist, `process.env.NODE_ENV` replaced in the bundle, banner preserved
through terser, and minified sizes within a fraction of a percent (slightly
smaller). The unminified files change formatting wholesale in the rebuild
commit; their bundlewatch budgets now carry slack that can ratchet down.
@mdo
mdo force-pushed the rolldown-dist branch from 9f9996b to 0df1563 Compare July 28, 2026 06:10
@mdo
mdo marked this pull request as ready for review July 28, 2026 06:10
@mdo
mdo requested a review from a team as a code owner July 28, 2026 06:10
@mdo
mdo merged commit b5a89d6 into v6-dev Jul 28, 2026
12 checks passed
@mdo
mdo deleted the rolldown-dist branch July 28, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

2 participants