Guide/Compatibility

Compatibility

SWC Next has its own JavaScript packages and API surface. Integrations built for SWC need to account for differences in the available APIs, configuration, and AST format.

SWC

JavaScript APIs

@swc-next/core is a separate package from @swc/core. Its public APIs cover parsing, AST traversal and editing, and code generation.

CapabilitySWC Next API
ParsingparseSync parses JavaScript and TypeScript into an AST.
AST traversal and editingwalk visits and modifies AST nodes.
Code generationprintSync prints an AST as source code.
Compilation and minificationThe JavaScript packages do not currently expose SWC's transform, transformSync, minify, or minifySync APIs.

Configuration

SWC Next uses separate parser and code generation options and does not load .swcrc files. Compatibility with selected SWC configuration options is planned.

Available options are documented in the Parser and Codegen references.

Plugins

JavaScript plugins can use walk and its visitor hooks to inspect and transform ASTs. SWC's WebAssembly plugins cannot be loaded yet; support is planned for a future release.

AST format

The JavaScript API produces ASTs compatible with the ESTree specification, using typescript-eslint's AST format for TypeScript and JSX nodes.

This differs from SWC's AST format, so existing AST visitors and transformations need adaptation. The JavaScript packages export AST types for working with these nodes.