Skip to content

perf(cli): 34% smaller CLI bundle, 15x smaller prompt deps - #1671

Open
lukecotter wants to merge 1 commit into
jsforce:mainfrom
lukecotter:feat-update-inquirer-to-inquirer-prompts
Open

lukecotter wants to merge 1 commit into
jsforce:mainfrom
lukecotter:feat-update-inquirer-to-inquirer-prompts

Conversation

@lukecotter

@lukecotter lukecotter commented Mar 22, 2025 •

Copy link
Copy Markdown
Contributor

Replaces inquirer with @inquirer/input, @inquirer/password and @inquirer/confirm.

The CLI uses only these 3 prompt types.

before after change
CLI bundle (lib/cli/cli.js), minified 2,540 KB 1,686 KB 34% smaller
CLI bundle, gzip 736 KB 455 KB 38% smaller
prompt deps only, minified 896 KB 61 KB 14.7x smaller
prompt deps only, gzip 296 KB 20 KB 14.9x smaller
jsforce production deps install 68.8 MB, 104 packages 51.1 MB, 79 packages 26% smaller

Bundles size tested using esbuild (--platform=node --minify).

The change also removes lodash 4.17.21 (SNYK-JS-LODASH-15869625), rxjs and ora. Fixes #1788. Makes the lodash override in #1834 unnecessary.

The new inquirer packages ship CommonJS, so the build and supported Node versions do not need to change.

inquirer 8 pulls in lodash, rxjs and ora. lodash 4.17.21 has
SNYK-JS-LODASH-15869625 and there is no patched inquirer 8.x.
The CLI uses only 3 prompt types, so use those packages directly.
They ship CommonJS, so the build does not change.

Keep the REPL pause/resume around each prompt. Keep the Ctrl+C
behaviour: the new prompts throw ExitPromptError, so send SIGINT
as inquirer 8 did.
@lukecotter
lukecotter force-pushed the feat-update-inquirer-to-inquirer-prompts branch from 2c78ade to 2c78c78 Compare October 6, 2026 10:45
@lukecotter lukecotter changed the title chore: update inquirer to inquirer/prompts perf(cli): prompt deps 15x smaller when bundled (896 KB -> 61 KB) Oct 6, 2026
@lukecotter lukecotter changed the title perf(cli): prompt deps 15x smaller when bundled (896 KB -> 61 KB) perf(cli): 34% smaller CLI bundle, 15x smaller prompt deps Oct 6, 2026

This branch has not been deployed

No deployments
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.

[SECURITY] Arbitrary Code Injection in [email protected]

1 participant