Skip to content

Exit Cost: What Leaving a Stack Actually Costs a Team

Teams price how fast a library gets them shipping. The number that decides how a stack choice ages is what it costs to remove it later.

· · 7 min read

Updated: November 23, 2026

Table of retired dependencies from Create React App to Protractor and what removing each one touched

Quick Take

Adoption cost is what a library charges you to start. Exit cost is what it charges you to stop, and it is the number that decides whether a stack choice ages well. Estimate it with three questions: does the tool own a syntax, does it own your test assertions, and does it sit at the build boundary or the runtime boundary? Build-boundary dependencies (Create React App, Grunt, Bower) come out with a configuration change. Runtime-boundary dependencies (Moment.js, Enzyme, styled-components) come out one call site at a time.

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.

DependencyBoundaryWhat removal touchedTrigger and date
Create React AppBuildConfig, env prefixes, test setupSunset 14 Feb 2025
BowerBuildManifest, CI install stepSuperseded by npm and Yarn
GruntBuildTask definitions onlyDisplaced by npm scripts
Moment.jsRuntimeEvery parse, format, and compareLegacy status Sept 2020
EnzymeTest runtimeEvery component assertionNo React 18 adapter
ProtractorTest runtimeEvery end-to-end specDeprecated, end of life summer 2023
AngularJSFramework runtimeEverythingSupport 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:

  1. Which files change when this comes out?
  2. Which tests need new assertions, not just new imports?
  3. 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.

Frequently Asked Questions

What is exit cost in software dependency terms?
Exit cost is the engineering work required to remove a dependency from a codebase after it stops being maintained or stops fitting. It is measured in call sites touched, tests rewritten, and behavior that has to be re-verified, not in license fees. A library used behind one wrapper module has near-zero exit cost. A library whose API appears in 900 files has an exit cost that can exceed the value it ever delivered.
How do I estimate exit cost before adopting a library?
Write the removal pull request description before you write the install command. Name the files that would change, the tests that would need new assertions, and the person who would do it. If you cannot fill in those three lines in ten minutes, the exit cost is unknown, which in practice means high. Then check whether the library owns a syntax, a file format, or a test API, because those three are what make removal expensive.
Is Create React App an example of high or low exit cost?
Low, relative to its blast radius. When the React team sunset Create React App on 14 February 2025, the recommended paths were Vite, Parcel, Rsbuild, or a framework. The migration touches build configuration, environment variable prefixes, and test setup, but it does not touch component code. That is the signature of a build-boundary dependency: the work is a configuration job, not a rewrite of the application.
Why was migrating off Moment.js so much harder than migrating off Create React App?
Because Moment sat at the runtime boundary. Its objects were mutable and its API appeared at every place a date was parsed, formatted, added to, or compared. When the maintainers declared it a legacy project in maintenance mode in September 2020, there was no adapter to install, only call sites to rewrite one at a time with behavior to re-verify at each one.
Does a large community reduce exit cost?
It reduces the risk of being stranded, not the cost of leaving. AngularJS had one of the largest communities in frontend history, and its support still officially ended as of January 2022, in the project's own words. A big community usually means more of your code was written in that library's idioms, which makes the eventual removal larger, not smaller. Popularity is a survival signal. It is not an exit-cost signal.