Repository navigation
Upgrade Babel packages to 8.x - #4587
Merged
Merged
Conversation
Babel 8 peers on itself, so core, preset-env, preset-react and preset-typescript must move together. This replaces the failing Dependabot PRs for @babel/core and @babel/preset-typescript. Babel 8 needs Node 22.18 or later, so .nvmrc moves from 22.16.0. The Jest setup changes to match Babel 8 behaviour: - preset-env now keeps ESM unless told otherwise, so Jest sets modules to commonjs. - preset-react no longer runs on .ts files, because JSX parsing breaks generic arrow functions. - preset-typescript keeps unused imports, so type-only imports of highlight.js use import type. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The frontend builds with Vite, but docs, comments and ignore files still named Parcel. Update them so the text matches the toolchain. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
theletterf
approved these changes
Oct 26, 2026
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4587/ Sample changed pages: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves all four Babel packages to 8.x in one change and adapts the Jest setup, so the frontend tests pass again on Babel 8.
Affects: Internals only
Prompt summary: The automatic Dependabot PRs that bump Babel to 8.x fail CI. This PR updates everything that can move to Babel 8 together and fixes what breaks.
Why
Babel 8 peers on itself, so Dependabot's single-package PRs (#4577, #4578) cannot pass:
preset-typescript@8needs@babel/core@8. Babel 8 also needs Node 22.18 or later, while.nvmrcpins 22.16.0. Several Babel defaults change and break the Jest transforms.What
Babel and Node versions
@babel/core,preset-env,preset-reactandpreset-typescriptmove to 8.x together..nvmrcand the Node version inCONTRIBUTING.mdmove to 22.18.0, the oldest release Babel 8 supports.Jest transforms
preset-envno longer converts ESM to CommonJS by default, sojest.config.jsandsvgTransform.jssetmodules: 'commonjs'. Without it,jest.resetModules()stops isolating dynamicimport()and SVG imports fail.preset-reactnow applies only to.tsxand.jsfiles, because JSX parsing on.tsfiles breaks generic arrows such as<T>(key: string) => ....Type-only imports
preset-typescriptkeeps imports that only carry types.hljs.tsandhljs-languages.tsimportLanguageFnwithimport type. A runtimerequire('highlight.js')loaded every language and defeated the lazy loading the tests check.Stale Parcel references
The frontend builds with Vite, but
AGENTS.md,CONTRIBUTING.md, source comments and ignore files still named Parcel. They now name Vite. Dead.parcel-cacheentries are removed.Verify
This PR supersedes #4577 and #4578, which Dependabot can close once this merges.