Skip to content

Upgrading @babel/runtime 7 to 8

Breaking7.29.10 → 8.0.10Breaking144Security1Platform4Deprecated2New11Changed30Fixed129Other93

BreakingUpgrade verdict

139 breaking changes and 4 platform requirement changes and a security fix.

  • 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.
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).

Breaking139
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#buildUndefinedNode
Removes NodePath#toComputedKey from babel-traverse and dependent plugins.
NodePath#toComputedKey
Removes @babel/plugin-transform-property-mutators and its use in babel-standalone.
@babel/plugin-transform-property-mutators
Removes Import from the Expression alias in Babel 8.
ExpressionImport
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 in the generator, parser, TypeScript transform plugin, and types.
Removes the isPluginRequired export from babel-preset-env and babel-preset-typescript.
isPluginRequired
Removes the blacklist option from babel-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
Removes 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/regenerator
Renames TSImportType.argument to .source in generator, parser, and types.
TSImportType.argumentTSImportType.source
Fully 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/standalone
Drops CJS support from @babel/parser.
@babel/parser
Removes record and tuple syntax support.
Removes the bugfixes option from babel-preset-env.
bugfixes
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 plugins.
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 in Babel 8.
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./helpers/esm
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-jsregenerator
Removes the loose and spec options from preset-env.
babel-preset-envloosespec
Removes CodeGenerator from @babel/generator.
CodeGenerator@babel/generator
Makes parserOpts.createImportExpressions default to true.
parserOpts.createImportExpressions
Removes getModulesPluginNames from preset-env.
getModulesPluginNamesbabel-preset-env
Removes core-js 2 and regenerator support 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
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.
Replaces remaining whitelist/blacklist options with inclusive alternatives in external-helpers, template and traverse.
Gates jsxDEV source/self output behind the new developmentSourceSelf option.
developmentSourceSelfjsxDEV
Passes file instead of path to importToPlatformApi builders.
importToPlatformApi
Makes eslint-parser/experimental-worker the default.
eslint-parser/experimental-worker
The partial-application plugin now requires the "version" option.
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 babel-plugin-proposal-import-attributes-to-assertions plugin.
babel-plugin-proposal-import-attributes-to-assertions
Treats allowSuperOutsideMethod as top-level only in the parser.
allowSuperOutsideMethod
Updates LVal coverage in destructuring-private, do-expressions, object-rest-spread, traverse, and types packages.
Accepts bigints in the t.bigIntLiteral factory.
t.bigIntLiteral
Fixes incorrect LVal coverage in destructuring-private, do-expressions, destructuring, object-rest-spread, and types.
Stops replacing global regeneratorRuntime references in the regenerator transform.
regeneratorRuntime
Directly exports the JSON files from @babel/compat-data.
@babel/compat-data
Hardens variable declarator validations.
Aligns esmodules: true behaviour to intersect.
esmodules
Parses TSHeritageBase.expression as an expression in babel-parser and babel-types.
TSHeritageBase.expression
Removes 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.
TSTemplateLiteralType
Parses export import = as an ExportNamedDeclaration instead of the previous node type.
ExportNamedDeclaration
Creates TSEmptyBodyFunctionExpression also on invalid input.
TSEmptyBodyFunctionExpression
Creates a ThisExpression node for typeof this.
ThisExpression
Creates TSEnumBody for TSEnumDeclaration in the Babel 8 AST.
TSEnumBodyTSEnumDeclaration
Wraps the TSImportType argument within a TSLiteralType in Babel 8.
TSImportTypeTSLiteralType
Creates TSAbstractMethodDefinition and TSAbstractPropertyDefinition in Babel 8.
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 for Babel 8.
plugin-transform-runtime
Inlines toSequenceExpression into @babel/traverse.
toSequenceExpression@babel/traverse@babel/types
Disallows synchronous usage of createConfigItem, loadPartialConfig and loadOptions.
createConfigItemloadPartialConfigloadOptions
Numeric 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.
exports
Only supports legacy and 2023-05 decorators.
legacy2023-05
Applies 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.
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-import
Improves syntax highlighting.
Adds type checking for preset-typescript options.
babel-preset-typescript
Bundles 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.2
Platform4
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.
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-commonjs
Deprecates uppercase builders in babel-types.