Skip to content

Update Babel v8#3455

Closed
ardatan wants to merge 13 commits into
masterfrom
update-babel-version
Closed

Update Babel v8#3455
ardatan wants to merge 13 commits into
masterfrom
update-babel-version

Conversation

@ardatan

@ardatan ardatan commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Related #3439
Related #3442
Related #3443

Copilot AI review requested due to automatic review settings July 2, 2026 10:16
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR updates Babel plugin references, simplifies two cleanup-resource fetch tests, and patches jest-leak-detector to use a different garbage-collection approach.

Changes

Babel and test runtime updates

Layer / File(s) Summary
Babel plugin names
babel.config.js
babel.config.js switches the class-properties and explicit-resource-management plugins to their transform variants.
Cleanup resource tests
packages/node-fetch/tests/cleanup-resources.spec.ts
The HTTP and HTTPS resource-cleanup cases drop response capture and status assertions, leaving only the fetch() call.
Leak detector patch
patches/jest-leak-detector+30.4.1.patch
LeakDetector.isLeaking() now uses --allow-natives-syntax with %CollectGarbage(true), and the old GC helper is removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: dependencies
Suggested reviewers: enisdenjo

Poem

A bunny hops through Babel’s gate,
And tests grow lean, concise, and straight.
GC twitches in the night,
While plugin names now read just right. 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately highlights the main change: upgrading Babel to v8.
Description check ✅ Passed The description is related to the pull request and links to associated upstream changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-babel-version

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@benchmarks/node-fetch results (consumeBody)

   ✓ active_handles.................: avg=136.870336 min=55       med=135     max=201      p(90)=162     p(95)=170    
     data_received..................: 35 MB  1.2 MB/s
     data_sent......................: 22 MB  741 kB/s
     http_req_blocked...............: avg=2.47µs     min=320ns    med=951ns   max=4.64ms   p(90)=1.5µs   p(95)=1.75µs 
     http_req_connecting............: avg=1.13µs     min=0s       med=0s      max=4.56ms   p(90)=0s      p(95)=0s     
     http_req_duration..............: avg=13.18ms    min=175.69µs med=12.58ms max=585.52ms p(90)=18.03ms p(95)=20.98ms
       { expected_response:true }...: avg=13.18ms    min=175.69µs med=12.58ms max=585.52ms p(90)=18.03ms p(95)=20.98ms
     http_req_failed................: 0.00%  ✓ 0           ✗ 226726
     http_req_receiving.............: avg=30.86µs    min=5.62µs   med=17.45µs max=19.48ms  p(90)=31.58µs p(95)=39.82µs
     http_req_sending...............: avg=10.08µs    min=1.66µs   med=4.97µs  max=17.22ms  p(90)=7.92µs  p(95)=12.65µs
     http_req_tls_handshaking.......: avg=0s         min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     http_req_waiting...............: avg=13.14ms    min=151.17µs med=12.54ms max=585.26ms p(90)=17.98ms p(95)=20.91ms
     http_reqs......................: 226726 7556.980418/s
     iteration_duration.............: avg=26.44ms    min=4.28ms   med=25.4ms  max=599.13ms p(90)=31.78ms p(95)=34.24ms
     iterations.....................: 113339 3777.690267/s
     vus............................: 100    min=100       max=100 
     vus_max........................: 100    min=100       max=100 

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@benchmarks/node-fetch results (noConsumeBody)

   ✓ active_handles.................: avg=137.314568 min=30       med=136     max=200      p(90)=162     p(95)=168    
     data_received..................: 28 MB  940 kB/s
     data_sent......................: 18 MB  609 kB/s
     http_req_blocked...............: avg=2.13µs     min=390ns    med=1.15µs  max=16.41ms  p(90)=1.85µs  p(95)=2.21µs 
     http_req_connecting............: avg=323ns      min=0s       med=0s      max=3.32ms   p(90)=0s      p(95)=0s     
     http_req_duration..............: avg=16.2ms     min=537.18µs med=15.32ms max=782.51ms p(90)=22.32ms p(95)=26.48ms
       { expected_response:true }...: avg=16.2ms     min=537.18µs med=15.32ms max=782.51ms p(90)=22.32ms p(95)=26.48ms
     http_req_failed................: 0.00%  ✓ 0           ✗ 184402
     http_req_receiving.............: avg=40.88µs    min=7.73µs   med=21.67µs max=33.47ms  p(90)=40.9µs  p(95)=55.26µs
     http_req_sending...............: avg=12.76µs    min=2.37µs   med=6.61µs  max=19.7ms   p(90)=10.59µs p(95)=17.55µs
     http_req_tls_handshaking.......: avg=0s         min=0s       med=0s      max=0s       p(90)=0s      p(95)=0s     
     http_req_waiting...............: avg=16.15ms    min=509.95µs med=15.28ms max=782.16ms p(90)=22.26ms p(95)=26.38ms
     http_reqs......................: 184402 6145.787599/s
     iteration_duration.............: avg=32.51ms    min=7.54ms   med=30.7ms  max=798.81ms p(90)=39.71ms p(95)=43.37ms
     iterations.....................: 92193  3072.627174/s
     vus............................: 100    min=100       max=100 
     vus_max........................: 100    min=100       max=100 

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-* to plugin-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.

Comment thread package.json
Comment on lines +38 to +42
"@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",
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@benchmarks/server results (undici)

     ✓ response code was 200
     ✓ valid response structure

   ✓ checks.........................: 100.00% ✓ 629620      ✗ 0     
     data_received..................: 63 MB   696 kB/s
     data_sent......................: 47 MB   521 kB/s
     http_req_blocked...............: avg=1.2µs    min=842ns    med=1.07µs   max=222.06µs p(90)=1.29µs   p(95)=1.53µs  
     http_req_connecting............: avg=0ns      min=0s       med=0s       max=169.76µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=228.2µs  min=178.41µs med=218.65µs max=12.39ms  p(90)=244.58µs p(95)=256.32µs
       { expected_response:true }...: avg=228.2µs  min=178.41µs med=218.65µs max=12.39ms  p(90)=244.58µs p(95)=256.32µs
     http_req_failed................: 0.00%   ✓ 0           ✗ 314810
     http_req_receiving.............: avg=25.81µs  min=14.36µs  med=25.73µs  max=5.54ms   p(90)=28.72µs  p(95)=30.01µs 
     http_req_sending...............: avg=6.99µs   min=5µs      med=6.13µs   max=2.2ms    p(90)=7.27µs   p(95)=8.75µs  
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=195.38µs min=145.05µs med=185.3µs  max=12.35ms  p(90)=210.08µs p(95)=221.36µs
     http_reqs......................: 314810  3497.877854/s
     iteration_duration.............: avg=280.65µs min=224.48µs med=270.29µs max=12.48ms  p(90)=302.44µs p(95)=317.11µs
     iterations.....................: 314810  3497.877854/s
     vus............................: 1       min=1         max=1   
     vus_max........................: 1       min=1         max=1   

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@benchmarks/server results (vanilla)

     ✓ response code was 200
     ✓ valid response structure

   ✓ checks.........................: 100.00% ✓ 865872      ✗ 0     
     data_received..................: 79 MB   876 kB/s
     data_sent......................: 65 MB   717 kB/s
     http_req_blocked...............: avg=1.28µs   min=812ns    med=1.09µs   max=4.54ms   p(90)=1.6µs    p(95)=1.77µs  
     http_req_connecting............: avg=0ns      min=0s       med=0s       max=134.82µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=148.49µs min=103.73µs med=144.76µs max=5.53ms   p(90)=169.07µs p(95)=177.28µs
       { expected_response:true }...: avg=148.49µs min=103.73µs med=144.76µs max=5.53ms   p(90)=169.07µs p(95)=177.28µs
     http_req_failed................: 0.00%   ✓ 0           ✗ 432936
     http_req_receiving.............: avg=22.66µs  min=11.76µs  med=22.4µs   max=4.87ms   p(90)=28.21µs  p(95)=31.69µs 
     http_req_sending...............: avg=7.13µs   min=4.82µs   med=6.23µs   max=5.27ms   p(90)=8.81µs   p(95)=9.72µs  
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=118.69µs min=77.83µs  med=115.07µs max=5.35ms   p(90)=136.03µs p(95)=142.92µs
     http_reqs......................: 432936  4810.390115/s
     iteration_duration.............: avg=202.51µs min=145.42µs med=199.46µs max=6.33ms   p(90)=227.31µs p(95)=237.43µs
     iterations.....................: 432936  4810.390115/s
     vus............................: 1       min=1         max=1   
     vus_max........................: 1       min=1         max=1   

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@benchmarks/server results (native)

     ✓ response code was 200
     ✓ valid response structure

   ✓ checks.........................: 100.00% ✓ 634826      ✗ 0     
     data_received..................: 63 MB   702 kB/s
     data_sent......................: 47 MB   526 kB/s
     http_req_blocked...............: avg=1.22µs   min=871ns    med=1.05µs   max=5.7ms    p(90)=1.26µs   p(95)=1.52µs  
     http_req_connecting............: avg=0ns      min=0s       med=0s       max=241.36µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=228.7µs  min=174.83µs med=217.96µs max=6.84ms   p(90)=247.13µs p(95)=258.47µs
       { expected_response:true }...: avg=228.7µs  min=174.83µs med=217.96µs max=6.84ms   p(90)=247.13µs p(95)=258.47µs
     http_req_failed................: 0.00%   ✓ 0           ✗ 317413
     http_req_receiving.............: avg=26.29µs  min=13.51µs  med=25.99µs  max=5.37ms   p(90)=29.23µs  p(95)=31.28µs 
     http_req_sending...............: avg=6.65µs   min=5.11µs   med=5.76µs   max=2.43ms   p(90)=7.12µs   p(95)=8.14µs  
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=195.74µs min=149.56µs med=185.35µs max=6.77ms   p(90)=213.44µs p(95)=222.43µs
     http_reqs......................: 317413  3526.796327/s
     iteration_duration.............: avg=278.42µs min=216.35µs med=266.39µs max=7.41ms   p(90)=302.93µs p(95)=317.96µs
     iterations.....................: 317413  3526.796327/s
     vus............................: 1       min=1         max=1   
     vus_max........................: 1       min=1         max=1   

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@benchmarks/server results (ponyfill)

     ✓ response code was 200
     ✓ valid response structure

   ✓ checks.........................: 100.00% ✓ 825778      ✗ 0     
     data_received..................: 81 MB   904 kB/s
     data_sent......................: 62 MB   684 kB/s
     http_req_blocked...............: avg=1.29µs   min=641ns    med=1.09µs   max=3.01ms   p(90)=1.7µs    p(95)=1.93µs  
     http_req_connecting............: avg=0ns      min=0s       med=0s       max=186.39µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=158.5µs  min=100.9µs  med=155.32µs max=6.22ms   p(90)=182.27µs p(95)=189.45µs
       { expected_response:true }...: avg=158.5µs  min=100.9µs  med=155.32µs max=6.22ms   p(90)=182.27µs p(95)=189.45µs
     http_req_failed................: 0.00%   ✓ 0           ✗ 412889
     http_req_receiving.............: avg=24.8µs   min=10.13µs  med=23.46µs  max=5.75ms   p(90)=31.85µs  p(95)=33.79µs 
     http_req_sending...............: avg=7.36µs   min=3.76µs   med=6.53µs   max=5.53ms   p(90)=10.36µs  p(95)=11.46µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=126.34µs min=73.71µs  med=122.87µs max=5.98ms   p(90)=145.13µs p(95)=151.46µs
     http_reqs......................: 412889  4587.643033/s
     iteration_duration.............: avg=212.34µs min=138.29µs med=209.63µs max=6.33ms   p(90)=240.93µs p(95)=249.62µs
     iterations.....................: 412889  4587.643033/s
     vus............................: 1       min=1         max=1   
     vus_max........................: 1       min=1         max=1   

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@benchmarks/server results (uws)

     ✓ response code was 200
     ✓ valid response structure

   ✓ checks.........................: 100.00% ✓ 1168176     ✗ 0     
     data_received..................: 98 MB   1.1 MB/s
     data_sent......................: 87 MB   967 kB/s
     http_req_blocked...............: avg=828ns    min=450ns    med=711ns    max=4.59ms   p(90)=951ns    p(95)=1.12µs  
     http_req_connecting............: avg=0ns      min=0s       med=0s       max=139.24µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=112.62µs min=74.77µs  med=103.64µs max=8.72ms   p(90)=129.21µs p(95)=136.71µs
       { expected_response:true }...: avg=112.62µs min=74.77µs  med=103.64µs max=8.72ms   p(90)=129.21µs p(95)=136.71µs
     http_req_failed................: 0.00%   ✓ 0           ✗ 584088
     http_req_receiving.............: avg=17.04µs  min=6.96µs   med=15.65µs  max=4.58ms   p(90)=22.65µs  p(95)=25.23µs 
     http_req_sending...............: avg=4.52µs   min=2.87µs   med=4.03µs   max=312.27µs p(90)=5.59µs   p(95)=7.07µs  
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=91.05µs  min=55.7µs   med=82.18µs  max=8.68ms   p(90)=104.65µs p(95)=110.78µs
     http_reqs......................: 584088  6489.849966/s
     iteration_duration.............: avg=150.17µs min=106.61µs med=140.69µs max=8.79ms   p(90)=170.82µs p(95)=181.05µs
     iterations.....................: 584088  6489.849966/s
     vus............................: 1       min=1         max=1   
     vus_max........................: 1       min=1         max=1   

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 147b18d and f167025.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • babel.config.js
  • package.json

Comment thread babel.config.js
Comment on lines +7 to +8
'@babel/plugin-transform-class-properties',
'@babel/plugin-transform-explicit-resource-management',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 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.json

Repository: 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.js

Repository: 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:


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 win

Node 18 test path can’t run with Babel 8 test:18/test:18:leaks still route Jest through babel-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

📥 Commits

Reviewing files that changed from the base of the PR and between f167025 and e523a0a.

📒 Files selected for processing (2)
  • .github/workflows/tests.yml
  • package.json

Comment thread .github/workflows/tests.yml Outdated
@coderabbitai coderabbitai Bot added the dependencies Pull requests that update a dependency file label Jul 2, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
packages/node-fetch/tests/cleanup-resources.spec.ts (1)

25-28: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Simplified assertions reduce test signal.

Both cases now just await fetch(...) with no assertion on the response at all, so the test would only fail if fetch() throws. Given the PR's stated goal of fixing httpbin flakiness (rate limiting returning 503), dropping the conditional status !== 503 check makes sense, but dropping the expect(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-syntax is never disabled after use.

The removed _runGarbageCollector toggled --expose-gc off again if it wasn't already exposed, minimizing the window of an elevated capability. The new code calls setFlagsFromString('--allow-natives-syntax') on every isLeaking() 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

📥 Commits

Reviewing files that changed from the base of the PR and between 825531f and e0c610d.

📒 Files selected for processing (2)
  • packages/node-fetch/tests/cleanup-resources.spec.ts
  • patches/jest-leak-detector+30.4.1.patch

Comment thread patches/jest-leak-detector+30.4.1.patch
@ardatan ardatan closed this Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants