Reviewing the Options: Tools That Spot Breaking Changes Before You Publish
A version number is a promise, and the people making the promise are usually tired humans reading a diff. Several ecosystems now have tools that compare a package's public API against its last release and flag incompatible changes. This review explains the main types, names a few established examples, and is candid about the blind spots they all share.
Our review method
We ask what each kind of tool compares (source, compiled types, or binary interface), what it reports, and how it fits into CI. We deliberately avoid star ratings: these tools serve different languages and are not substitutes for each other. The examples named below are long-standing open-source projects; check their own documentation for current options.
Type and signature diffing
TypeScript. Microsoft's API Extractor generates an API report file from a package's declaration files. Committing that report means any change to the public surface shows up as a diff in code review, where someone has to approve it consciously. A separate check worth knowing is "Are the types wrong?", which inspects whether a package's type declarations resolve correctly under different module settings, a frequent source of breakage in dual ESM/CJS packages.
Rust. cargo-semver-checks compares a crate against a published version and reports changes that would require a major bump under Cargo's semver rules, such as removing a public item or adding a field to a public struct that callers can construct directly.
Go. The Go team's apidiff and the experimental gorelease command compare two versions of a module and report incompatible changes, and gorelease will suggest a version number accordingly.
Java. japicmp compares two JAR files and reports both source and binary incompatibilities, which matters on the JVM because a change can compile fine yet fail at link time.
Consumer-contract tests
A different approach: keep a small test project that uses the package exactly as the documentation does, and run it against every candidate release. It catches behavioural breakage that signature tools cannot see, such as a default value changing or an error type being swapped. It is more work to maintain, but it tests the thing users actually experience.
# CI sketch: test the packed artifact, not the source tree
npm pack
cd contract-tests && npm install ../package-a-*.tgz && npm test
What none of them catch
- Behaviour with the same signature. Returning results in a different order, or rounding differently, passes every type check.
- Performance cliffs. A function that becomes much slower is not a type change.
- Packaging changes. A missing file in the tarball, a changed
exportsmap or a raisedenginesfloor may be outside what a source-level tool inspects. - Untyped languages. In plain JavaScript or untyped Python, surface diffs are partial at best.
Comparison at a glance
| Type of check | Catches | Misses | Effort |
|---|---|---|---|
| API report diff | Added, removed or changed exports and signatures | Behaviour | Low once set up |
| Semver rule checker | Changes that violate the ecosystem's semver rules | Behaviour, packaging | Low |
| Contract tests on the tarball | Documented usage breaking | Undocumented usage | Medium |
Our suggestion is to combine one automated surface check with a small contract suite. The release tooling that consumes the result is reviewed in release automation approaches.