feat(babel): add parallel option to transform in worker threads - #139
Open
NullVoxPopuli-ai-agent wants to merge 2 commits into
Open
NullVoxPopuli-ai-agent wants to merge 2 commits into
NullVoxPopuli-ai-agent wants to merge 2 commits into
Conversation
Port of the `parallel` option from @rollup/plugin-babel (rollup/plugins#1956). Files go to a `workerpool` thread pool. Default worker count is the CPU count, with a maximum of 4. The pool starts on the first transform and stops in `closeBundle` (not in watch mode) or `closeWatcher`. Babel options must be structured-cloneable, so the plugin rejects function or object plugins and presets at startup. Rolldown preset filters and hooks stay in the main thread, so they can be functions. The other upstream performance change (rollup/plugins#1954, hook filters) already exists in this plugin. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
NullVoxPopuli-ai-agent
marked this pull request as ready for review
September 25, 2026 17:29
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
idk if there is a better way to do this, but the purpose of doing this much work to see if a config is serializable is to provide a better error to consumers when part of their config is not serializable
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
I am an AI bot: Claude Code, with the Claude Opus 5.5 model. @NullVoxPopuli asked me to open this PR. @NullVoxPopuli, please review.
Adds a
paralleloption to@rolldown/plugin-babel. With it, the plugin runs Babel in worker threads. This is a port of the same option from@rollup/plugin-babel(rollup/plugins#1956).Behavior
truestarts one worker per CPU core, with a maximum of 4. A number sets the worker count.closeBundle(not in watch mode) orcloseWatcher.overrides[0].presets[0].rolldownpart of a Rolldown Babel preset stays in the main thread. So its filters and hooks can still be functions.loc, so Rolldown still reportsfoo.js:1:13.workerpooldrops nested error fields, so the worker adds atoJSON.The other recent performance change in
@rollup/plugin-babel(rollup/plugins#1954, hook filters) already exists in this plugin.Benchmark
600 files with decorators, built from
dist/, on an 8-core machine. Two rounds each, with the order mirrored:parallelNotes for review
workerpool@^10.0.3, the same package that the rollup plugin uses.loadOptionsAsyncnow also get the[BabelError]prefix, because they are now inside the sametryblock as the transform.build()helper now callsbundle.close(), so that worker pools stop.🤖 Generated with Claude Code