perf: switch from esbuild to rolldown for babel build#3079
Conversation
🦋 Changeset detectedLatest commit: f39ceff The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
WalkthroughThis 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 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
62664f8 to
ad724eb
Compare
ad724eb to
f39ceff
Compare
No description provided.