Update Babel v8#3455
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR updates Babel plugin references, simplifies two cleanup-resource fetch tests, and patches jest-leak-detector to use a different garbage-collection approach. ChangesBabel and test runtime updates
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅
|
✅
|
There was a problem hiding this comment.
Pull request overview
This pull request updates the repository’s Babel toolchain to Babel v8, aligning build/test transpilation with the latest Babel major release and updating plugin package names to their Babel 8 equivalents.
Changes:
- Bump Babel devDependencies to v8 (
@babel/core,@babel/preset-env,@babel/preset-typescript). - Rename Babel plugins from
plugin-proposal-*toplugin-transform-*in dependencies and configuration.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| package.json | Updates Babel-related devDependency versions and plugin package names to Babel v8. |
| babel.config.js | Updates Babel plugin entries to match the new Babel v8 plugin package names. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "@babel/core": "8.0.1", | ||
| "@babel/plugin-transform-class-properties": "8.0.1", | ||
| "@babel/plugin-transform-explicit-resource-management": "8.0.1", | ||
| "@babel/preset-env": "8.0.2", | ||
| "@babel/preset-typescript": "8.0.1", |
✅
|
✅
|
✅
|
✅
|
✅
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@babel.config.js`:
- Around line 7-8: The Jest transform setup is using a Babel 8-incompatible
babel-jest version while babel.config.js already targets Babel 8, so update the
Jest/babel-jest dependency pair together. Check the Jest transform path and the
relevant package.json entries for babel-jest and Jest, and bump them to matching
Babel 8-capable releases so the test runner can load the Babel config at
runtime.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: aad22cd8-b0c0-4ef6-9963-388f175c8ba9
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
babel.config.jspackage.json
| '@babel/plugin-transform-class-properties', | ||
| '@babel/plugin-transform-explicit-resource-management', |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check installed jest/babel-jest versions and their Babel 8 support
fd package.json -d 1 --exec cat {} \; 2>/dev/null | jq '.devDependencies | {jest, "babel-jest": ."babel-jest"}'
rg -n '"jest"|"babel-jest"' package.jsonRepository: ardatan/whatwg-node
Length of output: 262
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '## package.json relevant deps'
python3 - <<'PY'
import json
from pathlib import Path
p = json.loads(Path('package.json').read_text())
for section in ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies']:
deps = p.get(section, {})
picks = {k: deps[k] for k in deps if k.startswith('`@babel/`') or k in ('jest', 'babel-jest')}
if picks:
print(section, json.dumps(picks, indent=2, sort_keys=True))
PY
echo
echo '## babel.config.js'
cat -n babel.config.js
echo
echo '## jest.config.js'
cat -n jest.config.jsRepository: ardatan/whatwg-node
Length of output: 2527
🌐 Web query:
babel-jest 30.4.1 Babel 8 support @babel/core 8 compatibility
💡 Result:
Babel 8 support is not fully integrated into babel-jest version 30.4.1 [1][2]. While babel-jest 30.4.1 (released May 8, 2026) included initial preparations for Babel 8, such as updating internal plugin configurations to use 'denylist' instead of 'blacklist' [3], it does not provide comprehensive support for Babel 8 [4]. The Jest project officially introduced Babel 8 support in later releases [5][6]. Following the official release of Babel 8.0.0 on June 16, 2026 [7], the Jest repository initiated updates to its dependencies to align with the new major version [6]. Users requiring full Babel 8 compatibility should ensure they are using a more recent version of Jest/babel-jest than 30.4.1, as the project has been actively updating its dependency tree to support the @babel/core 8.x ecosystem [6].
Citations:
- 1: jestjs/jest@v30.4.0...v30.4.1
- 2: https://newreleases.io/project/npm/babel-jest/release/30.4.1
- 3: https://github.com/jestjs/jest/blob/HEAD/CHANGELOG.md
- 4: Support Babel 8 in plugins and presets jestjs/jest#15750
- 5: https://github.com/jestjs/jest/blob/main/CHANGELOG.md
- 6: fix(deps): update babel monorepo to v8 jestjs/jest#16257
- 7: https://babeljs.io/blog/2026/06/16/8.0.0/
Upgrade babel-jest for Babel 8
package.json pins @babel/core@8.0.1, but babel-jest@30.4.1 still needs a Babel 8-capable release. Update Jest/babel-jest together or the Jest transform path can fail at runtime.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@babel.config.js` around lines 7 - 8, The Jest transform setup is using a
Babel 8-incompatible babel-jest version while babel.config.js already targets
Babel 8, so update the Jest/babel-jest dependency pair together. Check the Jest
transform path and the relevant package.json entries for babel-jest and Jest,
and bump them to matching Babel 8-capable releases so the test runner can load
the Babel config at runtime.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
package.json (1)
40-44: 🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick winNode 18 test path can’t run with Babel 8
test:18/test:18:leaksstill route Jest throughbabel-jest(package.json,jest.config.js), but Babel 8 requires Node^22.18.0 || >=24.11.0. Drop the Node 18 job or keep Babel 7 on that path.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` around lines 40 - 44, The Node 18 Jest path is still going through babel-jest while the repo has Babel 8 dependencies, but Babel 8 does not support Node 18. Update the Node 18 test route by either removing/disabling the test:18 and test:18:leaks jobs or ensuring that the Jest path for those scripts uses Babel 7 instead; check the package.json test scripts and the Jest configuration symbols that wire Jest through babel-jest.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/tests.yml:
- Around line 100-114: The Unit Tests workflow still runs Node 18 through the
test:18 path, but that job uses the Babel 8/Jest stack that is incompatible with
Node 18. Update the tests workflow so matrix.node-version 18 is excluded from
the Unit Tests and leak-related jobs, or switch the test:18 and test:18:leaks
commands to a Node 18-compatible Jest/Babel setup. Use the existing Unit Tests
retry step and the test:18/test:18:leaks commands as the symbols to locate and
adjust the affected workflow entries.
---
Outside diff comments:
In `@package.json`:
- Around line 40-44: The Node 18 Jest path is still going through babel-jest
while the repo has Babel 8 dependencies, but Babel 8 does not support Node 18.
Update the Node 18 test route by either removing/disabling the test:18 and
test:18:leaks jobs or ensuring that the Jest path for those scripts uses Babel 7
instead; check the package.json test scripts and the Jest configuration symbols
that wire Jest through babel-jest.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 13331611-2d95-4b23-b6a4-9e7bf395d91e
📒 Files selected for processing (2)
.github/workflows/tests.ymlpackage.json
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
packages/node-fetch/tests/cleanup-resources.spec.ts (1)
25-28: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueSimplified assertions reduce test signal.
Both cases now just
await fetch(...)with no assertion on the response at all, so the test would only fail iffetch()throws. Given the PR's stated goal of fixing httpbin flakiness (rate limiting returning 503), dropping the conditionalstatus !== 503check makes sense, but dropping theexpect(response.ok).toBe(true)assertion entirely means a valid (non-503) failing response wouldn't be caught.♻️ Suggested tweak to retain some signal
- await fetch(baseUrl + '/get'); + const response = await fetch(baseUrl + '/get'); + if (response.status !== 503) { + expect(response.ok).toBe(true); + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/node-fetch/tests/cleanup-resources.spec.ts` around lines 25 - 28, The cleanup-resources tests have become too weak because they only call fetch() and never verify the response, so a non-503 failure would slip through. Update the affected cases in cleanup-resources.spec.ts to keep the simplified httpbin handling while still asserting success for the response returned by fetch, using the existing fetch-based test flow in the relevant it blocks.patches/jest-leak-detector+30.4.1.patch (1)
10-10: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value
--allow-natives-syntaxis never disabled after use.The removed
_runGarbageCollectortoggled--expose-gcoff again if it wasn't already exposed, minimizing the window of an elevated capability. The new code callssetFlagsFromString('--allow-natives-syntax')on everyisLeaking()invocation and never restores it, leaving V8 natives syntax (%CollectGarbage,%DebugPrint, etc.) permanently enabled for the remainder of the test process after the first call. This is test-tooling code with limited blast radius, but it is a broader/more persistent capability exposure than the mechanism it replaces.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@patches/jest-leak-detector`+30.4.1.patch at line 10, The `isLeaking()` path now enables V8 natives syntax via `setFlagsFromString('--allow-natives-syntax')` without ever restoring the previous state. Update the Jest leak detector logic around `isLeaking` and the removed `_runGarbageCollector` behavior so the capability is only enabled for the shortest possible scope, or gated behind a check that preserves the prior flags and restores them afterward. Use the existing leak-detector helper flow to keep the flag change localized and avoid leaving native syntax permanently enabled for the rest of the test process.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@patches/jest-leak-detector`+30.4.1.patch:
- Around line 8-16: The change in isLeaking is using a nonexistent v8 helper
alias, which will fail at runtime. Update the v8 flags call to use the existing
helper symbol already present in this bundle (the _nodeV()/v8 helper used
elsewhere) or add the missing alias if this patch is meant for a different
build. Keep the rest of the garbage-collection flow in isLeaking unchanged.
---
Nitpick comments:
In `@packages/node-fetch/tests/cleanup-resources.spec.ts`:
- Around line 25-28: The cleanup-resources tests have become too weak because
they only call fetch() and never verify the response, so a non-503 failure would
slip through. Update the affected cases in cleanup-resources.spec.ts to keep the
simplified httpbin handling while still asserting success for the response
returned by fetch, using the existing fetch-based test flow in the relevant it
blocks.
In `@patches/jest-leak-detector`+30.4.1.patch:
- Line 10: The `isLeaking()` path now enables V8 natives syntax via
`setFlagsFromString('--allow-natives-syntax')` without ever restoring the
previous state. Update the Jest leak detector logic around `isLeaking` and the
removed `_runGarbageCollector` behavior so the capability is only enabled for
the shortest possible scope, or gated behind a check that preserves the prior
flags and restores them afterward. Use the existing leak-detector helper flow to
keep the flag change localized and avoid leaving native syntax permanently
enabled for the rest of the test process.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d9c30b87-d83f-4d47-86b1-fe990b0f0bcc
📒 Files selected for processing (2)
packages/node-fetch/tests/cleanup-resources.spec.tspatches/jest-leak-detector+30.4.1.patch
Related #3439
Related #3442
Related #3443