npm / @babel/traverse
@babel/traverse
What changed in @babel/traverse 8, from its official release notes, upgrade guides and advisories. Also covers @babel/runtime-corejs3, @types/babel__traverse. Sources checked 2026-10-24.
28 breaking1 deprecations2 new APIs and options6 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@babel/traverse 837 changes
Breaking changes 28
path.evaluate no longer evaluates destructured bindings.
Babel is shipped as native ECMAScript modules, affecting how developers load the package.
BigIntLiteral.value is now a bigint rather than a string, aligning with NumericLiteral; JSON.stringify cannot serialize the new value.
TSParenthesizedType is no longer generated unless this parser option is enabled; node.extra.parenthesized can still indicate parentheses when disabled.
Dynamic import() is represented by an ImportExpression node instead of a CallExpression with an Import callee.
Babel 8 packages require Node.js ^22.18.0 || >=24.11.0; older Node.js versions cannot run Babel.
NodePath methods hoist, updateSiblingKeys, call, setScope, resync, popContext, pushContext, setup, setKey, and visit are removed.
The NodePath is, isnt, has, and equals methods are removed; compare properties of path.node directly instead.
NodePath.prototype.toComputedKey and Scope.prototype.buildUndefinedNode are removed; use t.toComputedKey and t.buildUndefinedNode from @babel/types instead.
NodePath#requeue() can now requeue a skipped NodePath; check NodePath#shouldSkip to preserve the previous behavior.
The parameters field is renamed to params on TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSFunctionType, TSConstructorType, and TSMethodSignature.
Methods starting with an underscore are removed from Scope and NodePath.
Scope.prototype.getAllBindingsOfKind and Scope.prototype.toArray are removed.
Scope.prototype.traverse, Scope#parentBlock, and Scope#hub are removed; use scope.path methods and properties instead.
The block argument is removed; call rename on the scope corresponding to that block instead.
Scope#uids and Scope#references become uidsSet and referencesSet Set objects, defined only on the program scope.
The field on ClassDeclaration and ClassExpression is renamed to superTypeArguments.
Enum members are now wrapped in a TSEnumBody node under the declaration's body field.
This node is split into TSClassImplements and TSInterfaceHeritage; the new nodes use typeArguments, and qualified expressions are parsed as MemberExpression.
An exported TSImportEqualsDeclaration is now nested in an ExportNamedDeclaration, and its isExport field is removed; detect export status through the parent path.
The argument field is renamed to source.
The typeParameter property is flattened into key and constraint properties on the TSMappedType node.
A dotted namespace name is now represented by one TSModuleDeclaration whose name is a TSQualifiedName, rather than nested TSModuleDeclaration nodes.
Interpolated template literal types now produce TSTemplateLiteralType nodes; templates without interpolated positions retain their previous AST shape.
TSTypeParameter.name is now an Identifier node rather than a plain string.
For typeof this, exprName is now a ThisExpression rather than an Identifier named this.
The typeAnnotation field is renamed to returnType on TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSFunctionType, TSConstructorType, and TSMethodSignature.
The field is renamed to typeArguments on CallExpression, JSXOpeningElement, NewExpression, OptionalCallExpression, TSImportType, TSInstantiationExpression, TSTypeQuery, and TSTypeReference.
Deprecations 1
The Babel 7 import() AST can be requested by setting this parser option to false; the legacy AST is deprecated and the option will be removed in Babel 9.
New APIs and options 2
This node is created when both the estree and typescript parser plugins are enabled.
This node is created when both the estree and typescript parser plugins are enabled.
Fixes and other changes 6
Traversal now visits decorators of TSParameterProperty nodes.
NodePath#evaluate now evaluates TypeScript expression wrappers.
Handles null when retrieving all next siblings.
Handles null when retrieving all previous siblings.
Removing a node now unwraps a single sequence expression.
Calling replaceWith in Visitor#exit no longer stops traversal.