Skip to content

FISYCO

Public beta

Breaking changes in a component library without breaking teams

6 min read

Engineering
A component card marked deprecated, a codemod card rewriting it, and a chart of remaining call sites going down

Every component library eventually needs a change that breaks someone. A prop gets renamed, a component splits in two, an old variant goes away. Handled badly, it arrives as a major version that product teams postpone for a year. Handled well, it arrives as a warning, a replacement and a script that does most of the work. This guide covers how to ship breaking changes in a component library without breaking the teams that use it.

Key takeaways

  • SemVer gives the contract: deprecate in a minor release, remove in a major. The SemVer FAQ says to keep a deprecation for at least one minor release before removing it.
  • A deprecation needs three things to be useful: a warning where developers look, a named replacement, and a date or version for removal.
  • Codemods turn a migration from a to-do list into a pull request. Chakra UI and React, for example, ship them for their major changes.
  • Know who uses a component before you change it. The number of call sites decides whether a change needs a one-line upgrade note or a migration plan.

What counts as breaking

For a component library, "breaking" is broader than a changed function signature. Any change that makes existing code fail to compile, render differently or behave differently counts:

The visual cases are the ones teams forget. A default that changes silently passes every type check and still changes every screen that relied on it. That's how a library change turns into design system drift in the products that use it.

The contract: SemVer

Semantic Versioning describes the rules most JavaScript packages follow. A major version is for "incompatible API changes", a minor for functionality added "in a backward compatible manner", and a patch for backward-compatible fixes (SemVer).

Two parts of the specification matter most for design systems:

  • Deprecation is a minor change. A minor version "MUST be incremented if any public API functionality is marked as deprecated".
  • Deprecate before you remove. The SemVer FAQ recommends updating the documentation, shipping a minor release with the deprecation, and keeping it for at least one minor release before removing it in a major.

One exception is worth knowing. Under version zero, "anything MAY change at any time". A library still at 0.x hasn't promised anything yet, which is fine early on but surprising for teams that already depend on it.

Deprecate where developers look

A deprecation that only lives in a changelog reaches almost nobody. Put it in three places.

In the editor. TypeScript understands the JSDoc @deprecated tag. Since TypeScript 4.0, editors show it "in completion lists and as a suggestion diagnostic", and VS Code typically shows deprecated values struck through (TypeScript). It's a suggestion, not an error, so it informs without blocking the build.

In development. A console warning in development builds reaches people who don't read JSDoc. Primer's status page lists "a warning is shown to the consumer" among the requirements for deprecated components (Primer). Log it once per component, not on every render.

In the documentation. Mark the component as deprecated and name the alternative. GitHub's Primer defines deprecated components as ones that "will be removed in the future and should be avoided", with documentation that includes "any alternative components" (Primer).

Atlassian formalises the same idea as a promise: "No General Availability feature will be removed from the system without a clearly announced deprecation period" (Atlassian).

Ship the migration, not just the notice

A deprecation tells teams what to change. A codemod changes it for them. A codemod is a script that rewrites source code, usually by parsing it into a syntax tree rather than with text search.

Large projects ship codemods with their majors. Chakra UI's v3 migration starts with npx @chakra-ui/codemod upgrade, with a --dry flag to preview. The documented changes include colorScheme to colorPalette and isDisabled to disabled (Chakra UI). React publishes a collection of codemods "to help update React apps" (react-codemod).

To write your own, two tools cover most cases:

  • jscodeshift, "a toolkit for running codemods over multiple JavaScript or TypeScript files" (jscodeshift).
  • ast-grep, "a fast and polyglot tool for code structural search, lint, rewriting at large scale" (ast-grep).

Here's an example: an ast-grep rule file, modal-to-dialog.yml, for the Modal to Dialog change above. We ran it on a sample component before publishing:

On our sample it rewrote the element and the import. It also collapsed the element's whitespace and dropped the import's semicolon, so run your formatter afterwards. Self-closing <Modal /> tags and imports that mix several names need rules of their own.

A codemod doesn't need to handle every case. If it rewrites the common patterns and leaves a comment on the rest, the migration becomes a reviewable pull request plus a short list of manual fixes. Our guide to design review as code review covers who should approve it.

Know the blast radius first

The cost of a breaking change depends on how often the old API is used, and where. Take a renamed prop as an example: in three files it's a one-line upgrade note, and in four hundred files across five apps it's a project.

Before you schedule a removal, answer three questions:

  1. How many call sites use the old API? Count them per consuming app, not only in total.
  2. Which uses are unusual? Spread props, wrappers and dynamic values are where codemods most often fail.
  3. Who owns them? A removal that lands in another team's code needs their calendar, not only your changelog.

Text search gets you most of the way in a single repository, and a design system audit shows how. Across many, you need an index of where each component is used, kept current as code changes.

A release plan that works

Put together, a breaking change goes through four steps:

Step 3 is easy to skip, and it decides whether step 4 is calm. Removing an API that still has hundreds of call sites invites teams to pin the old version.

Where FISYCO fits

We build FISYCO to make steps 3 and 4 measurable. It indexes your repositories and reads @deprecated tags with their replacements. It can show the blast radius of a component: where it's used, in which files, across the code it indexes. Its review bot flags uses of deprecated components in the files a pull request touches, with the replacement, so fewer new call sites slip in.

AI agents can query the same index through its MCP server before they write UI, as our note on design system context for AI explains.

Connect your repositories and see where a component is used before you change it.
#Governance
KK

Written by

Kirill Karpov

Founder, FISYCO

Kirill Karpov is the founder of FISYCO, a design system assurance tool that keeps Figma and production code in sync.

Get new articles by email

Design systems, tokens and design-to-code delivery. No spam, and you can leave in one click.

By subscribing you agree to get blog emails from FISYCO. Details are in the privacy policy.

Keep your design system and your code in sync

FISYCO connects Figma libraries and your codebase, finds drift and opens the fix as a pull request.

Start for free

Related articles

5 min read

Engineering

Illustrations from Figma: SVG, PNG, WebP, AVIF — what to ship

SVG for flat vectors, WebP or AVIF for everything with texture. How to choose an illustration format, and ship sharp raster files at every density.

6 min read

Engineering

Reviewing AI-generated UI against your design system

AI writes UI fast, and review checks whether it works, not whether it reuses the system. What to look for, what to automate, and how to roll it out calmly.

6 min read

Engineering

Token modes and a dark theme without duplication

A dark theme shouldn't be a copy of the light one. Keep one set of token names, switch only the values, and ship modes as CSS without letting them drift.