8000 [Babel 8] Disallow excess arguments in babel-external-helpers by JLHwung · Pull Request #17741 · babel/babel · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@JLHwung
Copy link
Contributor
@JLHwung JLHwung commented Jan 27, 2026
Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes? Bumped commander, glob and slash to the latest major releases.
License MIT

In this PR we bumped three external dependencies to the latest major releases. As a result of the commander.js update, the babel-external-helpers cli now rejects excess arguments. I think this change is reasonable as that script does not expect an input argument, any passed arguments might indicate that there is something wrong, i.e. if --output-type is written as output-type, this check will throw an error "unexpected arguments", currently the script will silently accept the arguments even if they are not used.

Aside: I think we could also consider extract the babel-external-helpers script from the babel-cli library, maybe into a dedicate library, since most @babel/cli users would not need this script.

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

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

// register an empty action handler so that program.js can throw on
// unknown options _after_ args
// see https://github.com/tj/program.js/issues/561#issuecomment-522209408
program.action(() => {});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The empty action handler is also removed as the upstream issue was fixed.

@pkg-pr-new
Copy link
pkg-pr-new bot commented Jan 27, 2026

Open in StackBlitz

commit: 599fbee

Copy link
Member
@liuxingbaoyu liuxingbaoyu left a comment

Choose a reason for hiding this comment

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

The CI error appears unrelated.

@JLHwung
Copy link
Contributor Author
JLHwung commented Jan 27, 2026

Yes, the CI error is from setup-node. It seems that the action struggles to retrieve the information of the new node.js release 25.5.0.

@liuxingbaoyu
Copy link
Member
liuxingbaoyu commented Jan 27, 2026

I also noticed that downloading Node.js v0.10 in test262 timed out, which suggests a problem with the Node.js server. Although I didn't encounter any issues accessing it locally.

Updated:
https://www.cloudflarestatus.com/incidents/3xb30dhqfkw7

// unknown options _after_ args
// see https://github.com/tj/program.js/issues/561#issuecomment-522209408
program.action(() => {});
program.usage("[options] [files...]");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The usage is updated from <files...> to [files...], because in the REPL -e mode, the files argument is not required.

@nicolo-ribaudo
Copy link
Member

Aside: I think we could also consider extract the babel-external-helpers script from the babel-cli library, maybe into a dedicate library, since most @babel/cli users would not need this script.

To be honest I have no idea why nowdays somebody would want to use external helpers 😅

@nicolo-ribaudo nicolo-ribaudo merged commit 0df8d86 into babel:main Jan 28, 2026
106 of 128 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the bump-deps branch January 28, 2026 17:22
@JLHwung
Copy link
Contributor Author
JLHwung commented Jan 28, 2026

Aside: I think we could also consider extract the babel-external-helpers script from the babel-cli library, maybe into a dedicate library, since most @babel/cli users would not need this script.

To be honest I have no idea why nowdays somebody would want to use external helpers 😅

Exactly, if we split external-helpers-cli from babel-cli, we can gather the actual usage data from the % of downloads. If the dedicate library does not see very much usage and we receive no complaints from the removal in Babel 8, we can discontinue that library in Babel 9.

@nicolo-ribaudo
Copy link
Member

Ok let's do it 👍

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

0