Upgrading @babel/runtime 7 to 8
Breaking7.29.10 → 8.0.10Breaking144Security1Platform4Deprecated2New11Changed30Fixed129Other93
SecurityModerate · CVSS 6.2Fixes GHSA-968p-4wvh-cqc8, a vulnerability in the .replace method of transpiled regular expressions using named capturing groups.GHSA-968p-4wvh-cqc8 · CVE-2025-27789 ↗
BreakingUpgrade verdict
139 breaking changes and 4 platform requirement changes and a security fix.
In plain terms
- The corejs exports are no longer available from the corejs3 runtime package.
- The packed locations option for the parser is gone, so code relying on it must change.
- The plugin that rewrote Object.setPrototypeOf calls to assignments is gone, including from @babel/standalone.
- Plugins that did nothing are no longer included in the standalone build.
Must act Top 5 of 146 that need code or config changes
@babel/runtime publishes official migration guides for versions 8, 8, 8. They cover more than the release notes do.
Migration guide for users ↗Migration guide for plugin developers ↗Migration guide ↗No longer states a Node.js requirement from 8.0.0-rc.3 (was >=6.9.0).
What you must change
Breaking139
Removes corejs exports for
@babel/runtime-corejs3.@babel/runtime-corejs3Removes the
locations: "packed" parser option.locations: "packed"Removes the transform-object-set-prototype-of-to-assign plugin.
babel-plugin-transform-object-set-prototype-of-to-assignbabel-standaloneRemoves noop plugins from @babel/standalone.
babel-standaloneRemoves Scope#buildUndefinedNode from babel-traverse.
Scope#buildUndefinedNodeRemoves NodePath#toComputedKey from babel-traverse and dependent plugins.
NodePath#toComputedKeyRemoves @babel/plugin-transform-property-mutators and its use in babel-standalone.
@babel/plugin-transform-property-mutatorsRemoves
Import from the Expression alias in Babel 8.ExpressionImportRemoves
decorators from TSDeclareMethod.TSDeclareMethoddecoratorsRemoves unused code for old ESLint versions.
Removes the deprecated default export from @babel/code-frame.
@babel/code-frameDrops support for ESLint v7 and v8 in babel-eslint-parser.
babel-eslint-parserRemoves the browser entrypoint for @babel/register.
@babel/registerRemoves NodePath#visit from babel-traverse.
NodePath#visitRemoves smart pipeline support and the accessor property from the Standardized alias.
babel-plugin-proposal-pipeline-operatorStandardizedRemoves @babel/plugin-transform-object-assign.
@babel/plugin-transform-object-assignDrops support for TypeScript
module <identifier> syntax in the generator, parser, TypeScript transform plugin, and types.Removes the
isPluginRequired export from babel-preset-env and babel-preset-typescript.isPluginRequiredRemoves the
blacklist option from babel-traverse.blacklistRemoves the
plugin-transform-react-compat, plugin-transform-react-source, and plugin-transform-react-self plugins.plugin-transform-react-compatplugin-transform-react-sourceplugin-transform-react-selfRemoves
regenerator-runtime from @babel/node.regenerator-runtimeRemoves decorator parser plugin options across generator, parser, decorators plugins, class properties, standalone, and traverse.
Removes corejs2 and legacy files from
babel-compat-data, affecting babel-helper-compilation-targets and babel-preset-env.Removes the
./regenerator entrypoint from @babel/runtime.@babel/runtime/regeneratorRenames
TSImportType.argument to .source in generator, parser, and types.TSImportType.argumentTSImportType.sourceFully removes import assertions support across generator, parser, import plugins, JSON modules transform, and types.
Fully removes Records and Tuples support across generator, pipeline and record/tuple plugins, standalone, traverse, and types.
Stops enabling default plugins in @babel/standalone.
@babel/standaloneDrops CJS support from
@babel/parser.@babel/parserRemoves record and tuple syntax support.
Removes the
bugfixes option from babel-preset-env.bugfixesRenames typeParameters to typeArguments for TSClassImplements and TSInterfaceHeritage.
TSClassImplementsTSInterfaceHeritagetypeParameterstypeArgumentsTSImportTypeTSTypeQueryRenames TSTypeReference.typeParameters to typeArguments in babel-generator, babel-parser and babel-types.
TSTypeReference.typeParametersTSTypeReference.typeArgumentsRemoves TSModuleDeclaration.global in Babel 8.
TSModuleDeclaration.globalRenames superTypeParameters to superTypeArguments across generator, parser, Flow comments, TypeScript transform and types.
superTypeParameterssuperTypeArgumentsAdds TSClassImplements and TSInterfaceHeritage AST nodes and renames TsExpressionWithTypeArguments in Babel 8.
TSClassImplementsTSInterfaceHeritageTsExpressionWithTypeArgumentsRemoves the minimal and smart options of the Pipeline Operator plugins.
minimalsmartDrops Flow support for annotations inside array patterns.
Removes some Scope methods in Babel 8.
ScopeRemoves the importAssertions parser plugin.
importAssertionsRemoves the importReflection parser plugin.
importReflectionRemoves the DecimalLiteral AST node in Babel 8.
DecimalLiteralRemoves decimal support from the parser in Babel 8.
decimalRemoves some NodePath methods.
NodePathRemoves the enums option of the flow plugin in Babel 8.
enumsRemoves methods starting with
_ in @babel/traverse.@babel/traverseRemoves
File.prototype.getModuleName in Babel 8.File.prototype.getModuleNameRemoves
extra.shorthand from the parser and traverse packages.extra.shorthandRemoves the
syntaxType option for record-and-tuple in the parser and plugins.syntaxTypeRemoves core-js and regenerator entrypoints from @babel/runtime-* packages.
@babel/runtime@babel/runtime-corejs3Removes ./helpers/esm exports from @babel/runtime and drops Node.js 13.0-13.1 support.
@babel/runtime./helpers/esmRemoves the
useESModules option from babel-plugin-transform-runtime.babel-plugin-transform-runtimeuseESModulesRemoves core-js@2 and regenerator support from
babel-plugin-transform-runtime.babel-plugin-transform-runtimecore-jsregeneratorRemoves the
loose and spec options from preset-env.babel-preset-envloosespecRemoves
CodeGenerator from @babel/generator.CodeGenerator@babel/generatorMakes
parserOpts.createImportExpressions default to true.parserOpts.createImportExpressionsRemoves
getModulesPluginNames from preset-env.getModulesPluginNamesbabel-preset-envRemoves core-js 2 and regenerator support from
preset-env.babel-preset-envcore-jsregeneratorRemoves the
-d and -gc aliases from babel-node.babel-node-d-gcRemoves the getChalk function from babel-highlight and babel-code-frame.
getChalkRemoves builders present only for backwards-compatibility.
Removes
selfClosing from the jsxElement builder.jsxElementselfClosingRemoves the
block argument from Scope#rename.Scope#renameRemoves
Super from the Expression alias.SuperExpressionRemoves support for the
2018-09 decorators proposal.2018-09Removes the Noop node type.
NoopEnables preset-env bugfixes by default.
preset-envRemoves module attributes parser and generator support.
Stops creating TSParenthesizedType nodes by default.
TSParenthesizedTypeRemoves module-specific options from @babel/core.
@babel/coreFalls back targets to "defaults, not ie 11".
Outputs minimal strings by default.
Uses the JSX automatic runtime by default.
Removes useSpread and useBuiltIns jsx options.
useSpreaduseBuiltInsRemoves uglify target support in preset-env.
uglifyEnables the allowDeclareFields option by default for TypeScript.
allowDeclareFieldsRemoves the jsonCompatibleStrings option from babel-generator.
jsonCompatibleStringsEnables the allowDeclareFields option by default for Flow.
allowDeclareFieldsFalls back to assuming ESM support when using
modules: auto.modules: autoUses 0-based columns in code frames to match Babel AST locations.
babel-code-framebabel-corebabel-parserbabel-traverseDisallows a super call after new in the parser, generator, spread transform and types.
Replaces remaining whitelist/blacklist options with inclusive alternatives in external-helpers, template and traverse.
Gates jsxDEV source/self output behind the new
developmentSourceSelf option.developmentSourceSelfjsxDEVPasses
file instead of path to importToPlatformApi builders.importToPlatformApiMakes eslint-parser/experimental-worker the default.
eslint-parser/experimental-workerThe partial-application plugin now requires the "version" option.
babel-plugin-proposal-partial-applicationbabel-plugin-syntax-partial-applicationUses package.json#imports for browser-specific code in core, transform-runtime and register.
package.json#importsExtracts babel-build-external-helpers from babel-cli.
babel-build-external-helpersbabel-cliDisallows excess arguments in babel-external-helpers.
babel-external-helpersCleans up unused preset-env data entries in transform-runtime and preset-env.
babel-preset-envbabel-plugin-transform-runtimeEnsures
parseExpression with tokens: true returns the exported tokens.parseExpressionArchives the
babel-plugin-proposal-import-attributes-to-assertions plugin.babel-plugin-proposal-import-attributes-to-assertionsTreats
allowSuperOutsideMethod as top-level only in the parser.allowSuperOutsideMethodUpdates LVal coverage in destructuring-private, do-expressions, object-rest-spread, traverse, and types packages.
Accepts bigints in the t.bigIntLiteral factory.
t.bigIntLiteralFixes incorrect LVal coverage in destructuring-private, do-expressions, destructuring, object-rest-spread, and types.
Stops replacing global
regeneratorRuntime references in the regenerator transform.regeneratorRuntimeDirectly exports the JSON files from
@babel/compat-data.@babel/compat-dataHardens variable declarator validations.
Aligns
esmodules: true behaviour to intersect.esmodulesParses TSHeritageBase.expression as an expression in babel-parser and babel-types.
TSHeritageBase.expressionRemoves legacy
.d.ts type definitions for TypeScript 4.0 and earlier from babel-types.Creates a new TSTemplateLiteralType AST node for TypeScript template literal types.
TSTemplateLiteralTypeParses
export import = as an ExportNamedDeclaration instead of the previous node type.ExportNamedDeclarationCreates TSEmptyBodyFunctionExpression also on invalid input.
TSEmptyBodyFunctionExpressionCreates a ThisExpression node for
typeof this.ThisExpressionCreates TSEnumBody for TSEnumDeclaration in the Babel 8 AST.
TSEnumBodyTSEnumDeclarationWraps the TSImportType argument within a TSLiteralType in Babel 8.
TSImportTypeTSLiteralTypeCreates TSAbstractMethodDefinition and TSAbstractPropertyDefinition in Babel 8.
TSAbstractMethodDefinitionTSAbstractPropertyDefinitionUses TSQualifiedName for the name of namespace X.Y {} declarations.
TSQualifiedNameTSModuleDeclarationSplits the typeParameter of TSMappedType in Babel 8.
TSMappedTypetypeParameterCleans up plugin-transform-runtime options for Babel 8.
plugin-transform-runtimeInlines
toSequenceExpression into @babel/traverse.toSequenceExpression@babel/traverse@babel/typesDisallows synchronous usage of
createConfigItem, loadPartialConfig and loadOptions.createConfigItemloadPartialConfigloadOptionsNumeric literals must be finite and non-negative in babel-types.
Parser now reports a SyntaxError for
} and > in JSX text.Parser now disallows sequence expressions in JSX expression containers.
Bumps eslint-parser/plugin eslint requirements.
Aligns
allow* parser options with ESLint behavior.Adds
"exports" to every package.exportsOnly supports
legacy and 2023-05 decorators.legacy2023-05Applies miscellaneous Babel 8 changes across core, helpers, plugins, preset-env, traverse and types.
Changes file extension handling for TS and Flow presets.
Bundles most packages in Babel 8.
Disallows synchronous usage of babel.* callback methods.
babel.*Requires ObjectTypeAnnotation fields to always be arrays.
ObjectTypeAnnotationFixes property names for function-like TypeScript nodes.
Uses an identifier for TSTypeParameter.name.
TSTypeParameter.nameMoves the @babel/register transform to a separate worker.
@babel/registerImproves template tokenizing.
Materializes ESTree's classFeatures option.
classFeaturesMoves ESLint parsing to a Worker.
Stops skipping requeued paths.
Adds type checking for preset-react options.
preset-reactAdds type checking for preset-flow options.
preset-flowRequires @babel/plugin-proposal-dynamic-import when transforming import() to SystemJS.
@babel/plugin-proposal-dynamic-importImproves syntax highlighting.
Adds type checking for preset-typescript options.
babel-preset-typescriptBundles more packages in babel-cli, babel-node, babel-register, babel-helpers and the fixture test runner.
Security1
Fixes GHSA-968p-4wvh-cqc8, a vulnerability in the .replace method of transpiled regular expressions using named capturing groups.
.replaceModerate · CVSS 6.2Platform4
Requires Node.js ^22.18.0 || >=24.11.0 for all packages.
Requires Node.js ^18.20.0 || ^20.17.0 || >=22.8.0 for every package.
Requires Node.js
^18.20.0 || ^20.10.0 || >=21.0.0 for every package.Requires Node.js
^16.20.0 || ^18.16.0 || >=20.0.0.Deprecations to plan for
Deprecated2
Deprecates the spec and loose plugin options across many transform plugins.
specloosebabel-plugin-transform-arrow-functionsbabel-plugin-transform-classesbabel-plugin-transform-computed-propertiesbabel-plugin-transform-destructuringbabel-plugin-transform-for-ofbabel-plugin-transform-modules-commonjsDeprecates uppercase builders in
babel-types.