build: migrate to Babel 7 and restore the broken module build - #2088
Open
aron-intframe wants to merge 1 commit into
Open
aron-intframe wants to merge 1 commit into
aron-intframe wants to merge 1 commit into
Conversation
`make build` has been failing since yargs was bumped to 18 (caolan#2046): support/build/compile-module.js reads the removed `yargs.argv` singleton, so every CJS module compile dies before it starts. CI never runs the build, so nothing caught it. - compile-module.js, generate-index.js, .babelrc and test/mocha.opts move from babel-core 6 / babel-register to @babel/core and @babel/register. Dropping babel-register removes the last Babel 6 dependency (caolan#1992). - babel-core was required directly by compile-module.js while never being declared; @babel/core is a declared devDependency. - syntax-async-generators is gone: @babel/parser handles async generators natively. - rollup-plugin-node-resolve (deprecated) becomes @rollup/plugin-node-resolve; the unused rollup-plugin-npm is dropped. - pass yargs(hideBin(process.argv)) so the compiler CLI parses again. - CI runs `make test-build` on Linux, and support/build.test.js gains an export-parity check between the Babel-built CJS modules and the Babel-free UMD bundle. - .eslintignore skips the generated build/, build-es/ and tmp/ dirs, which are already gitignored. Rebuilding v3.2.6 with the new toolchain reproduces the published async@3.2.6 dist/async.js, dist/async.mjs and dist/async.min.js byte for byte, and all 129 CJS modules keep the same exported names and types. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Description
make buildhas failed since #2046 bumped yargs to 18:support/build/compile-module.jsreads the removedyargs.argvsingleton and dies withCannot destructure property 'file' of 'options' as it is undefined, so no CJS module is ever compiled. CI never runs the build.It also moves the toolchain to Babel 7 (#1992).
@babel/registerreplacesbabel-register, the last thing pulling in the Babel 6 tree (npm audit68 → 44, critical 24 → 2);babel-corewas required directly while never declared. Deprecatedrollup-plugin-node-resolve→@rollup/plugin-node-resolve, unusedrollup-plugin-npmdropped.User-Facing Changes
None. Rebuilt from v3.2.6, the new toolchain reproduces the published
async@3.2.6dist/async.{js,mjs,min.js}byte for byte, and all 129 CJS modules keep the same exported names and types. On boilerplate: the CJS modules total 322,478 bytes vs 320,200, +0.7%.Tests
npm test703 passing,make test-build10 passing, lint clean. CI now runsmake test-buildon Linux (the Windows leg has nomake), andsupport/build.test.jsgained an export-parity check between the Babel-built CJS index and the Babel-free UMD bundle; dropping one re-export turns it red.Known limits: one of four full runs flaked on
retryable("duration should have been greater than 80, but was 79"; 3 reruns and 6 isolated runs pass);perf/benchmark.jsis broken by the same yargs 18 removal and left alone; I only ran Node 24 locally.