Replace ncc with esbuild - #1755
Conversation
|
|
||
| # Ignore optional native extensions for SSH | ||
| dist/*/build/Release/cpufeatures.node | ||
| dist/*/lib/protocol/crypto/build/Release/sshcrypto.node |
There was a problem hiding this comment.
These can be safely ignored because they are no longer generated, they're skipped via passing the --loader:.node=empty flag to esbuild
There was a problem hiding this comment.
Pull request overview
Migrates action packaging from ncc to esbuild, enabling future ESM-only GitHub Actions toolkit upgrades.
Changes:
- Builds flat Node 24 bundles with esbuild.
- Updates action entry points and contributor documentation.
- Removes obsolete ncc artifacts, runtime assets, and source maps.
Show a summary per file
| File | Description |
|---|---|
.gitignore |
Removes native-extension exclusions. |
README.md |
Updates generated-bundle example. |
action.yml |
Uses flat bundle entry points. |
dist/cleanup.js |
Adds esbuild cleanup bundle. |
dist/cleanup/auth.proto |
Removes unused runtime asset. |
dist/cleanup/buildkit_status.proto |
Removes unused BuildKit asset. |
dist/cleanup/index.js |
Removes ncc cleanup bundle. |
dist/cleanup/index.js.map |
Removes cleanup source map. |
dist/cleanup/licenses.txt |
Removes ncc license aggregation. |
dist/cleanup/pagent.exe |
Removes SSH helper. |
dist/cleanup/proto/channelz.proto |
Removes gRPC asset. |
dist/cleanup/proto/protoc-gen-validate/LICENSE |
Removes generated license asset. |
dist/cleanup/proto/protoc-gen-validate/validate/validate.proto |
Removes validation schema. |
dist/cleanup/proto/xds/LICENSE |
Removes generated license asset. |
dist/cleanup/proto/xds/xds/data/orca/v3/orca_load_report.proto |
Removes ORCA schema. |
dist/cleanup/proto/xds/xds/service/orca/v3/orca.proto |
Removes ORCA service schema. |
dist/cleanup/protoc-gen-validate/LICENSE |
Removes duplicate license asset. |
dist/cleanup/protoc-gen-validate/validate/validate.proto |
Removes duplicate validation schema. |
dist/cleanup/sourcemap-register.js |
Removes source-map support. |
dist/cleanup/xds/LICENSE |
Removes duplicate license asset. |
dist/cleanup/xds/xds/data/orca/v3/orca_load_report.proto |
Removes duplicate ORCA schema. |
dist/cleanup/xds/xds/service/orca/v3/orca.proto |
Removes duplicate ORCA service schema. |
dist/main.js |
Adds esbuild main bundle. |
dist/main/auth.proto |
Removes unused runtime asset. |
dist/main/buildkit_status.proto |
Removes unused BuildKit asset. |
dist/main/index.js |
Removes ncc main bundle. |
dist/main/index.js.map |
Removes main source map. |
dist/main/licenses.txt |
Removes ncc license aggregation. |
dist/main/pagent.exe |
Removes SSH helper. |
dist/main/proto/channelz.proto |
Removes gRPC asset. |
dist/main/proto/protoc-gen-validate/LICENSE |
Removes generated license asset. |
dist/main/proto/protoc-gen-validate/validate/validate.proto |
Removes validation schema. |
dist/main/proto/xds/LICENSE |
Removes generated license asset. |
dist/main/proto/xds/xds/data/orca/v3/orca_load_report.proto |
Removes ORCA schema. |
dist/main/proto/xds/xds/service/orca/v3/orca.proto |
Removes ORCA service schema. |
dist/main/protoc-gen-validate/LICENSE |
Removes duplicate license asset. |
dist/main/protoc-gen-validate/validate/validate.proto |
Removes duplicate validation schema. |
dist/main/sourcemap-register.js |
Removes source-map support. |
dist/main/xds/LICENSE |
Removes duplicate license asset. |
dist/main/xds/xds/data/orca/v3/orca_load_report.proto |
Removes duplicate ORCA schema. |
dist/main/xds/xds/service/orca/v3/orca.proto |
Removes duplicate ORCA service schema. |
package-lock.json |
Locks esbuild dependencies. |
package.json |
Replaces ncc packaging with esbuild. |
Review details
Tip
Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 3/43 changed files
- Comments generated: 1
- Review effort level: Balanced
| "lint-check": "eslint **/*.ts", | ||
| "typecheck": "tsc --noEmit", | ||
| "package": "ncc build -o dist/main src/main.ts --source-map --license licenses.txt && ncc build -o dist/cleanup src/cleanup.ts --source-map --license licenses.txt", | ||
| "package": "esbuild src/main.ts src/cleanup.ts --bundle --platform=node --target=node24 --outdir=dist --loader:.node=empty", |
There was a problem hiding this comment.
Yes, I've got an open discussion internally with the licensing team about this. That is expected to be resolved in a few days.
In the meantime, the default is sufficient for now and whatever they tell us will be a fast-follow PR before we cut our next release.
I do not want to block this PR on ☝️ because there's some other additional PR's (like the
ones) that are blocked on the migration to esbuild.
Why this is required
This is a prerequisite for updating the GitHub Actions toolkit dependencies, not just a build-tool cleanup. The next major versions of
@actions/core,@actions/github, and@actions/http-clientare ESM-only, and the current ncc build cannot package them into a self-contained action reliably.The migration unblocks these open Dependabot PRs:
@actions/core2.0.2 to 3.0.1@actions/http-client3.0.1 to 4.0.1@actions/github6.0.1 to 9.1.1undici,@actions/http-client, and@actions/githubupdates, including Undici security fixesUnder ncc, those updates currently fail build and runtime checks. For example, the
@actions/coreupdate leavesrequire("@actions/core")unresolved and fails on a clean runner withCannot find module '@actions/core'. The@actions/githubupdate also causes ncc to fail resolving the package's exportedlib/contexttypes. Esbuild understands the newer ESM package exports and still emits the CommonJS bundles required by this Node 24 action.Benefits
@actions/*dependency updates, including security-related transitive updatesdistoutput from 40 files and 17.3 MB to 2 files and 6.5 MB, a roughly 62% reduction--platform=node --target=node24Implementation
@vercel/nccwith esbuild and bundle both Node 24 action entry points in one commanddist/main.jsanddist/cleanup.jsentry points.nodeSSH accelerators as empty because this action supports local Unix Docker sockets, not remote Docker over SSHEsbuild currently uses its bundled-output default for legal comments (
eof), preserving recognized notices inside each JavaScript bundle while OSPO guidance is pending.Validation
npm run format-checknpm run typechecknpm run lint-checkmainnpm run fetch-images -- bundler && npm run test-integration(17 tests)npm clean-install && npm run package && script/check-diff