# What changed in @babel/generator

> 26 changes in @babel/generator 8 from its official release notes, upgrade guides and advisories: 20 breaking, 1 deprecations, 2 new APIs and options. Each one cited. Sources checked 2026-10-27. HTML: https://unstale.sh/npm/@babel/generator/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## @babel/generator 8

### Breaking changes

- The undocumented CodeGenerator class has been removed; use the default exported generate function instead. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- The jsonCompatibleStrings option was removed; use jsescOption: { json: true } instead. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration)
- Importing internal files is disallowed; use the exported API only. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- BigIntLiteral.value is a bigint rather than a string; JSON.stringify cannot serialize bigint values. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- TSParenthesizedType is no longer generated unless createParenthesizedExpression is enabled; node.extra.parenthesized can indicate parentheses when it is false. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- Dynamic import() is represented by an ImportExpression node instead of a CallExpression with an Import callee. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- Generated string literals now output non-ASCII characters as-is; ensure JavaScript files are served as UTF-8, or restore the previous behavior with jsescOption: { minimal: false }. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration)
- The parameters field is renamed to params on TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSFunctionType, TSConstructorType, and TSMethodSignature. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- The typeAnnotation field is renamed to returnType on TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSFunctionType, TSConstructorType, and TSMethodSignature. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- The superTypeParameters field is renamed to superTypeArguments in ClassDeclaration and ClassExpression. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- Class implements entries use TSClassImplements instead of TSExpressionWithTypeArguments; the node uses typeArguments, and qualified expressions are MemberExpression nodes. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- TSEnumDeclaration members are now wrapped within a TSEnumBody node. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- Exported TSImportEqualsDeclaration is parsed inside an ExportNamedDeclaration, and its isExport field is removed. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- TSImportType.argument is renamed to source. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- Interface heritage entries use TSInterfaceHeritage instead of TSExpressionWithTypeArguments; the node uses typeArguments, and qualified expressions are MemberExpression nodes. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- TSMappedType flattens typeParameter into key and constraint properties on the node itself. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- A dotted namespace name such as X.Y is represented as one TSModuleDeclaration whose name is a TSQualifiedName, rather than nested TSModuleDeclaration nodes. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- Interpolated template literal types are represented by TSTemplateLiteralType; non-interpolated template literal types retain their existing AST shape. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- TSTypeParameter.name is an Identifier node rather than a plain string. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- The typeParameters field is renamed to typeArguments on CallExpression, JSXOpeningElement, NewExpression, OptionalCallExpression, TSImportType, TSInstantiationExpression, TSTypeQuery, and TSTypeReference. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)

### Deprecations

- The legacy import() AST can be requested with createImportExpressions: false, but is deprecated and the parser option will be removed in Babel 9. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)

### New APIs and options

- When both estree and typescript parser plugins are enabled, Babel creates TSAbstractMethodDefinition nodes. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
- When both estree and typescript parser plugins are enabled, Babel creates TSPropertyDefinition nodes. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)

### Fixes and other changes

- Keeps parentheses around optional chaining in tagged expressions. (8.0.5) — [release notes](https://github.com/babel/babel/blob/b23345e2a905edb19e35371ec64fcd1a0ea7c8a2/CHANGELOG.md#v805-2026-09-10)
- Improves the check for parentheses around new callees during code generation. (8.0.0) — [release notes](https://github.com/babel/babel/blob/b23345e2a905edb19e35371ec64fcd1a0ea7c8a2/CHANGELOG.md#v800-2026-06-16)
- TSTypeQuery.exprName can be a ThisExpression rather than an Identifier for typeof this. (8.0.0) — [upgrade guide](https://babel.dev/docs/v8-migration-api)
