Skip to content

perf: switch from esbuild to rolldown for babel build#3079

Merged
DylanPiercey merged 1 commit intomainfrom
use-rolldown-babel-build
Feb 6, 2026
Merged

perf: switch from esbuild to rolldown for babel build#3079
DylanPiercey merged 1 commit intomainfrom
use-rolldown-babel-build

Conversation

@DylanPiercey
Copy link
Contributor

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2026

🦋 Changeset detected

Latest commit: f39ceff

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@marko/compiler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Walkthrough

This pull request introduces rolldown as a new build tool for bundling. Changes include adding rolldown as a devDependency in the root package.json, replacing the esbuild-based build-babel.ts script with a new rolldown-based bundle-babel.mts script in the compiler package, and updating the compiler's build script to invoke the new bundling script. Additionally, a new bundle.mts script is added to the runtime-tags package to manage multi-target builds across different environments and formats. A changeset documents the compiler package patch.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess relevance to the changeset. Add a brief description explaining the motivation for switching to rolldown and any expected benefits or performance improvements.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: switching the Babel build from esbuild to rolldown for performance improvements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch use-rolldown-babel-build

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@package.json`:
- Line 81: The dependency version for rolldown in package.json is using a caret
range ("^1.0.0-rc.3") which allows upgrades; change the version string for the
"rolldown" dependency to the exact pin "1.0.0-rc.3" (remove the caret) and then
reinstall/update lockfile (npm/yarn/pnpm) so the lockfile reflects the pinned
version; update any package manager lockfile accordingly.

In `@packages/compiler/package.json`:
- Line 66: The build script invokes node scripts/bundle-babel.mts which requires
Node 22.6+; to keep compatibility with the current "engines" range ("node": "18
|| 20 || >=22") modify the "build" script entry in package.json so it uses the
existing ~ts register (or an explicit Node flag) instead of relying on native
.mts stripping; update the "build" script string referenced as "build" to run
node -r ~ts scripts/bundle-babel.mts (or alternatively bump the "engines" field
to ">=22.6" if you want to require newer Node), ensuring you change the "build"
script and/or the "engines" value accordingly.

In `@packages/runtime-tags/scripts/bundle.mts`:
- Around line 36-74: The nested .map calls around the build(...) invocation do
not return the inner promises, so the async callbacks (the anonymous async
function that calls build) are never collected/ awaited; change the outer
.map/.map/.map chain to return the results (or use flatMap/flat and then wrap
with Promise.all) so that the Promise returned by each async callback is
included and awaited by Promise.all; specifically ensure the anonymous async
callback that calls build, the surrounding ["dom","html"].map and the top-level
["dist/debug","dist"].map all return their mapped values so Promise.all receives
the full array of build() promises.
🧹 Nitpick comments (1)
packages/runtime-tags/scripts/bundle.mts (1)

1-7: TODO noted for future optimization tracking.

The referenced issues (oxc-project/oxc#6073 and #15375) track optimizations needed before this can fully replace ./build.ts.

Would you like me to open an issue to track when these upstream optimizations land so the migration can be completed?

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.01%. Comparing base (de87dba) to head (f39ceff).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3079   +/-   ##
=======================================
  Coverage   89.01%   89.01%           
=======================================
  Files         370      370           
  Lines       46705    46705           
  Branches     4155     4155           
=======================================
  Hits        41575    41575           
  Misses       5078     5078           
  Partials       52       52           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DylanPiercey DylanPiercey force-pushed the use-rolldown-babel-build branch from 62664f8 to ad724eb Compare February 6, 2026 16:55
@DylanPiercey DylanPiercey force-pushed the use-rolldown-babel-build branch from ad724eb to f39ceff Compare February 6, 2026 16:56
@DylanPiercey DylanPiercey merged commit 06842e9 into main Feb 6, 2026
11 checks passed
@DylanPiercey DylanPiercey deleted the use-rolldown-babel-build branch February 6, 2026 17:09
@github-actions github-actions bot mentioned this pull request Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant