Skip to content

chore(deps): upgrade Babel toolchain to 8.x (coordinated migration)#1044

Merged
ashleyshaw merged 3 commits into
developfrom
chore/babel-8-migration
Jul 15, 2026
Merged

chore(deps): upgrade Babel toolchain to 8.x (coordinated migration)#1044
ashleyshaw merged 3 commits into
developfrom
chore/babel-8-migration

Conversation

@ashleyshaw

@ashleyshaw ashleyshaw commented Jul 15, 2026

Copy link
Copy Markdown
Member

Chore Pull Request

Linked issues

Relates to #1002, #1004, #1007, #1026 (superseded — closed in favour of this coordinated migration).

Summary

Completes the Babel 8 migration that individual Dependabot PRs couldn't land on their own, since @babel/preset-env, @babel/preset-react, @babel/preset-typescript, and @babel/plugin-transform-runtime 8.x all peer-require @babel/core@^8.0.0 — bumping any one of them alone against a 7.x core breaks npm ci. This is why #1002, #1004, #1007, and #1026 each showed as CONFLICTING/DIRTY.

Changes

  • Bumps @babel/core, @babel/preset-env, @babel/preset-react, @babel/preset-typescript, @babel/plugin-transform-runtime, and @babel/runtime to 8.x together.
  • Removes @babel/plugin-proposal-class-properties, @babel/plugin-proposal-object-rest-spread, and @babel/plugin-syntax-import-meta — none have an 8.x release (their proposals were folded into standard JS / preset-env long ago), and their @babel/core peer range (^7.0.0-0) is incompatible with core 8. Verified with a direct transformSync smoke test that class fields, object rest/spread, and import.meta still transform correctly without them.
  • Bumps babel-jest 29.7.0 → 30.4.1 (29.7.0 peer-requires @babel/core@^7.8.0, so it can't run against babel 8).
  • Sets Jest's coverageProvider to v8. Babel 8 exposed a circular-require bug in Jest's Istanbul-based coverage instrumentation (@jest/transform's nested @babel/core@7.29.7 copy resolves to an empty exports object when lazily instrumenting a dynamically-require()'d file under --coverage) — reproduced only for scripts/agents/includes/sync-version.js, the one file explicitly exempted from transformIgnorePatterns. Switching to V8's native coverage sidesteps Babel/Istanbul instrumentation entirely.

Impact / Compatibility

  • Runtime/behaviour changes: None expected — build output of babel.config.cjs verified equivalent for class fields, object rest/spread, and import.meta syntax after removing the deprecated plugins.
  • Build/dev-experience impact: Coverage reports now come from V8 instead of Babel/Istanbul; line/branch numbers may shift slightly but totals are consistent with the prior run.

Verification

  • CI passes
  • Local build and smoke tests
  • Docs updated if developer-facing

Risk & Rollback

Changelog

Changed

  • Babel toolchain upgraded to 8.x (@babel/core, @babel/preset-env, @babel/preset-react, @babel/preset-typescript, @babel/plugin-transform-runtime, @babel/runtime), removed three plugins with no 8.x release, bumped babel-jest to 30.4.1, and switched Jest's coverageProvider to v8.

Checklist (Global DoD / PR)

  • All AC met and demonstrated
  • Tests added/updated (unit/E2E as appropriate)
  • Accessibility checklist completed (where relevant): N/A — no UI/markup changes in this PR
    • Semantic HTML and heading order verified (N/A)
    • Keyboard navigation and visible focus states verified (N/A)
    • ARIA used only where needed (N/A)
    • Contrast and non-colour cues reviewed (N/A)
  • Docs/readme/changelog updated (if user-facing)
  • Security checklist completed (where relevant): reviewed, no user-facing input/output paths touched
    • Untrusted input validated and sanitised (N/A)
    • Output escaped for its rendering context (N/A)
    • Privileged actions enforce nonce and capability checks (N/A)
    • No secrets/sensitive data introduced; OWASP risks reviewed
  • Code/design reviews approved
  • CI green; linked issues closed; release notes prepared (if shipping)

🤖 Generated with Claude Code

Bumps @babel/core, @babel/preset-env, @babel/preset-react,
@babel/preset-typescript, @babel/plugin-transform-runtime, and
@babel/runtime to their 8.x releases together, since preset-env,
preset-react, preset-typescript, and plugin-transform-runtime 8.x all
peer-require @babel/core ^8.0.0 — they cannot land independently
(this is why the individual Dependabot PRs for these packages showed
as CONFLICTING/DIRTY; see #1002, #1004, #1007, #1026).

Also:
- Removes @babel/plugin-proposal-class-properties,
  @babel/plugin-proposal-object-rest-spread, and
  @babel/plugin-syntax-import-meta from babel.config.cjs and
  package.json. None of these have an 8.x release (their proposals
  were long ago folded into standard JS/babel-preset-env), and their
  peer dependency on @babel/core is pinned to `^7.0.0-0`, making them
  incompatible with core 8. Verified via a direct transformSync smoke
  test that preset-env alone still handles class fields, object
  rest/spread, and import.meta without them.
- Bumps babel-jest from 29.7.0 (peer-requires @babel/core ^7.8.0, so
  it doesn't support babel 8 devDependency) to 30.4.1.
- Sets Jest's coverageProvider to "v8" instead of the default
  "babel". Babel 8 exposed a circular-require bug in Jest's Istanbul
  coverage instrumentation path (@jest/transform's nested
  @babel/core@7.29.7 copy resolves to an empty exports object when
  lazily instrumenting a dynamically-required file), which only
  reproduced under `--coverage` and only for
  scripts/agents/includes/sync-version.js (the one file explicitly
  exempted from transformIgnorePatterns because it's require()'d at
  runtime rather than statically imported). Switching to V8's native
  coverage sidesteps the Babel/Istanbul instrumentation path
  entirely; full suite (72 suites / 668 tests) passes both with and
  without coverage.

Verified: npm ci, npm run test:js (668/668 passing), npm run
lint:pkg-json, and a targeted eslint pass all green.
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

✅ Template check passed after update. Thanks for fixing the PR description.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@ashleyshaw, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 13 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 09d49427-78ba-4028-b81f-452de36e9579

📥 Commits

Reviewing files that changed from the base of the PR and between aee06f0 and 45c0a3a.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • .jest.config.cjs
  • CHANGELOG.md
  • babel.config.cjs
  • package.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/babel-8-migration

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 added status:needs-review Awaiting code review type:chore Chore / small hygiene change priority:normal Default priority area:dependencies Composer/npm dependency work lang:js JavaScript/TypeScript lang:json JSON config/content meta:needs-changelog Requires a changelog entry before merge labels Jul 15, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates Babel dependencies to version 8, simplifies the Babel configuration by removing several plugins, and configures Jest to use the V8 coverage provider. Feedback recommends reverting the coverage provider to 'babel' to prevent inaccurate coverage reports for transpiled files, and instead excluding problematic files. Additionally, @babel/runtime should be pinned to version 8.0.1 for consistency and moved to dependencies if the project is distributed as a library.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread .jest.config.cjs
},
moduleFileExtensions: ['js', 'ts', 'jsx', 'tsx', 'json'],
coverageDirectory: process.env.JEST_COVERAGE_DIR || './coverage',
coverageProvider: 'v8',

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.

medium

Using coverageProvider: 'v8' can result in inaccurate coverage reports for transpiled files (such as TypeScript, JSX, and TSX files) because V8 coverage relies on precise source maps, which Jest often struggles to map back correctly compared to Babel/Istanbul. Since the circular-require issue was only reproduced for scripts/agents/includes/sync-version.js, a more robust approach is to keep the default 'babel' provider and exclude the problematic file using coveragePathIgnorePatterns.

    coverageProvider: 'babel',

Comment thread package.json
"@babel/preset-env": "8.0.2",
"@babel/preset-react": "8.0.1",
"@babel/preset-typescript": "8.0.1",
"@babel/runtime": "^8.0.0",

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.

medium

There are two issues with @babel/runtime here: 1. Dependency Type: If this project is published as a library, @babel/runtime must be in dependencies rather than devDependencies. The @babel/plugin-transform-runtime helper injects imports to @babel/runtime into the transpiled output, which consumers will need at runtime. 2. Version Consistency: To prevent potential compatibility issues and keep the lockfile predictable, @babel/runtime should be pinned to the exact same version as @babel/plugin-transform-runtime (8.0.1) instead of using a caret range (^8.0.0).

Suggested change
"@babel/runtime": "^8.0.0",
"@babel/runtime": "8.0.1",

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41ef1c1f91

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
Comment on lines +132 to +136
"@babel/core": "8.0.1",
"@babel/plugin-transform-runtime": "8.0.1",
"@babel/preset-env": "8.0.2",
"@babel/preset-react": "8.0.1",
"@babel/preset-typescript": "8.0.1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Do not require Babel 8 while CI uses Node 20

This upgrade pulls in Babel 8 packages whose lockfile engines require ^22.18.0 || >=24.11.0, but the repo still has .npmrc engine-strict=true; npm's engine-strict docs say npm refuses to install packages incompatible with the current Node version. I checked workflows including .github/workflows/project-meta-sync.yml, .github/workflows/metrics.yml, .github/workflows/issues.yml, and .github/workflows/readme-audit.yml: they set Node 20 or 18 and run npm ci/npm ci --ignore-scripts, and reproducing under Node 20.20.2 with npm ci --ignore-scripts --dry-run --offline fails with EBADENGINE before tests run. Either keep Babel on a Node-20-compatible line or raise every install environment and the package engine together.

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #1044

CI Status:success
Files changed: 5
Risk Distribution: 0 critical, 1 high, 0 medium, 4 low

Recommendations

  • ⚠️ Large deletion detected (>500 lines removed)

@github-actions

Copy link
Copy Markdown
Contributor

@ashleyshaw
ashleyshaw merged commit fb53cd8 into develop Jul 15, 2026
27 checks passed
@ashleyshaw
ashleyshaw deleted the chore/babel-8-migration branch July 15, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dependencies Composer/npm dependency work area:documentation Docs & guides lang:js JavaScript/TypeScript lang:json JSON config/content lang:md Markdown content/docs meta:needs-changelog Requires a changelog entry before merge priority:normal Default priority status:needs-review Awaiting code review type:chore Chore / small hygiene change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant