Skip to content

chore(deps): remove the dead root Babel stack (#9376) - #9543

Open
mikeallisonJS wants to merge 1 commit into
mainfrom
ma-9376-babel-dead-stack
Open

chore(deps): remove the dead root Babel stack (#9376)#9543
mikeallisonJS wants to merge 1 commit into
mainfrom
ma-9376-babel-dead-stack

Conversation

@mikeallisonJS

@mikeallisonJS mikeallisonJS commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

What

Implements the "Babel (lockstep)" bullet of the #9376 major-upgrade roadmap. Issue #9376's dead-dep cleanup shipped in #9377; its roadmap left each upgrade family as an independently scoped effort, and Babel is the next one with no PR.

The roadmap scheduled @babel/core|preset-env|preset-typescript|runtime for a 7 → 8 bump. Tracing every consumer first showed the root Babel stack is no longer wired to anything — the bump would have moved four declarations that nothing resolves. So this removes the stack instead, which is what actually pays off the roadmap item and restores the property #9376 part 1 was after: every entry in package.json corresponds to a real consumer.

Worth noting: #9446 recorded Babel 7 → 8 as blocked because "@nx/js@22 bundles Babel-7 presets that Babel 8 core rejects". That block is real but moot — the presets it refers to are reached through .babelrc files nothing reads any more.

Why the stack is dead

Path that used to run Babel Status now
babel-jest via @nx/react/babel Jest is fully gone — no jest.config.*, no @nx/jest executor, no jest.preset.js
Storybook (webpack) Now @storybook/nextjs-vite; its whole dependency chain contains zero @babel/* packages
Vitest Runs through @vitejs/plugin-react, which hardcodes babelrc: false, configFile: false
api-* builds @nx/webpack with compiler: "tsc"babel-loader never runs
Next apps Compile with SWC; no app carries a .babelrc

Verified empirically too: putting a nonexistent plugin into libs/journeys/ui/.babelrc left its suite green (37 passed), which only holds if nothing reads the file.

Removed

  • @babel/core, @babel/preset-env, @babel/preset-typescript, @babel/runtime — the four the roadmap named
  • @emotion/babel-plugin, babel-loader — same stack, same dead state, zero repo references
  • babel.config.json and five .babelrc files (libs/journeys/ui, libs/shared/{gql,ai,ui,ui-dynamic}) — four of them byte-identical
  • Two stale nx.json references that went with the stack: sharedGlobals listed only the deleted babel.config.json, and the @nx/react application generator still set babel: true — an option Nx 23 no longer has in its schema (bundler now defaults to vite), so it would have re-seeded a .babelrc into any newly generated React app

Kept on purpose

  • babel-plugin-react-compiler is live — six apps set reactCompiler: true, and Next loads the plugin through its own bundled Babel.
  • apps/docs/babel.config.js stays. Docusaurus vendors a complete Babel 7 stack via @docusaurus/babel, passes configFile explicitly, and never consults our root declarations.

@babel/runtime and @emotion/babel-plugin remain in the tree as direct dependencies of @emotion/react and @emotion/styled. As with ua-parser-js in #9377, this drops a redundant top-level claim, not the package.

No application source changes — only the manifest, the lockfile, nx.json, and the dead Babel configs themselves.

Verification

  • nx affected --target=build — the load-bearing gate, since build is the only target that could consume babel-loader/.babelrc. apps/docs builds successfully ([SUCCESS] Generated static files) — it is the one genuine remaining Babel consumer. All five api-* webpack builds compile successfully.
  • nx affected --target=type-check — green, 35/35 projects.
  • pnpm lint:changed --fix — clean, nothing generated.

What is not green, stated plainly

  • Four Next app builds fail (journeys, journeys-admin, arclight, resources) — all ECONNREFUSED 127.0.0.1:4000, hitting a GraphQL gateway that isn't running locally, during static prerender and after each logged "Compiled successfully". Environmental, not Babel.
  • The affected test suite does not go green — but it doesn't on origin/main either. Baseline on clean main: 27 failing tests including 12 timeouts. On an identical command this branch had 18, and its failing spec files are a strict subset of main's, with resources passing entirely. That is a subset argument, not a green pipeline; Prune dead dependencies (abandoned / deprecated / unimported) + major-upgrade roadmap #9376's story 16 asks for the latter, and this PR does not claim to have met it. CI is the real check.
  • The Storybook build fails identically on this branch and on clean main with a next-i18next.config.js CJS-interop error — pre-existing, unrelated, untouched here.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Simplified the project’s build configuration by removing obsolete transpilation settings.
    • Removed unused build tooling and configuration dependencies.
    • Updated project generation and caching settings to reflect the streamlined build setup.
  • Maintenance
    • No end-user functionality or public interfaces were changed.

Implements the "Babel (lockstep)" bullet of the #9376 upgrade roadmap.
The roadmap scheduled `@babel/core|preset-env|preset-typescript|runtime`
for a 7 -> 8 bump, but tracing every consumer shows the root Babel stack
is no longer wired to anything: the bump would have moved four
declarations that nothing resolves. Removing them is the change that
actually pays off the roadmap item, and it restores the property #9376
part 1 was after -- every entry in package.json corresponds to a real
consumer.

Why the stack is dead:

- Jest is fully gone (no jest.config.*, no @nx/jest executor, no
  jest.preset.js). The five .babelrc files existed to feed babel-jest
  through @nx/react/babel.
- Storybook is now @storybook/nextjs-vite; its whole dependency chain
  contains zero @babel/* packages.
- Vitest runs through @vitejs/plugin-react, which hardcodes
  `babelrc: false, configFile: false`, so .babelrc is never read.
- The api-* builds use @nx/webpack with `compiler: "tsc"`, so
  babel-loader never runs.
- Next apps compile with SWC and no app carries a .babelrc.

Verified empirically as well: putting a nonexistent plugin into
libs/journeys/ui/.babelrc left its suite green, which only holds if
nothing reads the file.

Two stale references in nx.json go with the stack: `sharedGlobals`
listed only the deleted babel.config.json, and the @nx/react application
generator still set `babel: true` -- an option Nx 23 no longer has in its
schema (bundler now defaults to vite), so it would have re-seeded a
.babelrc into any newly generated React app.

Kept on purpose:

- `babel-plugin-react-compiler` is live -- six apps set
  `reactCompiler: true`, and Next loads the plugin through its own
  bundled Babel.
- apps/docs/babel.config.js stays; Docusaurus vendors a complete Babel 7
  stack via @docusaurus/babel, passes `configFile` explicitly, and never
  consults our root declarations.

`@babel/runtime` and `@emotion/babel-plugin` remain in the tree as direct
dependencies of @emotion/react and @emotion/styled. As with ua-parser-js
in #9377, this drops a redundant top-level claim, not the package.

No application source changes -- only the manifest, the lockfile, nx.json
and the dead Babel configs themselves.

Verification: `nx affected --target=type-check` green 35/35; lint clean;
`nx affected --target=build` builds apps/docs (the one real remaining
Babel consumer) and all five api-* webpack builds successfully -- the
four Next app failures are ECONNREFUSED to a local GraphQL gateway on
:4000 during static prerender, after each compiled successfully. The
affected test suite's failures are a strict subset of the same failures
on origin/main.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3fe4e629-c8b8-4c06-9b3e-15677b1a2ac5

📥 Commits

Reviewing files that changed from the base of the PR and between d63e72f and 8071d1e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • babel.config.json
  • libs/journeys/ui/.babelrc
  • libs/shared/ai/.babelrc
  • libs/shared/gql/.babelrc
  • libs/shared/ui-dynamic/.babelrc
  • libs/shared/ui/.babelrc
  • nx.json
  • package.json
💤 Files with no reviewable changes (7)
  • libs/shared/ui-dynamic/.babelrc
  • libs/shared/ui/.babelrc
  • libs/journeys/ui/.babelrc
  • libs/shared/gql/.babelrc
  • babel.config.json
  • libs/shared/ai/.babelrc
  • package.json

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The pull request removes root and package-level Babel configurations and related development dependencies. Nx no longer enables Babel for generated React applications or includes the root Babel configuration in shared cache inputs.

Changes

Babel configuration removal

Layer / File(s) Summary
Remove Babel configuration and update Nx
babel.config.json, libs/journeys/ui/.babelrc, libs/shared/*/.babelrc, nx.json, package.json
The root and package Babel configuration files are deleted. Nx no longer sets "babel": true for the React application generator or hashes the root Babel configuration. Obsolete Babel development dependencies are removed.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 8071d

This PR removes unused Babel dependencies and configuration without changing application source behavior; no actionable merge-blocking risk remains after normal checks and review.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ma-9376-babel-dead-stack

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.

@nx-cloud

nx-cloud Bot commented Aug 24, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 8071d1e

Command Status Duration Result
nx run-many --target=prisma-generate --all --pa... ✅ Succeeded 3s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-24 22:08:52 UTC

@nx-cloud

nx-cloud Bot commented Aug 24, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 8071d1e

Command Status Duration Result
nx run journeys-e2e:e2e ✅ Succeeded 23s View ↗
nx run journeys-admin-e2e:e2e ✅ Succeeded 32s View ↗
nx run docs-e2e:e2e ✅ Succeeded 4s View ↗
nx run resources-e2e:e2e ✅ Succeeded 11s View ↗
nx run videos-admin-e2e:e2e ✅ Succeeded 4s View ↗
nx run player-e2e:e2e ✅ Succeeded 5s View ↗
nx run short-links-e2e:e2e ✅ Succeeded 3s View ↗
nx run-many --target=vercel-alias --projects=jo... ✅ Succeeded 1s View ↗
Additional runs (20) ✅ Succeeded ... View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-24 22:15:09 UTC

@github-actions

Copy link
Copy Markdown
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
short-links ✅ Ready short-links preview Tue Aug 25 10:11:08 NZST 2026

@github-actions

Copy link
Copy Markdown
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
player ✅ Ready player preview Tue Aug 25 10:11:14 NZST 2026

@github-actions

Copy link
Copy Markdown
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
docs ✅ Ready docs preview Tue Aug 25 10:11:20 NZST 2026

@github-actions

Copy link
Copy Markdown
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Tue Aug 25 10:11:40 NZST 2026

@github-actions

Copy link
Copy Markdown
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys ✅ Ready journeys preview Tue Aug 25 10:11:45 NZST 2026

@github-actions

Copy link
Copy Markdown
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
resources ✅ Ready resources preview Tue Aug 25 10:12:16 NZST 2026

@github-actions

Copy link
Copy Markdown
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Tue Aug 25 10:12:53 NZST 2026

@stage-branch-merger

Copy link
Copy Markdown
Contributor

I see you added the "on stage" label, I'll get this merged to the stage branch!

@stage-branch-merger

Copy link
Copy Markdown
Contributor

Merge conflict attempting to merge this into stage. Please fix manually.

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.

1 participant