Skip to content

Upgrading @babel/core 7 to 8

Breaking7.29.7 → 8.0.10Breaking145Security2Platform5Deprecated2New11Changed33Fixed115Other94

BreakingUpgrade verdict

141 breaking changes and 5 platform requirement changes and 2 security fixes.

  • The useBuiltIns setting for preset-env is now fully gone; it was already supposed to be removed in Babel 8.
  • The runtime package no longer exposes corejs exports, so code importing them will break.
  • The parser no longer accepts the packed locations setting, so configurations using it must change.
  • The plugin that rewrote Object.setPrototypeOf to assignment is gone.
Top 5 of 150 that need code or config changes

@babel/core 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 ↗

Node.js requirement changed in 8.0.0-rc.5: >=6.9.0 → ^22.18.0 || >=24.11.0.

Adds @types/gensync ^1.0.5, empathic ^2.0.1, import-meta-resolve ^4.2.0, obug ^3.0.0, verkit ^0.5.0.

Drops @babel/helper-module-transforms, @jridgewell/remapping, debug, semver.

Installs 37 packages in all (was 38).

Breaking141
Actually removes preset-env's useBuiltIns option, completing a removal announced for Babel 8.
useBuiltInspreset-env
Removes corejs exports for @babel/runtime-corejs3.
@babel/runtime-corejs3
Removes 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-standalone
Removes noop plugins from @babel/standalone.
@babel/standalone
Removes Scope#buildUndefinedNode from babel-traverse.
Scope#buildUndefinedNodebabel-traverse
Removes NodePath#toComputedKey from babel-traverse and dependent plugins.
NodePath#toComputedKeybabel-helper-wrap-functionbabel-plugin-transform-block-scopingbabel-plugin-transform-regeneratorbabel-traverse
Removes @babel/plugin-transform-property-mutators from the repo and babel-standalone.
@babel/plugin-transform-property-mutatorsbabel-standalone
Removes Import from the Expression alias in Babel 8.
ImportExpression
Removes decorators from TSDeclareMethod.
TSDeclareMethoddecorators
Removes unused code for old ESLint versions.
Removes the deprecated default export from @babel/code-frame.
@babel/code-frame
Drops support for ESLint v7 and v8 in babel-eslint-parser.
babel-eslint-parser
Removes the browser entrypoint for @babel/register.
@babel/register
Removes NodePath#visit from babel-traverse.
NodePath#visit
Removes smart pipeline support and the accessor property from the Standardized alias.
babel-plugin-proposal-pipeline-operatorStandardized
Removes @babel/plugin-transform-object-assign.
@babel/plugin-transform-object-assign
Drops support for TypeScript module <identifier> syntax.
Removes the isPluginRequired export from preset-env.
isPluginRequired
Removes the blacklist option from traverse.
blacklist
Removes the plugin-transform-react-compat, plugin-transform-react-source and plugin-transform-react-self plugins.
plugin-transform-react-compatplugin-transform-react-sourceplugin-transform-react-self
Removes regenerator-runtime from @babel/node.
regenerator-runtime@babel/node
Removes the decorator parser plugin options.
Removes corejs2 and legacy files from compat-data.
compat-data
Removes the ./regenerator entrypoint from @babel/runtime.
@babel/runtime@babel/runtime/regenerator
Renames TSImportType.argument to .source.
TSImportType.argumentTSImportType.source
Fully removes import assertions support.
Fully removes Records and Tuples support.
Stops enabling default plugins in @babel/standalone.
@babel/standalone
Drops CommonJS support from @babel/parser.
@babel/parser
Removes record and tuple syntax support from the parser, generator, traverse and related plugins.
babel-plugin-proposal-record-and-tuple
Removes legacy .d.ts files for TypeScript 4.0 and earlier from babel-types.
babel-types
Removes the bugfixes option from babel-preset-env.
babel-preset-envbugfixes
Renames typeParameters to typeArguments for TSClassImplements and TSInterfaceHeritage.
TSClassImplementsTSInterfaceHeritagetypeParameterstypeArgumentsTSImportTypeTSTypeQuery
Renames TSTypeReference.typeParameters to typeArguments in babel-generator, babel-parser and babel-types.
TSTypeReference.typeParametersTSTypeReference.typeArguments
Removes TSModuleDeclaration.global in Babel 8.
TSModuleDeclaration.global
Renames superTypeParameters to superTypeArguments across generator, parser, Flow comments, TypeScript transform and types.
superTypeParameterssuperTypeArguments
Adds TSClassImplements and TSInterfaceHeritage AST nodes and renames TsExpressionWithTypeArguments in Babel 8.
TSClassImplementsTSInterfaceHeritageTsExpressionWithTypeArguments
Removes the minimal and smart options of the Pipeline Operator in Babel 8.
minimalsmart
Drops Flow support for annotations inside array patterns.
Removes some Scope methods in Babel 8.
Scope
Removes the importAssertions parser plugin.
importAssertions
Removes the importReflection parser plugin.
importReflection
Removes the DecimalLiteral AST node in Babel 8.
DecimalLiteral
Removes decimal support from the parser in Babel 8.
decimal
Removes some NodePath methods.
NodePath
Removes the enums option of the flow plugin in Babel 8.
enums
Removes methods starting with _ in @babel/traverse.
@babel/traverse
Removes File.prototype.getModuleName from babel-core.
File.prototype.getModuleName
Removes extra.shorthand from the parser and traverse packages.
extra.shorthand
Removes the syntaxType option for record-and-tuple in the parser and plugins.
syntaxType
Removes core-js and regenerator entrypoints from @babel/runtime-* packages.
@babel/runtime@babel/runtime-corejs3
Removes ./helpers/esm exports from @babel/runtime and drops Node.js 13.0-13.1 support.
@babel/runtime@babel/plugin-transform-runtime
Removes the useESModules option from babel-plugin-transform-runtime.
babel-plugin-transform-runtimeuseESModules
Removes core-js@2 and regenerator support from babel-plugin-transform-runtime.
babel-plugin-transform-runtimecore-js@2regenerator
Removes the loose and spec options from preset-env.
babel-preset-envloosespec
Removes CodeGenerator from @babel/generator.
CodeGenerator@babel/generator
Changes parserOpts.createImportExpressions to default to true.
parserOpts.createImportExpressions
Removes getModulesPluginNames from babel-preset-env.
getModulesPluginNamesbabel-preset-env
Removes core-js 2 and regenerator from preset-env.
babel-preset-envcore-jsregenerator
Removes the -d and -gc aliases from babel-node.
babel-node-d-gc
Removes the getChalk function from babel-highlight and babel-code-frame.
getChalk
Removes builders present only for backwards-compatibility.
Removes selfClosing from the jsxElement builder.
jsxElementselfClosing
Removes the block argument from Scope#rename.
Scope#rename
Removes Super from the Expression alias.
SuperExpression
Removes support for the 2018-09 decorators proposal.
2018-09
Removes the Noop node type.
Noop
Enables preset-env bugfixes by default.
preset-env
Removes module attributes parser and generator support.
Stops creating TSParenthesizedType nodes by default.
TSParenthesizedType
Removes module-specific options from @babel/core.
@babel/core
Falls 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.
useSpreaduseBuiltIns
Removes uglify target support in preset-env.
uglify
Enables the allowDeclareFields option by default for TypeScript.
allowDeclareFields
Removes the jsonCompatibleStrings option from babel-generator.
jsonCompatibleStrings
Enables the allowDeclareFields option by default for Flow.
allowDeclareFields
Falls back to assuming ESM support when using modules: auto.
modules: auto
Disallows decorators on abstract and declare class fields in the parser.
babel-parser
Uses 0-based columns in code frames to match Babel AST locations.
babel-code-framebabel-corebabel-parserbabel-traverse
Disallows a super call after new in the parser, generator, spread transform and types.
babel-generatorbabel-parserbabel-plugin-transform-spreadbabel-types
Replaces remaining whitelist/blacklist options with inclusive alternatives in external-helpers, template and traverse.
babel-plugin-external-helpersbabel-templatebabel-traverse
Gates jsxDEV source/self output behind the developmentSourceSelf option.
developmentSourceSelfjsxDEV
Passes file instead of path to importToPlatformApi builders.
importToPlatformApi
Makes eslint-parser/experimental-worker the default in babel-eslint-parser.
eslint-parser/experimental-worker
Requires the "version" option for the partial-application plugin.
babel-plugin-proposal-partial-applicationbabel-plugin-syntax-partial-application
Uses package.json#imports for browser-specific code in core, transform-runtime and register.
package.json#imports
Extracts babel-build-external-helpers from babel-cli.
babel-build-external-helpersbabel-cli
Disallows excess arguments in babel-external-helpers.
babel-external-helpers
Cleans up unused preset-env data entries in transform-runtime and preset-env.
babel-preset-envbabel-plugin-transform-runtime
Ensures parseExpression with tokens: true returns the exported tokens.
parseExpression
Archives the proposal-import-attributes-to-assertions plugin.
proposal-import-attributes-to-assertions
Treats the parser option allowSuperOutsideMethod as top-level only.
allowSuperOutsideMethod
Updates LVal coverage in destructuring-private, do-expressions, object-rest-spread, traverse and types packages.
Accepts bigints in the t.bigIntLiteral factory, changing parser, traverse and types behavior.
t.bigIntLiteral
Fixes incorrect LVal coverage in destructuring, do-expressions, object-rest-spread and types for Babel 8.
Stops replacing global regeneratorRuntime references in the regenerator transform.
regeneratorRuntime
Directly exports the JSON files from @babel/compat-data instead of the previous export shape.
@babel/compat-data
Hardens variable declarator validations in babel-traverse and babel-types.
Aligns esmodules: true behaviour to intersect in helper-compilation-targets and preset-env.
esmodules
Parses TSHeritageBase.expression as an expression in babel-parser and babel-types.
TSHeritageBase.expression
Creates a new TSTemplateLiteralType AST node for template literal types.
TSTemplateLiteralType
Parses export import = as an ExportNamedDeclaration.
ExportNamedDeclaration
Creates TSEmptyBodyFunctionExpression also on invalid input.
TSEmptyBodyFunctionExpression
Creates a ThisExpression node for typeof this.
ThisExpression
Creates TSEnumBody for TSEnumDeclaration in the AST.
TSEnumBodyTSEnumDeclaration
Wraps the TSImportType argument within a TSLiteralType.
TSImportTypeTSLiteralType
Creates TSAbstractMethodDefinition and TSAbstractPropertyDefinition nodes.
TSAbstractMethodDefinitionTSAbstractPropertyDefinition
Uses TSQualifiedName for the name of namespace X.Y {} declarations.
TSQualifiedNameTSModuleDeclaration
Splits the typeParameter of TSMappedType in Babel 8.
TSMappedTypetypeParameter
Cleans up plugin-transform-runtime options in Babel 8.
@babel/plugin-transform-runtime@babel/plugin-transform-typeof-symbol@babel/runtime-corejs2
Inlines toSequenceExpression into @babel/traverse.
toSequenceExpression@babel/traverse
Disallows synchronous usage of createConfigItem, loadPartialConfig and loadOptions.
createConfigItemloadPartialConfigloadOptions
Numeric literals must be finite and non-negative in babel-types.
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.
exports
Only supports legacy and 2023-05 decorators.
legacy2023-05
Applies other Babel 8 misc changes across core, helpers, plugins, preset-env, traverse and types.
Applies more misc Babel 8 little changes across core, helpers, plugins and preset-env.
Improves 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.
ObjectTypeAnnotation
Fixes property names for function-like TypeScript nodes.
Uses an identifier for TSTypeParameter.name.
TSTypeParameter.name
Moves the @babel/register transform to a separate worker.
@babel/register
Improves template tokenizing.
Materializes ESTree's classFeatures option.
classFeatures
Moves ESLint parsing to a Worker.
Stops skipping requeued paths.
Adds type checking for preset-react options.
preset-react
Adds type checking for preset-flow options.
preset-flow
Requires @babel/plugin-proposal-dynamic-import when transforming import() to SystemJS.
@babel/plugin-proposal-dynamic-importimport()
Improves syntax highlighting.
Adds type checking for preset-typescript options.
babel-preset-typescript
Bundles more packages, affecting babel-cli, babel-node, babel-register, helpers and the fixture test runner.
babel-clibabel-helper-transform-fixture-test-runnerbabel-helpersbabel-nodebabel-register
Security2
@babel/core: Arbitrary File Read via sourceMappingURL Comment
Low · CVSS 3.2
Fixes GHSA-968p-4wvh-cqc8, a vulnerability affecting the .replace method of transpiled regular expressions using named capturing groups.
.replace
Platform5
Requires Node.js ^22.18.0 || >=24.11.0 for all packages.
Adds preset-typescript as an optional peer dependency of babel-core.
preset-typescript
Requires Node.js ^18.20.0 || ^20.17.0 || >=22.8.0 for every package in Babel 8.
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.
Deprecated2
Deprecates the spec and loose plugin options across many transform plugins.
babel-plugin-transform-arrow-functionsbabel-plugin-transform-classesbabel-plugin-transform-computed-propertiesbabel-plugin-transform-destructuringbabel-plugin-transform-for-ofbabel-plugin-transform-modules-commonjsbabel-plugin-transform-optional-chainingbabel-plugin-transform-spread
Deprecates uppercase builders in babel-types.