Skip to content

Migrate to Babel 8 (@babel/core / preset-react / preset-typescript 8.x) #1823

Description

@steilerDev

Context

Dependabot repeatedly proposes bumping @babel/core, @babel/preset-react, @babel/preset-typescript from 7.x to 8.x (most recently in #1796). A naive 3-package bump breaks the client webpack build: @babel/preset-typescript@8 stops stripping TS types, so raw TypeScript reaches webpack's parser (37 × "Module parse failed: Unexpected token"). #1822 holds these three at 7.29.7 while taking the rest of the dev-dependency group.

Why it needs a dedicated migration

A coherent Babel 8 install requires migrating the entire Babel graph in one coordinated change, not just the 3 top-level packages:

  • Transitive @babel/preset-env polyfill providers (babel-plugin-polyfill-corejs2/3, @babel/helper-define-polyfill-provider, @babel/preset-modules) currently declare peer @babel/core ^7.4.0 || ^8.0.0-0 <8.0.0 — i.e. they exclude stable Babel 8.
  • Jest 30's Babel internals (babel-jest, babel-preset-current-node-syntax) must publish core-8-compatible peers first.
  • Babel 8 raises the Node engine floor to ^22.18.0 || >=24.11.0 — pin .nvmrc/Dockerfile accordingly (currently bare 24).
  • Preset config review: @babel/preset-typescript may need allowDeclareFields: true; @babel/preset-react runtime must be explicit (already set to automatic in client/webpack.config.cjs).

Acceptance

  • Whole Babel graph on 8.x with no duplicate @babel/core@7 hoisted
  • npm run build (client) and npm test (Jest) green
  • Lockfile regenerated via full npm install
  • Node engine floor pinned

References

🤖 Filed by `/dependabot`

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency file

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions