This guide summarizes major-version changes introduced in v3.
v3 replaces the acorn-walk wrapper with an internal SWC-native traversal engine.
This is a major release because traversal internals changed and some edge-case behavior may differ even when API usage stays the same.
The primary API shape remains the same:
simple(node, visitors, base?, state?)ancestor(node, visitors, base?, state?)
State passing is unchanged.
No code changes are required for typical usage:
simple(ast, visitors, undefined, state)Custom base visitor overrides are still supported in v3.
v3 also preserves override-type callback dispatch:
cb(node, state, 'ExpressionStatement')If traversal is redirected to a node type that has no matching base handler, v3 throws at runtime.
acorn-walk is no longer a runtime dependency.
Even with compatible API shape, downstream projects may observe differences in traversal order or edge-case visitation because the walker implementation changed.
If your tooling depends on exact visit sequencing, validate output on representative ASTs.
- Upgrade to v3.
- Run your test suite, especially tests that assert traversal behavior or ordering.
- Validate custom base visitor overrides, including override-type dispatch.
- Compare generated artifacts if traversal powers transforms or analysis outputs.