I've been writing code for thirty-one years, most of it on the web, and the single most expensive lesson from those decades has nothing to do with picking winners. Plenty of the tools I've watched come and go were winners. The bills that hurt came from tools that were good, popular and the right choice at the time, and then had to come out anyway.
That's the part the evaluation spreadsheet never has a column for. We compare bundle size, benchmark numbers, GitHub stars, hiring pool. When did you last see a row labeled "days to remove"? Nobody writes down the removal estimate. My argument is that for any dependency you expect to keep longer than two years, exit cost tells you more about total spend than any adoption metric does.
What exit cost measures
The license fee has little to do with what leaving a stack costs. Exit cost is the number of engineer-days between "this dependency has to go" and "this dependency is gone and the tests still pass." It has three components, and only one of them is obvious:
- Call sites. How many files import it, directly or through something that does.
- Assertions. How much of your test suite asserts against its behavior rather than yours.
- Re-verification. How much of the replaced behavior nobody can prove was identical.
The third is where estimates go wrong. Swapping a date library is find-and-replace right up until you discover that a report depended on an off-by-one the old library produced and the new one doesn't. Nothing in the diff shows it, and no type checker flags it, because both versions compile.
Three questions that predict exit cost
Syntax and file-format ownership
This is the most expensive category and the easiest to spot. CoffeeScript owned .coffee. Sass owns .scss. Vue owns .vue. styled-components owned a tagged template literal that is neither CSS nor JavaScript to any tool that isn't styled-components.
Owning a syntax means your source is no longer portable text. Removing it takes a transpile plus a review of whatever the transpile got subtly wrong. When the styled-components maintainer announced maintenance mode on 17 March 2025 and said plainly that he wouldn't recommend it for new projects, a codebase with thousands of styled components didn't break overnight, but its eventual way out became a rewrite rather than an upgrade.
Sass and Vue aren't bad tools for it, just expensive to leave, and that's worth pricing in.
Test assertions in the tool's vocabulary
Enzyme is the clean case study here. Besides rendering components, it exposed a shallow-rendering model with its own wrapper API, so a mature suite contained thousands of assertions written in Enzyme's vocabulary rather than in the DOM's.
When React 18 shipped, no official Enzyme adapter followed. Wojciech Maj, who maintained the unofficial React 17 adapter, published "Enzyme is dead. Now what?" on 20 December 2021, saying a React 18 adapter was not going to happen without a major rework of Enzyme and that there would be no more stepping stones from him. There was nothing to install. Teams migrating to React Testing Library had to rewrite every assertion, because the two libraries disagree about what a test should even look at.
Test frameworks look cheap because they don't ship to production. So why are they often the most expensive thing in the tree? Because assertions encode intent, and intent is the one thing a codemod can't carry across.
Build boundary vs runtime boundary
This one question sorts most of the field.
| Dependency | Boundary | What removal touched | Trigger and date |
|---|---|---|---|
| Create React App | Build | Config, env prefixes, test setup | Sunset 14 Feb 2025 |
| Bower | Build | Manifest, CI install step | Superseded by npm and Yarn |
| Grunt | Build | Task definitions only | Displaced by npm scripts |
| Moment.js | Runtime | Every parse, format, and compare | Legacy status Sept 2020 |
| Enzyme | Test runtime | Every component assertion | No React 18 adapter |
| Protractor | Test runtime | Every end-to-end spec | Deprecated, end of life summer 2023 |
| AngularJS | Framework runtime | Everything | Support ended Jan 2022 |
Build-boundary tools sit between your source and your artifact. Your components never mention them. The React team's own Create React App sunset notice points at Vite, Parcel, Rsbuild, or a framework, and the swap touches configuration, not components.
Runtime-boundary tools are named in your source, so removing one means editing your source. Moment.js is the textbook example. Its maintainers declared it a legacy project in maintenance mode on 14 September 2020, citing mutable objects and the way it defeats tree shaking and inflates bundles, and every project that had it had it everywhere. If you're doing that migration now, the Temporal API is where the standard landed, but the work is still call site by call site.
And AngularJS? Framework-runtime. The project's own docs say support officially ended as of January 2022, and "migrating" meant rewriting the application. Protractor, its end-to-end runner, went the same way: the npm package carries a deprecation notice that it would reach end-of-life by summer 2023, and GitHub archived the repository in July 2024. Some shops are still paying commercial vendors to keep 1.x patched, which is exit cost expressed as a subscription.
Estimating exit cost in ten minutes
Before you run the install command, write the removal pull request description. Three lines:
- Which files change when this comes out?
- Which tests need new assertions, not just new imports?
- Who does it, and in which quarter?
If you can't answer all three in ten minutes, you don't know the exit cost, and unknown exit cost behaves exactly like high exit cost when the bill arrives. That's the whole technique, and it takes less time than reading the benchmark section of the README.
The follow-up trick is a wrapper. One module that owns the import, exposes the four functions you actually use, and gets mocked in tests. It costs an afternoon and it converts a runtime-boundary dependency into something closer to a build-boundary one. The usual objection is that a wrapper is over-engineering. That objection tends to win the meeting and lose at removal time.
The slower library with an escape hatch
I'd take the slower, uglier library with a boring escape hatch over the faster one that owns my syntax, every time, without benchmarking either.
Most teams do the opposite and call it pragmatism, and I think they're wrong in a way that's hard to see because the cost lands on different people years later. The developer who chose the elegant tool got the productivity win and moved on. The developer paying the removal bill in 2030 never got a vote. If your tooling decisions are made by people who won't be there for the migration, exit cost is a governance problem more than a technical criterion.
There's a real counterargument, and it deserves saying: TypeScript has enormous exit cost, and adopting it was still right. Types touch every file. Removing TypeScript from a large codebase is a genuine project. But it buys correctness at a scale nothing else does, and its output is plain JavaScript, so the escape hatch exists even if it's ugly. High exit cost is acceptable when the payoff is proportional. What goes wrong is high exit cost bought for a marginal convenience.
Ask which one you're buying. Then ask how a package manager comparison or a flat config migration would look in the same terms, because tooling churn is where most teams discover their real answer.
One column to add this week
Add one column to whatever comparison table you're building this week. Call it "removal estimate", fill it in with a number of days, and refuse to leave it blank. A blank cell there is the same as writing "unknown", and unknown is how a two-year-old dependency turns into a four-quarter migration nobody planned.