Skip to content

Bundle more packages#17938

Merged
JLHwung merged 18 commits into
babel:mainfrom
JLHwung:bundle-more-packages
Apr 22, 2026
Merged

Bundle more packages#17938
JLHwung merged 18 commits into
babel:mainfrom
JLHwung:bundle-more-packages

Conversation

@JLHwung
Copy link
Copy Markdown
Contributor

@JLHwung JLHwung commented Apr 17, 2026

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link babel/website#3193
Any Dependency Changes?
License MIT

As a follow-up to #14179, in this PR we bundle the following packages before publishing:

  • @babel/cli
  • @babel/node
  • @babel/helper-fixtures
  • @babel/helpers
  • @babel/register
  • @babel/helper-transform-fixture-test-runner
  • @babel/build-external-helpers
  • @babel/eslint-parser
  • @babel/eslint-plugin
  • @babel/eslint-plugin-development
  • @babel/eslint-plugin-development-internal

The build script is also tweaked a bit.

After this PR gets merged, there will be only 4 public packages that are not bundled by rollup:

  • @babel/compat-data (JSON only)
  • @babel/helper-globals (JSON only)
  • @babel/runtime (Many entrypoints, few value for bundling)
  • @babel/runtime-corejs3 (Many entrypoints, few value for bundling)

@JLHwung JLHwung added the PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release label Apr 17, 2026
@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Apr 17, 2026

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/61334

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 17, 2026

Open in StackBlitz

commit: 92156d0

// eslint-disable-next-line n/no-process-exit
process.on("message", () => process.exit(0));
process.channel.unref();
process.channel?.unref();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Per TS error: process.channel may not be defined when the process is not spawned with the IPC channel (taskOpts.ipc)

if (process.platform === "win32") {
fixtures = fixtures.slice(1);
}
testRunner(fixtures, "define-helper");
Copy link
Copy Markdown
Contributor Author

@JLHwung JLHwung Apr 17, 2026

Choose a reason for hiding this comment

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

The fixture folder is split into two fixtures, one is normal and the other is skip-bundled because define-helper.js depends on babel-helpers internals.

tsconfig.json
tsconfig.tsbuildinfo
scripts
data
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We can safely remove data from npm files because it will be bundled into the artifact.

Comment thread Gulpfile.ts Outdated
Comment thread Gulpfile.ts Outdated
Comment on lines +844 to +845
// todo: These package use #import conditions, that we want to leave unbundled.
// Eventually figure out how to bundle the rest.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we support it, right? The bundle logic will look at the #imports and mark them as entrypoints, since #17756

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh I see, this comment is just a leftover?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah these comments are just left as-is. Like you said we have already supported the #import conditions, I will remove them.

@JLHwung JLHwung merged commit 5a30c33 into babel:main Apr 22, 2026
56 checks passed
@JLHwung JLHwung deleted the bundle-more-packages branch April 22, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants