Skip to content

feat(deps)!: upgrade babel to v8 - #7238

Merged
hevele-moda merged 1 commit into
mainfrom
feat/babel-8-upgrade
Sep 17, 2026
Merged

hevele-moda merged 1 commit into
mainfrom
feat/babel-8-upgrade

Conversation

@hevele-moda

Copy link
Copy Markdown
Contributor

Summary

The individual dependabot PR bumping just @babel/core to 8.x (#7235) can't pass CI: npm ci hard-fails on ERESOLVE because @rollup/plugin-babel and ts-jest both still declare peer ranges capped at Babel 7, and @babel/preset-env stays on 7.x in that PR.

This PR bumps @babel/core, @babel/preset-env, @babel/preset-react, and @babel/preset-typescript to 8.x together and adds two overrides entries to work around stale peer ranges upstream:

  • @rollup/plugin-babel@7.0.0 → peer @babel/core@^7.0.0. A maintainer-adjacent community test in rollup/plugins#2010 confirms it runs fine against Babel 8 unchanged — a real fix is in flight (rollup/plugins#2021) but unmerged, so this unblocks us without waiting on it.
  • ts-jest@29.4.12 → optional peer capping @babel/core at <8, unused here since ts-jest's babel-based transform isn't configured in this repo.

Also fixed babel.config.js: Babel 8's preset-typescript removed isTSX/allExtensions in favor of automatic per-file-extension JSX detection. Since preset-react was applied to every file unconditionally, this broke parsing of ambiguous TS generic-arrow syntax in plain .ts files (e.g. src/utilities/sample.ts's <T>(xs: T[]) => was misread as JSX). Scoped preset-react to .jsx/.tsx via overrides.

This is a breaking change — bumps the package major version.

Test plan

  • npm ci --include=dev installs clean
  • npm run build (rollup compile + tsc types)
  • npm run lint
  • npm run test — 40 suites / 88 tests pass
  • CI (ci/circleci: test) — pending

🤖 Generated with Claude Code

Bumps @babel/core, @babel/preset-env, @babel/preset-react, and
@babel/preset-typescript from 7.28.x to 8.x.

Two peer-dependency overrides are needed since neither has shipped a
Babel-8-compatible peer range yet:
- @rollup/plugin-babel@7.0.0 declares peer @babel/core@^7.0.0, but a
  maintainer-confirmed community test (rollup/plugins#2010) shows it
  works fine against Babel 8's transform API unchanged. Upstream fix
  is in flight (rollup/plugins#2021), unmerged.
- ts-jest@29.4.12 declares an *optional* peer capping @babel/core at
  <8, unused unless ts-jest's babel-based transform is configured
  (it isn't here).

babel.config.js also needed a fix: Babel 8's preset-typescript
removed the isTSX/allExtensions options in favor of automatic
per-file-extension JSX detection, which conflicts with preset-react
being applied to every file unconditionally. This broke parsing of
plain .ts files using the ambiguous generic-arrow syntax (e.g.
src/utilities/sample.ts's `<T>(xs: T[]) =>`), which got misread as
JSX. Scoped preset-react to .jsx/.tsx via `overrides`.

BREAKING CHANGE: requires @babel/core@^8 throughout the toolchain.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@hevele-moda
hevele-moda requested a review from a team as a code owner September 17, 2026 13:36
Copilot AI balanced review requested due to automatic review settings September 17, 2026 13:37
@hevele-moda
hevele-moda merged commit 25c808e into main Sep 17, 2026
4 checks passed
@hevele-moda
hevele-moda deleted the feat/babel-8-upgrade branch September 17, 2026 13:39
moda-automation-devops pushed a commit that referenced this pull request Sep 17, 2026
# [22.0.0](21.14.0...22.0.0) (2026-09-17)

* feat(deps)!: upgrade babel to v8 ([#7238](#7238)) ([25c808e](25c808e)), closes [rollup/plugins#2010](rollup/plugins#2010) [rollup/plugins#2021](rollup/plugins#2021)

### BREAKING CHANGES

* requires @babel/core@^8 throughout the toolchain.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
@moda-automation-ci

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 22.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

🔵 Needs a closer look

The major compiler upgrade relies on forced compatibility with integrations that do not officially support Babel 8 yet.

Pull request overview

Upgrades the build pipeline to Babel 8 while retaining compatibility with existing Rollup and Jest tooling.

Changes:

  • Upgrades Babel core and presets to v8.
  • Overrides stale peer constraints.
  • Restricts React transforms to JSX/TSX files.
File summaries
File Description
package.json Upgrades Babel dependencies and adds peer overrides.
babel.config.js Applies the React preset only to JSX/TSX files.
Review details
  • Files reviewed: 2/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants